mantrajs / mantra-sample-blog-app

A sample blog app built with Mantra

Home Page: http://mantra-sample-blog-app.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lazy loading - client/imports & server/imports

ShockiTV opened this issue · comments

Hi,
as we are using imports for all stuff anyway, what about migrating to lazy loading ?
That means moving client content into client/imports and loading it from client folder for example
import app from './imports';?

Was this already tried and failed due for example styling not being evaluated as expected ? As Meteor take cares of it by default in global mode.
If that was the case maybe we can simply ignore Meteor and start to use CSS modules with all the pre- and post- processing. I would vote for that - true modules with CSS/SCSS/LESS scoped to that component without need to care where you place that component, as it would have always unique auto-generated hash class.

I have not tried that yet, busy with other projects.
What do you think ?

You'll find some info at kadirahq/mantra/issues/39. Basically this moved away from /imports for now. Not sure bypassing Meteor or using something like Webpack would be considered, since we can probably expect it to work with most common pre-processors, including Stylus and LESS, by the time Meteor 1.3 is out, but arunoda can speak on that.

@jiku is correct. CSS is the issue.
If we've a proper solution, I think that's fine.

Anyway, I like the current approach. That's because we don't need a special directory called imports.
I assume, Meteor will go default lazy loading later.

So, I don't need to worry about this now.
Currently, there's no issue with the current solution. We get the best of both worlds.
If we have some issue, we can find some solution.