veliovgroup / flow-router

🚦 Carefully extended flow-router for Meteor
https://packosphere.com/ostrio/flow-router-extra
BSD 3-Clause "New" or "Revised" License
202 stars 29 forks source link

Using waitOn for async imports may break styles #49

Closed janat08 closed 6 years ago

janat08 commented 6 years ago
dr-dimitru commented 6 years ago

@janat08 https://github.com/Blockrazor/blockrazor/issues/1352#issuecomment-385385425 is closed, I'm confused. Is it solved?

janat08 commented 6 years ago

Yes it was solved before I opened this issue, using async and imports fixed it instead of waitOn hook.

dr-dimitru commented 6 years ago

Feel free to reopen it in case if the issue is still persists on your end.

janat08 commented 6 years ago

the navigation error wasn't about the waitOn hook, but the rest of it is a bug though. I imagine if you just await import it won't eagerly load rest of the bundle on window load?

janat08 commented 6 years ago

or rather making the imports part of the initialization step.

dr-dimitru commented 6 years ago

@janat08 thank you for coming back with it.

  1. I still can't understand where issue is;
  2. Small reproduction will help a lot (speak code).
janat08 commented 6 years ago

I'll not look for reproduction, since judging by how the app doesn't begin loading pages/templates between navigations I suppose using async/await is okay.

janat08 commented 6 years ago

It's possible that we were depending on SASS variables defined by a theme that was dynamically imported under different file/route or something, so indeed this may not be so much a bug.

dr-dimitru commented 6 years ago

@janat08 Dynamically importing styles might be tricky. But you should be good as long as you importing .js file dynamically, where .sass imported statically.