You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.
I’d like to document how this solution is different from import()/require.ensure(). This would simplify the choice between these tools: from the first sight, bundle-loader?lazy and import() are very similar, and you could get stuck thinking what to choose.
This is what I’ve found so far:
Advantage: Per react-router docs, on additional renders, the loader calls the callback synchronously. This prevent the flashing of the loading screen.
Disadvantage:import() and require.ensure() allow handling the loading error (e.g. with .catch()), and bundle-loader doesn’t.
Disadvantage: Because this is a loader, the developer should either
name a file after a specific pattern (e.g. .lazy.js) to apply the loader to it (this requires renaming files, which is a pretty large event) or
specify the loader inline (which is a rare and webpack-specific notation).
Are there any other known differences I’m missing?
The text was updated successfully, but these errors were encountered:
I’d like to document how this solution is different from
import()
/require.ensure()
. This would simplify the choice between these tools: from the first sight,bundle-loader?lazy
andimport()
are very similar, and you could get stuck thinking what to choose.This is what I’ve found so far:
import()
andrequire.ensure()
allow handling the loading error (e.g. with.catch()
), andbundle-loader
doesn’t..lazy.js
) to apply the loader to it (this requires renaming files, which is a pretty large event) orAre there any other known differences I’m missing?
The text was updated successfully, but these errors were encountered: