Skip to content

Commit ddf15a0

Browse files
committed
feat: update rolldown
refs rolldown/rolldown#4607
1 parent 12e9189 commit ddf15a0

File tree

10 files changed

+95
-98
lines changed

10 files changed

+95
-98
lines changed

packages/vite/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@
8585
},
8686
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
8787
"dependencies": {
88-
"@oxc-project/runtime": "0.69.0",
88+
"@oxc-project/runtime": "0.70.0",
8989
"fdir": "^6.4.4",
9090
"lightningcss": "^1.30.0",
9191
"picomatch": "^4.0.2",
9292
"postcss": "^8.5.3",
93-
"rolldown": "1.0.0-beta.8-commit.985af6d",
93+
"rolldown": "1.0.0-beta.8-commit.360c072",
9494
"tinyglobby": "^0.2.13"
9595
},
9696
"optionalDependencies": {
@@ -100,9 +100,9 @@
100100
"@ampproject/remapping": "^2.3.0",
101101
"@babel/parser": "^7.27.2",
102102
"@jridgewell/trace-mapping": "^0.3.25",
103-
"@oxc-project/types": "0.69.0",
103+
"@oxc-project/types": "0.70.0",
104104
"@polka/compression": "^1.0.0-next.25",
105-
"@rolldown/pluginutils": "1.0.0-beta.8-commit.985af6d",
105+
"@rolldown/pluginutils": "1.0.0-beta.8-commit.360c072",
106106
"@rollup/plugin-alias": "^5.1.1",
107107
"@rollup/plugin-commonjs": "^28.0.3",
108108
"@rollup/plugin-dynamic-import-vars": "2.1.4",

packages/vite/src/node/__tests__/plugins/modulePreloadPolyfill/__snapshots__/modulePreloadPolyfill.spec.ts.snap

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`load > doesn't load modulepreload polyfill when format is cjs 1`] = `
4-
""use strict";
5-
"
6-
`;
3+
exports[`load > doesn't load modulepreload polyfill when format is cjs 1`] = `""`;
74

85
exports[`load > loads modulepreload polyfill 1`] = `
96
"(function polyfill() {

packages/vite/src/node/__tests__/plugins/oxc.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@ test('should inject helper for worker iife from esm', async () => {
4545
)
4646
expect(result).toMatchInlineSnapshot(`
4747
"(function() {
48-
"use strict";var babelHelpers=function(exports){"use strict";function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,\`next\`,e)}function c(e){t(o,i,a,s,c,\`throw\`,e)}s(void 0)})}}return exports.asyncToGenerator=n,exports}({});
48+
"use strict";var babelHelpers=function(exports){function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,\`next\`,e)}function c(e){t(o,i,a,s,c,\`throw\`,e)}s(void 0)})}}return exports.asyncToGenerator=n,exports}({});
4949
50+
//#region src/index.js
5051
babelHelpers.asyncToGenerator(function* () {
5152
yield new Promise((resolve) => setTimeout(resolve, 1e3));
5253
console.log("foo");
5354
})();
55+
//#endregion
5456
})();
5557
"
5658
`)
@@ -73,12 +75,14 @@ test('should inject helper for worker iife from cjs', async () => {
7375
'iife',
7476
)
7577
expect(result).toMatchInlineSnapshot(`
76-
"(function() {var babelHelpers=function(exports){"use strict";function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,\`next\`,e)}function c(e){t(o,i,a,s,c,\`throw\`,e)}s(void 0)})}}return exports.asyncToGenerator=n,exports}({});
78+
"(function() {var babelHelpers=function(exports){function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,\`next\`,e)}function c(e){t(o,i,a,s,c,\`throw\`,e)}s(void 0)})}}return exports.asyncToGenerator=n,exports}({});
7779
80+
//#region src/index.js
7881
babelHelpers.asyncToGenerator(function* () {
7982
yield new Promise((resolve) => setTimeout(resolve, 1e3));
8083
console.log("foo");
8184
})();
85+
//#endregion
8286
})();
8387
"
8488
`)

packages/vite/src/node/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import type {
2626
import {
2727
loadFallbackPlugin as nativeLoadFallbackPlugin,
2828
manifestPlugin as nativeManifestPlugin,
29-
reportPlugin as nativeReportPlugin,
29+
reporterPlugin as nativeReporterPlugin,
3030
} from 'rolldown/experimental'
3131
import type { RollupCommonJSOptions } from 'dep-types/commonjs'
3232
import type { RollupDynamicImportVarsOptions } from 'dep-types/dynamicImportVars'
@@ -529,7 +529,7 @@ export async function resolveBuildPlugins(config: ResolvedConfig): Promise<{
529529
const shouldLogInfo =
530530
LogLevels[config.logLevel || 'info'] >= LogLevels.info
531531
const assetsDir = path.join(env.config.build.assetsDir, '/')
532-
return nativeReportPlugin({
532+
return nativeReporterPlugin({
533533
isTty: !!tty,
534534
isLib: !!env.config.build.lib,
535535
assetsDir,

packages/vite/src/node/ssr/runtime/__tests__/server-source-maps.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('module runner initialization', async () => {
7878
runner.import('/fixtures/has-error-first-comment.ts'),
7979
)
8080
expect(serializeStack(server, topLevelErrorTs)).toBe(
81-
' at <root>/fixtures/has-error-first-comment.ts:2:17',
81+
' at <root>/fixtures/has-error-first-comment.ts:2:7',
8282
)
8383
})
8484

playground/js-sourcemap/__tests__/js-sourcemap.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ if (!isBuild) {
106106
const map = extractSourcemap(multi)
107107
expect(formatSourcemapForSnapshot(map)).toMatchInlineSnapshot(`
108108
{
109-
"mappings": "AACA,SACE,WACK,2BAA2B;AAElC,QAAQ,IAAI,yBAAyB,IAAI",
109+
"mappings": ";AACA,SACE,WACK,2BAA2B;AAElC,QAAQ,IAAI,yBAAyB,IAAI",
110110
"sources": [
111111
"with-multiline-import.ts",
112112
],

playground/lib/__tests__/lib.spec.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe.runIf(isBuild)('build', () => {
2424
// esbuild helpers are injected inside of the UMD wrapper
2525
expect(code).toMatch(/^\/\*[^*]*\*\/\s*\(function\(/)
2626
expect(noMinifyCode).toMatch(
27-
/^\/\*[^*]*\*\/\s*\(function\(global.+?"use strict";\s*var.+?function\smyLib\(/s,
27+
/^\/\*[^*]*\*\/\s*\(function\(global.+?var.+?function\smyLib\(/s,
2828
)
2929
expect(namedCode).toMatch(/^\(function\(/)
3030
})
@@ -37,15 +37,11 @@ describe.runIf(isBuild)('build', () => {
3737
)
3838
const namedCode = readFile('dist/named/my-lib-named.iife.js')
3939
// esbuild helpers are injected inside of the IIFE wrapper
40-
expect(code).toMatch(
41-
/^\/\*[^*]*\*\/\s*var MyLib=function\(\)\{\s*"use strict";/,
42-
)
40+
expect(code).toMatch(/^\/\*[^*]*\*\/\s*var MyLib=function\(\)\{\s*/)
4341
expect(noMinifyCode).toMatch(
44-
/^\/\*[^*]*\*\/\s*var MyLib\s*=\s*function\(\)\s*\{\s*"use strict";/,
45-
)
46-
expect(namedCode).toMatch(
47-
/^var MyLibNamed=function\([^()]+\)\{\s*"use strict";/,
42+
/^\/\*[^*]*\*\/\s*var MyLib\s*=\s*function\(\)\s*\{\s*/,
4843
)
44+
expect(namedCode).toMatch(/^var MyLibNamed=function\([^()]+\)\{\s*/)
4945
})
5046

5147
test('restrisct-helpers-injection', async () => {

playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"convert-source-map": "^2.0.0",
1111
"css-color-names": "^1.0.1",
1212
"kill-port": "^1.6.1",
13-
"rolldown": "1.0.0-beta.8-commit.985af6d"
13+
"rolldown": "1.0.0-beta.8-commit.360c072"
1414
}
1515
}

playground/worker/__tests__/iife/worker-iife.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ test.runIf(isServe)('sourcemap is correct after env is injected', async () => {
191191
const content = await (await response).text()
192192
const { mappings } = decodeSourceMapUrl(content)
193193
expect(mappings).toMatchInlineSnapshot(
194-
`";;AAAA,SAAS,OAAO,kBAAkB,8BAA8B;AAChE,OAAO,YAAY,6BAA6B;AAChD,SAAS,MAAM,WAAW,2BAA2B;AACrD,SAAS,wBAAwB,uBAAuB;AACxD,OAAO,aAAa,YAAY;AAChC,MAAM,UAAU,OAAO,KAAK;AAE5B,KAAK,YAAY,CAAC,MAAM;AACtB,KAAI,EAAE,SAAS,QAAQ;AACrB,OAAK,YAAY;GACf;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC;CACH;AACD,KAAI,EAAE,SAAS,gBAAgB;AAC7B,OAAK,YAAY;GACf,KAAK;GACL;GACA;GACA;GACA;GACA;GACA;EACD,EAAC;CACH;AACF;AACD,KAAK,YAAY;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,EAAC;AAGF,QAAQ,IAAI,eAAe"`,
194+
`";;AAAA,SAAS,OAAO,kBAAkB,8BAA8B;AAChE,OAAO,YAAY,6BAA6B;AAChD,SAAS,MAAM,WAAW,2BAA2B;AACrD,SAAS,wBAAwB,uBAAuB;AACxD,OAAO,aAAa,YAAY;AAChC,MAAM,UAAU,OAAO,KAAK;AAE5B,KAAK,YAAY,CAAC,MAAM;AACtB,KAAI,EAAE,SAAS,QAAQ;AACrB,OAAK,YAAY;GACf;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC;CACH;AACD,KAAI,EAAE,SAAS,gBAAgB;AAC7B,OAAK,YAAY;GACf,KAAK;GACL;GACA;GACA;GACA;GACA;GACA;EACD,EAAC;CACH;AACF;AACD,KAAK,YAAY;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,EAAC;;AAGF,QAAQ,IAAI,eAAe"`,
195195
)
196196
})
197197

0 commit comments

Comments
 (0)