Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] Use new runtime by default or fix the detection #9822

Closed
gaearon opened this issue Oct 17, 2020 · 4 comments
Closed

[v4] Use new runtime by default or fix the detection #9822

gaearon opened this issue Oct 17, 2020 · 4 comments
Projects
Milestone

Comments

@gaearon
Copy link
Contributor

gaearon commented Oct 17, 2020

I'm starting to think that automated detection might be a significant footgun. At least when done this way. https://github.com/facebook/create-react-app/pull/9788/files#r506932998

I'm leaning towards this proposal:

  1. Enable new transform by default in V4 (since we've now released compatible React versions for all majors)
  2. Offer an env option to turn it off

This also addresses automatic detection issues in facebook/react#20031 (comment).

@Andarist
Copy link
Contributor

Andarist commented Oct 17, 2020

IMHO the detection is fine - it solves more problems than it creates. As mentioned in the other thread - I believe that if pragmas alone would reconfigure the transform then there wont be a problem here. We would eat the cake and have it too 😉

@mrmckeb
Copy link
Contributor

mrmckeb commented Oct 18, 2020

Just waiting for some more thoughts from the team on this, but we could leave the automatic detection on - with a manual "emergency" flag, as we know it may fail in some cases (where there are mixed React versions installed).

Another option may be to move back to the previous logic, and find another way to resolve the Jest issue - maybe an environment variable that we set in test or something like that.

@mrmckeb mrmckeb added this to the 4.0 milestone Oct 18, 2020
@mrmckeb mrmckeb added this to To do in v4 via automation Oct 18, 2020
@gaearon
Copy link
Contributor Author

gaearon commented Oct 18, 2020

We definitely need an opt-out flag. For detection, if we leave it in — it needs to resolve React from the application folder (and not from react-scripts's own folder). It needs to happen outside the Babel preset because the preset output itself must be deterministic, or caching won't work correctly.

@iansu
Copy link
Contributor

iansu commented Oct 23, 2020

I think I addressed all these issues in #9861

@iansu iansu closed this as completed Oct 23, 2020
v4 automation moved this from To do to Done Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
v4
  
Done
Development

No branches or pull requests

4 participants