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
  • !3776

Compile dependencies with babel-preset-env

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge compile-deps into next Jan 13, 2018
  • Overview 30
  • Commits 1
  • Pipelines 0
  • Changes 4

Created by: gaearon

Proof of concept for https://github.com/facebookincubator/create-react-app/issues/1125. This currently runs all node_modules through babel-preset-env.

(Which was unsafe in Babel 6, but should—maybe—be safe in Babel 7.)

I don't know the impact on the build time. It'll definitely make the cold start slower but hopefully repeated builds will be okay. We need some measurements with larger projects here: https://mobile.twitter.com/dan_abramov/status/952248179478745089.

I intentionally only did this for webpack. I don’t think we need to do this for tests because you control the Node version on which you run the tests, unlike the user’s browser. And it’s never required to compile because we intentionally don’t allow any custom transforms (like JSX). Only “real” JS gets compiled.

TODO:

  • Measure build time impact
  • Consider opt-out heuristics (e.g. "too old" engines field that implies we don't need compilation)
  • Verify this doesn't break third-party code
  • Verify generators and async/await work in deps
  • Verify helpers for the above are being shared (e.g. runtime transform)
  • Verify .babelrc in packages gets ignored
  • Create end-to-end tests for these situations
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: compile-deps