For sure, thanks for the feedback! I will try to clean up the post and take out duplicate statements- as you can see I originally knew it was TMI, so that’s why the second part starts with the caveat “Anything beyond this point is extra info”. This post serves as a recipe, as far as I can tell there is no good way or reason to make it a module — the best thing I could do would be to make a yeoman generator for this. You definitely have to re-evaluate your imports, that’s the nature of almost all programming languages. However, one thing you are incorrect about is: the async shizzleness remains! The sync behavior is mentioned to explain why you can synchronously require code in the render method, but at the top of the module, it was originally asynchronously loaded! So the first load is asynchronous, but any subsequent load is synchronous if that makes sense. (Because any subsequent re-load is due to hot-reloading only). So in production, since there will only be one load (because you’re not hot-reloading in prod right?), that first load will be async. Hope that makes sense :) Feel free to add more comments and thanks again for feedback.
Cool concept, and I read it through.
Carl-Erik Kopseng
11