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

refactor(turbopack-ecmascript): deprecate enable_emotion, enable_styled* #4955

Merged
merged 1 commit into from May 22, 2023

Conversation

kwonoj
Copy link
Contributor

@kwonoj kwonoj commented May 15, 2023

Description

WEB-1048.

With vercel/next.js#49621, now we can consolidate most of non-core transforms into ecmaplugins.

Postcss / mdx are the only exceptions, but not immediate priority compare to work (which requires to setup some rules instead of just plugins) and filed 1054/1055 for those to deal with later.

@kwonoj kwonoj requested a review from a team as a code owner May 15, 2023 21:17
@vercel
Copy link

vercel bot commented May 15, 2023

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

Name Status Preview Comments Updated (UTC)
examples-kitchensink-blog 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 22, 2023 4:47pm
examples-nonmonorepo 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 22, 2023 4:47pm
turbo-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2023 4:47pm
8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview May 22, 2023 4:47pm
examples-cra-web ⬜️ Ignored (Inspect) Visit Preview May 22, 2023 4:47pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview May 22, 2023 4:47pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview May 22, 2023 4:47pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview May 22, 2023 4:47pm
examples-svelte-web ⬜️ Ignored (Inspect) May 22, 2023 4:47pm
examples-tailwind-web ⬜️ Ignored (Inspect) May 22, 2023 4:47pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview May 22, 2023 4:47pm

@github-actions
Copy link
Contributor

✅ This change can build next-swc

@github-actions
Copy link
Contributor

github-actions bot commented May 15, 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 c0283af

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8915.12µs ± 63.28µs 9160.54µs ± 28.83µs +2.75% +0.68%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8915.12µs ± 63.28µs 9160.54µs ± 28.83µs +2.75% +0.68%
bench_hmr_to_eval/Turbopack CSR/1000 modules 8042.57µs ± 48.88µs 8018.16µs ± 56.95µs -0.30%
bench_startup/Turbopack CSR/1000 modules 934.71ms ± 0.82ms 930.63ms ± 4.07ms -0.44%

@github-actions
Copy link
Contributor

MacOS Benchmark for c0283af

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 26.52ms ± 0.13ms 25.84ms ± 0.14ms -2.57% -0.54%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 26.52ms ± 0.13ms 25.84ms ± 0.14ms -2.57% -0.54%
bench_hmr_to_eval/Turbopack CSR/1000 modules 25.95ms ± 0.11ms 26.10ms ± 0.08ms +0.58%
bench_startup/Turbopack CSR/1000 modules 2715.51ms ± 22.02ms 2723.24ms ± 30.47ms +0.28%

@github-actions
Copy link
Contributor

Linux Benchmark for 9fa4a80

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9201.04µs ± 74.09µs 9483.26µs ± 65.95µs +3.07% +0.02%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9201.04µs ± 74.09µs 9483.26µs ± 65.95µs +3.07% +0.02%
bench_hmr_to_eval/Turbopack CSR/1000 modules 8474.07µs ± 40.35µs 8364.74µs ± 52.89µs -1.29%
bench_startup/Turbopack CSR/1000 modules 952.47ms ± 0.83ms 947.75ms ± 2.60ms -0.50%

@github-actions
Copy link
Contributor

MacOS Benchmark for 9fa4a80

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 28.66ms ± 1.53ms 43.77ms ± 4.13ms +52.75% +11.92%
bench_startup/Turbopack CSR/1000 modules 2579.44ms ± 19.96ms 2703.32ms ± 41.44ms +4.80% +0.04%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 28.66ms ± 1.53ms 43.77ms ± 4.13ms +52.75% +11.92%
bench_hmr_to_eval/Turbopack CSR/1000 modules 27.04ms ± 1.05ms 26.54ms ± 0.27ms -1.85%
bench_startup/Turbopack CSR/1000 modules 2579.44ms ± 19.96ms 2703.32ms ± 41.44ms +4.80% +0.04%

@github-actions
Copy link
Contributor

Linux Benchmark for 6291a68

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9224.21µs ± 45.92µs 9255.99µs ± 58.14µs +0.34%
bench_hmr_to_eval/Turbopack CSR/1000 modules 8423.13µs ± 28.16µs 8400.22µs ± 95.39µs -0.27%
bench_startup/Turbopack CSR/1000 modules 921.81ms ± 3.85ms 924.92ms ± 7.46ms +0.34%

@github-actions
Copy link
Contributor

MacOS Benchmark for 6291a68

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 26.68ms ± 0.10ms 25.78ms ± 0.32ms -3.37% -0.23%
bench_hmr_to_eval/Turbopack CSR/1000 modules 24.16ms ± 1.91ms 56.95ms ± 3.16ms +135.71% +80.85%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 26.68ms ± 0.10ms 25.78ms ± 0.32ms -3.37% -0.23%
bench_hmr_to_eval/Turbopack CSR/1000 modules 24.16ms ± 1.91ms 56.95ms ± 3.16ms +135.71% +80.85%
bench_startup/Turbopack CSR/1000 modules 3118.81ms ± 37.20ms 3157.54ms ± 54.53ms +1.24%

@kwonoj kwonoj added the pr: automerge Kodiak will merge these automatically after checks pass label May 22, 2023
@kodiakhq kodiakhq bot merged commit a87706c into main May 22, 2023
41 of 44 checks passed
@kodiakhq kodiakhq bot deleted the deprecate-3rdparty-transform branch May 22, 2023 18:17
sokra added a commit to vercel/next.js that referenced this pull request May 23, 2023
### What?

* allow to apply existing pipeline
* change webpack loader key to glob for more flexibility
* add test cases
* add special error message when using the old config syntax

Old config:

```js
experimental: {
 turbo: {
  loaders: {
   ".mdx": ["mdx-loader"]
  }
 }
}
```

New config

``` js
experimental: {
 turbo: {
  rules: {
   // key is a glob now
   // normal syntax will treat the result as ecmascript code
   "*.mdx": ["mdx-loader"],
   // glob allows more advanced matching
   "./images/**/*.png": {
    loaders: ["image-optimize-loader"],
    // result of loader will be handled in other steps
    // under the same name/path (here .png)
    // This will use the existing .png pipeline (static asset)
    // It might also use other rules matching .png.
    as: "*"
   },
   "*.generate-image.js": {
    loaders: ["image-generation-loader"],
    // It also possible to pass this under a different name
    // into the pipeline. Here it will treat the result as png image
    as: "*.png"
   }
  }
 }
}
```

### Why?

More flexibility and allowing to use the builtin module handling over
non-js types.

fixes WEB-1009

### Turbopack changes

* vercel/turbo#4955 <!-- OJ Kwon -
refactor(turbopack-ecmascript): deprecate enable_emotion, enable_styled*
-->
* vercel/turbo#4880 <!-- Tobias Koppers -
refactor webpack loader execution -->

---------

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
### What?

* allow to apply existing pipeline
* change webpack loader key to glob for more flexibility
* add test cases
* add special error message when using the old config syntax

Old config:

```js
experimental: {
 turbo: {
  loaders: {
   ".mdx": ["mdx-loader"]
  }
 }
}
```

New config

``` js
experimental: {
 turbo: {
  rules: {
   // key is a glob now
   // normal syntax will treat the result as ecmascript code
   "*.mdx": ["mdx-loader"],
   // glob allows more advanced matching
   "./images/**/*.png": {
    loaders: ["image-optimize-loader"],
    // result of loader will be handled in other steps
    // under the same name/path (here .png)
    // This will use the existing .png pipeline (static asset)
    // It might also use other rules matching .png.
    as: "*"
   },
   "*.generate-image.js": {
    loaders: ["image-generation-loader"],
    // It also possible to pass this under a different name
    // into the pipeline. Here it will treat the result as png image
    as: "*.png"
   }
  }
 }
}
```

### Why?

More flexibility and allowing to use the builtin module handling over
non-js types.

fixes WEB-1009

### Turbopack changes

* vercel/turbo#4955 <!-- OJ Kwon -
refactor(turbopack-ecmascript): deprecate enable_emotion, enable_styled*
-->
* vercel/turbo#4880 <!-- Tobias Koppers -
refactor webpack loader execution -->

---------

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
pr: automerge Kodiak will merge these automatically after checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants