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
  • Merge requests
  • !6590

WIP: differential serving allow modern ES2015 and legacy ES5 build

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/JoviDeCroock/feat/modern-build into master Mar 07, 2019
  • Overview 18
  • Commits 15
  • Pipelines 0
  • Changes 9

Created by: JoviDeCroock

  • provide dynamic babel config
  • provide dynamic webpack config
  • Add to react-dev-utils
  • opt-in with --modern
  • optimize babel config (lose some polyfills)
  • test file size differences
  • write documentation about --modern

For now this is a WIP since I did not know if we wanted to opt-in by default or opt-out by default.

So when running the production yarn build at this point it will build your files with .modern and normal. This will be served when opening in chrome you will see the .modern in your network tab and when opening on IE11 you'll see the normal ones.

Also I have personally been advocating heavily for .modern bundles in libraries, this would impact file size differences even more, since now every library is shipped as ES2015 by default (I don't think this is feasible for now).

big thanks to @prichodko in this PR which has heavily influenced the webpack plugin.

Own POC with polyfills for legacy and none for modern

I would like to spark some discussion about the unfinished points before I continue if this is possible.

Related: https://github.com/facebook/create-react-app/projects/5#card-15632785

EDIT: I would like to know what babel-preset-react-app/dependencies, from what I understand you transpile your deps down a bit more than usual. So in modern config we would just not include this?

If anyone has doubts about this feature, I recently made a big post about browser support etc here

NOTE: this needs a new publish of react-dev-utils

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/JoviDeCroock/feat/modern-build