-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
In test-react-loadable, we attempted to use dynamic imports along with react-loadable to split our web-app based on React component/feature. This would give us several benefits:
- reduce load time of main page
- allow us to create a separate bundle for installation stuff (e.g. opencv, all the wip/ stuff)
- allow us to unify more disparate parts together, since we worry less about bundle bloat
- allow us to only download the assets and js files we need to for each specific sketch
- allow us to write "global"-like code in sketches that don't actually run/use resources until that sketch is loaded (although this seems like a code smell)
Problems
To do this, we needed to use "module": "esnext" in tsconfig.json for typescript to properly emit real import() statements that webpack could then parse. But this breaks threejs's example extensions, since they all rely on a global THREE object. We can kind of work around this by using webpack's import-loader/export-loader but it needed more work.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels