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
Meteor 1.3 recomended app structure. #172
Comments
No. Mantra is build with Meteor 1.3 in mind. You don't need do that. Follow the architecture we've mentioned. |
I think it would be better if Mantra used explicit importing (via the |
@chriswessels Mantra uses explicit imports everywhere. |
We use this because we need to place CSS files next to UI components. Earlier it was not possible to do that inside the I think we need to come up with two things.
This is the way how we can really fix this. What's currently in Meteor is suboptimal. For mantra, this is a not an issue at all. Even we write code in the |
👍 CSS imports are painfully missing in Meteor 1.3. |
For what it's worth, from everything I've learned about the 1.3 architecture it would actually be in our benefit to support placing our modules inside of import directories since we're already importing inside the code anyways and it should speed up the app a bit to not eagerly load everything. If we could solve the CSS issue I'd support using |
The only reason to move our code under
This second question is because MDG is big on backwards compatibility so they would have only kept eager loading around to ease the transition from 1.2 to 1.3. At some point, Meteor will have a post 1.3 release that removes eager loading entirely, and it will most likely happen before or with 1.4. At which point, we'd need to move our app code back outside |
It will surely by as you say, @merlinpatt, but I think another point is that Mantra should not depend on Meteor. If someone comes here without knowing the transition from Meteor 1.2 to 1.3, they would be shocked to see we have everything inside the folder |
@merlinpatt I do not believe that the MDG is planning on removing eager loading entirely. The purpose of the |
about |
by CSS Imports, are you guys saying importing css files in js files? In Meteor 1.3, you can simply |
@sammkj are you sure that works? Asset loading and CSS loading is still on post 1.3 roadmap. |
I can confirm. you will have to put your stylesheets in the |
and actually this is already enabled during the betas. Lazy loading CSS modules.
in the history.md |
@sammkj so no loading CSS from NPM packages. [EDIT] I'll give it a go later and confirm this. |
yea. that will be in 1.3.1. I wasn't sure if you guys are talking about lazy load css or loading npm css. |
Lazy-loading through CSS processors is a bit hit and miss, but hopefully that too will make it into 1.3.1. For ref, [Question] Why is imports directory not used? · Issue #39 · kadirahq/mantra For now you could try (Meteor-)Webpack for both that and from NPM modules. See something like Importing sass files from node_modules · Issue #121 · thereactivestack/meteor-webpack |
By having things like "libs" directory that does not sit within "client" or "imports" directory, it is easy for server code to run eagerly - introducing multiple entry points to the app by accident. For example, these collections are codes that run automatically on both server and client. Using "imports" directory can avoid this. |
@natecox see Zoltan's quote here https://youtu.be/NICqNT-U4gk?t=1h11m58s regarding the future of the imports directory |
Meteor guide, updated for fresh 1.3 version, recommends the following folder structure:
http://guide.meteor.com/structure.html#example-app-structure
Should we move mantra related code to the imports/client folder and leave only main.js in the client folder as client entry point?
The text was updated successfully, but these errors were encountered: