Unverified Commit 3e6720c3 authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

build: Update turbopack (#63229)

# Turbopack

* https://github.com/vercel/turbo/pull/7719 <!-- Tobias Koppers - accept
css files outside of the project as virtual assets -->
* https://github.com/vercel/turbo/pull/7661 <!-- Tobias Koppers - more
efficient node.js process startup -->
* https://github.com/vercel/turbo/pull/7720 <!-- Tobias Koppers -
generate correct async module handling for side effects optimization -->
* https://github.com/vercel/turbo/pull/7718 <!-- Donny/강동윤 -
fix(turbopack): Fix CSS Modules class name for lightningcss mode -->

### What?

Update tests to make CSS Modules of `lightningcss` work with CSS grids.

### Why?

`lightningcss` enforces the class name to end with `[local]`.

See: https://lightningcss.dev/css-modules.html#css-grid


### How?

Closes PACK-2731
parent 23759eff
This diff is collapsed.
...@@ -37,11 +37,11 @@ swc_core = { version = "0.90.17", features = [ ...@@ -37,11 +37,11 @@ swc_core = { version = "0.90.17", features = [
testing = { version = "0.35.20" } testing = { version = "0.35.20" }
# Turbo crates # Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240312.5" } turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240313.3" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros.. # [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240312.5" } turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240313.3" }
# [TODO]: need to refactor embed_directory! macro usage in next-core # [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240312.5" } turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240313.3" }
# General Deps # General Deps
......
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
"@types/ws": "8.2.0", "@types/ws": "8.2.0",
"@vercel/ncc": "0.34.0", "@vercel/ncc": "0.34.0",
"@vercel/nft": "0.26.4", "@vercel/nft": "0.26.4",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240312.5", "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240313.3",
"acorn": "8.5.0", "acorn": "8.5.0",
"amphtml-validator": "1.0.35", "amphtml-validator": "1.0.35",
"anser": "1.4.9", "anser": "1.4.9",
......
...@@ -1071,8 +1071,8 @@ importers: ...@@ -1071,8 +1071,8 @@ importers:
specifier: 0.26.4 specifier: 0.26.4
version: 0.26.4 version: 0.26.4
'@vercel/turbopack-ecmascript-runtime': '@vercel/turbopack-ecmascript-runtime':
specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240312.5 specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240313.3
version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240312.5' version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240313.3'
acorn: acorn:
specifier: 8.5.0 specifier: 8.5.0
version: 8.5.0 version: 8.5.0
...@@ -25494,8 +25494,8 @@ packages: ...@@ -25494,8 +25494,8 @@ packages:
/zwitch@2.0.4: /zwitch@2.0.4:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
'@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240312.5': '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240313.3':
resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240312.5} resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240313.3}
name: '@vercel/turbopack-ecmascript-runtime' name: '@vercel/turbopack-ecmascript-runtime'
version: 0.0.0 version: 0.0.0
dependencies: dependencies:
......
...@@ -12,7 +12,7 @@ describeVariants.each(['turbo'])('experimental-lightningcss', () => { ...@@ -12,7 +12,7 @@ describeVariants.each(['turbo'])('experimental-lightningcss', () => {
expect($('p').text()).toBe('hello world') expect($('p').text()).toBe('hello world')
// swc_css does not include `-module` in the class name, while lightningcss does. // swc_css does not include `-module` in the class name, while lightningcss does.
expect($('p').attr('class')).toBe( expect($('p').attr('class')).toBe(
'search-keyword blue__style-module__hlQ3RG' 'search-keyword style-module__hlQ3RG__blue'
) )
}) })
}) })
......
...@@ -47,10 +47,10 @@ describe('app dir - next/font', () => { ...@@ -47,10 +47,10 @@ describe('app dir - next/font', () => {
// layout // layout
expect(JSON.parse($('#root-layout').text())).toEqual({ expect(JSON.parse($('#root-layout').text())).toEqual({
className: expect.stringMatching( className: expect.stringMatching(
process.env.TURBOPACK ? /^className_.*/ : /^__className_.*/ process.env.TURBOPACK ? /.*_className$/ : /^__className_.*/
), ),
variable: expect.stringMatching( variable: expect.stringMatching(
process.env.TURBOPACK ? /^variable_.*/ : /^__variable_.*/ process.env.TURBOPACK ? /.*_variable$/ : /^__variable_.*/
), ),
style: { style: {
fontFamily: expect.stringMatching( fontFamily: expect.stringMatching(
...@@ -61,10 +61,10 @@ describe('app dir - next/font', () => { ...@@ -61,10 +61,10 @@ describe('app dir - next/font', () => {
// page // page
expect(JSON.parse($('#root-page').text())).toEqual({ expect(JSON.parse($('#root-page').text())).toEqual({
className: expect.stringMatching( className: expect.stringMatching(
process.env.TURBOPACK ? /^className_.*/ : /^__className_.*/ process.env.TURBOPACK ? /.*_className$/ : /^__className_.*/
), ),
variable: expect.stringMatching( variable: expect.stringMatching(
process.env.TURBOPACK ? /^variable_.*/ : /^__variable_.*/ process.env.TURBOPACK ? /.*_variable$/ : /^__variable_.*/
), ),
style: { style: {
fontFamily: expect.stringMatching( fontFamily: expect.stringMatching(
...@@ -75,7 +75,7 @@ describe('app dir - next/font', () => { ...@@ -75,7 +75,7 @@ describe('app dir - next/font', () => {
// Comp // Comp
expect(JSON.parse($('#root-comp').text())).toEqual({ expect(JSON.parse($('#root-comp').text())).toEqual({
className: expect.stringMatching( className: expect.stringMatching(
process.env.TURBOPACK ? /^className_.*/ : /^__className_.*/ process.env.TURBOPACK ? /.*_className$/ : /^__className_.*/
), ),
style: { style: {
fontFamily: expect.stringMatching( fontFamily: expect.stringMatching(
...@@ -93,10 +93,10 @@ describe('app dir - next/font', () => { ...@@ -93,10 +93,10 @@ describe('app dir - next/font', () => {
// root layout // root layout
expect(JSON.parse($('#root-layout').text())).toEqual({ expect(JSON.parse($('#root-layout').text())).toEqual({
className: expect.stringMatching( className: expect.stringMatching(
process.env.TURBOPACK ? /^className_.*/ : /^__className_.*/ process.env.TURBOPACK ? /.*_className$/ : /^__className_.*/
), ),
variable: expect.stringMatching( variable: expect.stringMatching(
process.env.TURBOPACK ? /^variable_.*/ : /^__variable_.*/ process.env.TURBOPACK ? /.*_variable$/ : /^__variable_.*/
), ),
style: { style: {
fontFamily: expect.stringMatching( fontFamily: expect.stringMatching(
...@@ -108,7 +108,7 @@ describe('app dir - next/font', () => { ...@@ -108,7 +108,7 @@ describe('app dir - next/font', () => {
// layout // layout
expect(JSON.parse($('#client-layout').text())).toEqual({ expect(JSON.parse($('#client-layout').text())).toEqual({
className: expect.stringMatching( className: expect.stringMatching(
process.env.TURBOPACK ? /^className_.*/ : /^__className_.*/ process.env.TURBOPACK ? /.*_className$/ : /^__className_.*/
), ),
style: { style: {
fontFamily: expect.stringMatching( fontFamily: expect.stringMatching(
...@@ -120,7 +120,7 @@ describe('app dir - next/font', () => { ...@@ -120,7 +120,7 @@ describe('app dir - next/font', () => {
// page // page
expect(JSON.parse($('#client-page').text())).toEqual({ expect(JSON.parse($('#client-page').text())).toEqual({
className: expect.stringMatching( className: expect.stringMatching(
process.env.TURBOPACK ? /^className_.*/ : /^__className_.*/ process.env.TURBOPACK ? /.*_className$/ : /^__className_.*/
), ),
style: { style: {
fontFamily: expect.stringMatching( fontFamily: expect.stringMatching(
...@@ -132,7 +132,7 @@ describe('app dir - next/font', () => { ...@@ -132,7 +132,7 @@ describe('app dir - next/font', () => {
// Comp // Comp
expect(JSON.parse($('#client-comp').text())).toEqual({ expect(JSON.parse($('#client-comp').text())).toEqual({
className: expect.stringMatching( className: expect.stringMatching(
process.env.TURBOPACK ? /^className_.*/ : /^__className_.*/ process.env.TURBOPACK ? /.*_className$/ : /^__className_.*/
), ),
style: { style: {
fontFamily: expect.stringMatching( fontFamily: expect.stringMatching(
...@@ -146,7 +146,7 @@ describe('app dir - next/font', () => { ...@@ -146,7 +146,7 @@ describe('app dir - next/font', () => {
const $ = await next.render$('/third-party') const $ = await next.render$('/third-party')
expect(JSON.parse($('#third-party-page').text())).toEqual({ expect(JSON.parse($('#third-party-page').text())).toEqual({
className: expect.stringMatching( className: expect.stringMatching(
process.env.TURBOPACK ? /^className_.*/ : /^__className_.*/ process.env.TURBOPACK ? /.*_className$/ : /^__className_.*/
), ),
style: { style: {
fontFamily: expect.stringMatching( fontFamily: expect.stringMatching(
...@@ -154,7 +154,7 @@ describe('app dir - next/font', () => { ...@@ -154,7 +154,7 @@ describe('app dir - next/font', () => {
), ),
}, },
variable: expect.stringMatching( variable: expect.stringMatching(
process.env.TURBOPACK ? /^variable_.*/ : /^__variable_.*/ process.env.TURBOPACK ? /.*_variable$/ : /^__variable_.*/
), ),
}) })
}) })
......
...@@ -12,7 +12,7 @@ const mockedGoogleFontResponses = require.resolve( ...@@ -12,7 +12,7 @@ const mockedGoogleFontResponses = require.resolve(
function getClassNameRegex(className: string): RegExp { function getClassNameRegex(className: string): RegExp {
// Turbopack uses a different format for its css modules than webpack-based Next.js // Turbopack uses a different format for its css modules than webpack-based Next.js
return shouldRunTurboDevTest() return shouldRunTurboDevTest()
? new RegExp(`^${className}__.*__.{6}$`) // e.g. `className__nabla_abb2401d-module__ks7jmG` ? new RegExp(`^.*__.{6}__${className}$`) // e.g. `ks7jmG__nabla_abb2401d-module__className`
: new RegExp(`^__${className}_.{6}$`) // e.g. `__className_a8cc56` : new RegExp(`^__${className}_.{6}$`) // e.g. `__className_a8cc56`
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment