No - he’s discussing the pitfalls of using Webpack 2. Read on …
By contrast, in the Meteor 1.5 implementation of dynamic import(…), the client has perfect information about which modules were in the initial bundle, which modules are in the browser’s persistent cache, and which modules still need to be fetched. There is never any overlap between requests made by a single client, nor will there be any unneeded modules in the response from the server. You might call this strategy exact code splitting, to differentiate it from bundling.
This means that, in most cases, you can load every dynamic module exactly once. Even if you push an entirely new version of your app, if that’s using the same version of a library as before that will still be loaded from local storage.
Sorry - my experience of Atom is limited to a disappointing evaluation. According to issue#136 it should work. Lots of people here do use it - maybe they can help?
@benjamn is react-loadable the “recommended” way of dynamically loading and rendering a React component then? If so, it’d be nice to have an example that uses not only a “user” component, but also an NPM one…?
My test for this was incorrect, I was logging bundles which were processed… instead I needed to monitor webframes and watch the actual imports.
@sashko & @benjamn were correct (no surprise) and each dynamically imported component is only imported 1 time, even if imported via different hierarchies.
I’ve been really disappointed with all the hype and lack of real world examples for this feature. I honestly can not figure out how to do this with even the most basic example. I am using React, React Router, and i have a sign-in page i’d like to load async inside of my App component.
const Login = await import (’./Login’)
<Route path="/login" exact component={Login} />
this doesn’t work. as stated above it needs to be in an async function? or have a .then() afterwards where you “do something with it”? I can’t seem to find a single example where this is properly explained.
It seems that everybody is aware that a lot of people are using React, but yet all the examples of this use Blaze Templates. It’s super confusing. I was really excited to use and understand this feature, but i just do not understand where to go for a complete working example of doing this with react. could somebody help explain?
Works absolutely fine and you don’t even need react loadable package either.
I spent one evening moving all client components into the import folder, and moving files to CDN where I could. Was able to cut down app bundled size from 400kb+ to a lean 266kb. Load times have improved dramatically as well as my server only has to serve a smaller initial file before the app loads up.