Hacker News new | ask | show | jobs
by swyx 3062 days ago
is there a way for React to do eager loading? i asked around on twitter but got told "thats not React's job".
2 comments

Loading of modules can be managed by Webpack's chunk configuration. Each import declaration can be turned into a promise that executes your code when all dependencies are fetched.
I think the react dev team is currently working on an official async loading pattern for a future update. But currently webpack, rollup, etc. offer dynamic import, code-splitting, tree-shaking
Not sure if that's what you mean, but when Andrew Clark keeps mentioning the "async" word, he means async rendering, not async loading.
What is an unsolved async loading problem in React you are experiencing?
I don't have any issues with async loading. I'm just saying that I believe what you are referring to when you say the React team is working on an official async pattern is not actually async loading, but async rendering.

At least every time one of their members said the word async in the last couple of weeks/months, it's what they referred to, and it's a completely different (and unrelated) thing. I can't read your mind though, so I'm just guessing.