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

Configure React development flag, inherit NODE_ENV from execution context #4972

Merged
merged 6 commits into from
May 17, 2023

Conversation

alexkirsz
Copy link
Contributor

@alexkirsz alexkirsz commented May 16, 2023

Description

This PR allows Turbopack users to configure the development flag from the SWC React transform. This is used in vercel/next.js#49852.

This PR also makes the Node.js evaluation asset context inherit its NODE_ENV from the execution context.

Testing Instructions

N/A

@alexkirsz alexkirsz requested a review from a team as a code owner May 16, 2023 11:35
@vercel
Copy link

vercel bot commented May 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
turbo-site 🔄 Building (Inspect) May 16, 2023 0:51am
10 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) May 16, 2023 0:51am
examples-cra-web ⬜️ Ignored (Inspect) May 16, 2023 0:51am
examples-designsystem-docs ⬜️ Ignored (Inspect) May 16, 2023 0:51am
examples-gatsby-web ⬜️ Ignored (Inspect) May 16, 2023 0:51am
examples-kitchensink-blog ⬜️ Ignored (Inspect) May 16, 2023 0:51am
examples-native-web ⬜️ Ignored (Inspect) May 16, 2023 0:51am
examples-nonmonorepo ⬜️ Ignored (Inspect) May 16, 2023 0:51am
examples-svelte-web ⬜️ Ignored (Inspect) May 16, 2023 0:51am
examples-tailwind-web ⬜️ Ignored (Inspect) May 16, 2023 0:51am
examples-vite-web ⬜️ Ignored (Inspect) May 16, 2023 0:51am

@github-actions
Copy link
Contributor

✅ This change can build next-swc

@github-actions
Copy link
Contributor

github-actions bot commented May 16, 2023

⚠️ CI failed ⚠️

The following steps have failed in CI:

  • Turbopack Rust tests (mac/win, non-blocking)

See workflow summary for details

@github-actions
Copy link
Contributor

Linux Benchmark for 9779663

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 5015.42µs ± 34.93µs 5104.70µs ± 60.84µs +1.78%
bench_hmr_to_eval/Turbopack CSR/1000 modules 4647.58µs ± 37.55µs 4703.45µs ± 195.13µs +1.20%
bench_startup/Turbopack CSR/1000 modules 754.64ms ± 2.07ms 750.03ms ± 1.82ms -0.61%

@alexkirsz alexkirsz changed the title Configure the React transform development flag Configure React development flag, inherit NODE_ENV from execution context May 16, 2023
@github-actions
Copy link
Contributor

Linux Benchmark for 5b97e8e

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8851.30µs ± 112.29µs 8478.32µs ± 115.34µs -4.21%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7302.41µs ± 92.64µs 7643.09µs ± 604.02µs +4.67%
bench_startup/Turbopack CSR/1000 modules 906.43ms ± 1.93ms 909.61ms ± 9.06ms +0.35%

@github-actions
Copy link
Contributor

MacOS Benchmark for 5b97e8e

Test Base PR % Significant %
bench_hmr_to_eval/Turbopack CSR/1000 modules 25.92ms ± 0.12ms 24.97ms ± 0.12ms -3.65% -1.81%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 26.08ms ± 0.15ms 26.20ms ± 0.20ms +0.46%
bench_hmr_to_eval/Turbopack CSR/1000 modules 25.92ms ± 0.12ms 24.97ms ± 0.12ms -3.65% -1.81%
bench_startup/Turbopack CSR/1000 modules 2642.05ms ± 27.02ms 2731.46ms ± 37.40ms +3.38%

@alexkirsz alexkirsz merged commit 4d39f01 into main May 17, 2023
41 of 43 checks passed
@alexkirsz alexkirsz deleted the alexkirsz/web-397-next-mode branch May 17, 2023 08:21
sokra pushed a commit to vercel/next.js that referenced this pull request May 17, 2023
This introduces a `NextMode` enum that controls which mode Next.js Turbo
is currently running in:
* `NextMode::Development`: `next dev`
* `NextMode::Build`: `next build`

Requires vercel/turbo#4972

This also update Turbopack to `turbopack-230517.2` with the following
changes:

* vercel/turbo#4972 <!-- Alex Kirszenberg -
Configure React development flag, inherit NODE_ENV from execution
context -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
hydRAnger pushed a commit to hydRAnger/next.js that referenced this pull request Jun 12, 2023
This introduces a `NextMode` enum that controls which mode Next.js Turbo
is currently running in:
* `NextMode::Development`: `next dev`
* `NextMode::Build`: `next build`

Requires vercel/turbo#4972

This also update Turbopack to `turbopack-230517.2` with the following
changes:

* vercel/turbo#4972 <!-- Alex Kirszenberg -
Configure React development flag, inherit NODE_ENV from execution
context -->

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants