Sure! I could use some help cherry picking them though. Most of the improvements are to the webpack surface of that package - but we don’t need any of that. I do see one error swallowing fix that I can apply (I’ll verify it’s an issue, and then port the fix over).
If you see any others let me know through an issue or PR, and I’ll incorporate it.
Actually I think that error swallowing fix is superfluous - the error is already captured in the load method, making this unnecessary (at least in my version).
Because of the server returns the level 2 loadable files, in the client side the loadable preloadLoadables() script try to load them, but it doesn’t exist in INITIALIZERS_BY_MODULE array. Then this function will return an undefined rersult
When the function flushInitializers was called with an array of initializers which has undefined element, the init is not function. The client crash here.
export function flushInitializers (initializers) {
const promises = []
while (initializers.length) {
const init = initializers.pop()
promises.push(init())
}
return Promise.all(promises).then(() => {
if (initializers.length) {
return flushInitializers(initializers)
}
})
}
I’ve just found some interesting thing. If I try to load the multiple level loadable page right at the begining (press f5 key), then the error occurred.
But if I try to load another page then go to that page again then no error occurs.
What does your loadable setup look like - are you using the babel plugin?
There may be a flaw in the way the Loadables are registered. I think I solved this in svelte-loadable by checking if a module has already been loaded, and using that if it has - but I don’t know what happens in this case (this is a port - I should have made more of an effort to rewrite it in some way I understand).
A wrapper component will only effect the babel plugin - should be fine to use it without. But can you show some code? I’m looking specifically to see what the meteor value is.
I came across this package yesterday looking for ways to stop using react-loadable. Great idea! But I somehow can’t get this to work.
I’ve done meteor add npdev:react-loadable. I’ve tried also git clone-ing the repo to my packages folder. I’ve tried with and without the babel plugin.
The error message on startup begins with Error: Cannot find package "npdev:react-loadable". Try "meteor add npdev:react-loadable". Which I’ve done, as I said.
Thanks, but still no dice. Could be something unusual with my setup. So for now going back to, um, pretending to ignore all the warnings to Rename componentWillMount to UNSAFE_componentWillMount…