-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal for new Yesod project skeleton structure #997
Comments
This looks well thought out, thank you! On the whole it looks good, and I have used some similar techniques in the past to make App available outside the Handler. I don't like the name What I have always done for separating code is to place all of the code for database queries into |
No, the commonality is that code does not depend on
Yes, it is.
Yes, this is also reasonable, but what I mean under One guy offered next structure of project: App.FoundationImport -- should be imported by `*.Handler` modules only
App.NoFoundationImport -- should be imported by any other module which must not be dependent from `App`
App.DB.* -- for models and working with database
App.Route.Home.Handler -- same as `Handler.Home` in old structure. This module depends on `Foundation` and have access to `Route App` (import App.FoundationImport)
App.Route.Home.Form -- for form types which is used in `App.Route.Home.Handler`. This module written in independent from `App` fassion (import App.NoFoundationImport)
App.Route.Home.Common -- some other code used in elsewhere in Form or Handler (import App.NoFoundationImport)
App.Common.* -- Some other common modules used anywhere in project. Should not depend on `App` and `import App.NoFoundation` |
I really like this. |
I really like how the code is packed neatly under |
I'm definitely OK with changes along these lines. Ultimately this should become a PR on the yesod-scaffold repository's postgres branch in order to replace the current scaffolding. Has this been tested with |
No, I did not. I would PR this, but I have no idea how to pack this skeleton into |
That's what I was saying about yesod-scaffold; have a look at https://github.com/yesodweb/yesod-scaffold#readme |
Oh, looks like I failed. I was must fork |
I have just updated yesod-skel. Is this ok to PR in |
It's certainly OK to PR, no objection there. @gregwebs or I may have more comments before it can be merged, however. |
I will take a closer look at things tomorrow. I would still like to come up with a better name than |
I have removed |
Pull request created |
Really great initiative! I have a few questions, and some remarks.
Wow. That is quite a list! Please to not take my comments as something against your work: I strongly agree that revising the structure is worth it, and I really like what you are showing in your proposal. But changing things on this matter it is is not cheap: docs go out of sync, StackEx answers go out of sync, some people will want to update their apps to reflect the new structure. I think for that matter is it important to do it "all the way" (maybe there are also some function/datatype names that we want to improve upon), together with a major version bump, and then not touch it for a while. I really hope this will make Yesod projects more accessible, especially to newcomers. |
Thanks for chiming in. With respect to |
@gregwebs iirc in rails they also started scoping to a custom name. I think the reason there was "in case you ever want to mount your app into an other app". |
Discussion for this issue migrated to the above linked PR, so I will close this. |
Hello, here is a proposal for improovement of structure of new (scaffolded) Yesod project.
https://github.com/s9gf4ult/yesod-skel
What do you think about?
The text was updated successfully, but these errors were encountered: