Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #1192
Closed
Open
Issue created Dec 07, 2016 by Administrator@rootContributor0 of 5 checklist items completed0/5 checklist items

Add support for dynamic import()

Created by: gaearon

Update: @shubheksha will be working on this. Please coordinate with her on specific parts you want to help with.

Now that it's stage 3 we can add it. We should also add relevant documentation (add a "Code Splitting" section to User Guide).

Since we use Webpack 1.x for now, I think we need https://github.com/airbnb/babel-plugin-dynamic-import-webpack but I'm not entirely sure.

TODO items here:

  • Figure out which Babel plugin implements current version of https://github.com/tc39/proposal-dynamic-import and compiles down to require.ensure.
  • Add said Babel plugin to babel-preset-react-app.
  • Figure out what should happen in the test environment. Probably need to add some sort of a fallback that turns it into Promise.resolve(require(moduleName)).
  • Add documentation about using code splitting.
  • Ship it!

Let us know if you want to help. I won't have time to work on this.

Please leave a comment below if you want to work on this. If somebody is already working on it, please offer to collaborate with them if you like. Don't try to "be there first" if somebody is already working on some part of this. Please collaborate in this issue and split responsibilities.

I'm excited about finally having a way to code split JS code without Webpack-specific syntax! And when we switch to Webpack 2, we'll change to a different plugin (or maybe won't need it at all?)

Assignee
Assign to
Time tracking