Skip to content

Commit 92b3ef0

Browse files
committed
chore: oxc-transform 0.57.0
1 parent c2f718f commit 92b3ef0

File tree

4 files changed

+58
-82
lines changed

4 files changed

+58
-82
lines changed

packages/vite/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"dependencies": {
8888
"@oxc-project/runtime": "^0.56.0",
8989
"lightningcss": "^1.29.1",
90-
"oxc-transform": "^0.56.5",
90+
"oxc-transform": "^0.57.0",
9191
"postcss": "^8.5.3",
9292
"rolldown": "1.0.0-beta.3-commit.e170e6e"
9393
},

packages/vite/src/node/ssr/__tests__/ssrLoadModule.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ test('json', async () => {
238238
null,
239239
'/test.json',
240240
)
241-
expect(json?.code.length).toMatchInlineSnapshot(`151`)
241+
expect(json?.code.length).toMatchInlineSnapshot(`60`)
242242
})
243243

244244
test('file url', async () => {

packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts

+11-35
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,9 @@ test('export as from arbitrary module namespace identifier', async () => {
328328
test('export default', async () => {
329329
expect(await ssrTransformSimpleCode(`export default {}`))
330330
.toMatchInlineSnapshot(`
331-
"Object.defineProperty(__vite_ssr_exports__, "default", {
332-
enumerable: true,
333-
configurable: true,
334-
get() {
335-
return {};
336-
}
337-
});
338-
"
339-
`)
331+
"__vite_ssr_exports__.default = {};
332+
"
333+
`)
340334
})
341335

342336
test('export then import minified', async () => {
@@ -1260,29 +1254,17 @@ export default (function getRandom() {
12601254
`.trim()
12611255

12621256
expect(await ssrTransformSimpleCode(code)).toMatchInlineSnapshot(`
1263-
"Object.defineProperty(__vite_ssr_exports__, "default", {
1264-
enumerable: true,
1265-
configurable: true,
1266-
get() {
1267-
return function getRandom() {
1268-
return Math.random();
1269-
};
1270-
}
1271-
});
1257+
"__vite_ssr_exports__.default = function getRandom() {
1258+
return Math.random();
1259+
};
12721260
"
12731261
`)
12741262

12751263
expect(await ssrTransformSimpleCode(`export default (class A {});`))
12761264
.toMatchInlineSnapshot(`
1277-
"Object.defineProperty(__vite_ssr_exports__, "default", {
1278-
enumerable: true,
1279-
configurable: true,
1280-
get() {
1281-
return class A {};
1282-
}
1283-
});
1284-
"
1285-
`)
1265+
"__vite_ssr_exports__.default = class A {};
1266+
"
1267+
`)
12861268
})
12871269

12881270
// #8002
@@ -1560,13 +1542,7 @@ console.log(bar)
15601542
`),
15611543
).toMatchInlineSnapshot(`
15621544
"const __vite_ssr_import_0__ = await __vite_ssr_import__("./foo", { importedNames: ["foo"] });
1563-
Object.defineProperty(__vite_ssr_exports__, "default", {
1564-
enumerable: true,
1565-
configurable: true,
1566-
get() {
1567-
return (0, __vite_ssr_import_0__.foo)();
1568-
}
1569-
});
1545+
__vite_ssr_exports__.default = (0, __vite_ssr_import_0__.foo)();
15701546
const __vite_ssr_import_1__ = await __vite_ssr_import__("./bar");
15711547
Object.defineProperty(__vite_ssr_exports__, "bar", {
15721548
enumerable: true,
@@ -1782,7 +1758,7 @@ test('combine mappings', async () => {
17821758
)
17831759
expect(result?.map).toMatchInlineSnapshot(`
17841760
{
1785-
"mappings": "AAAA;;;;SAAe",
1761+
"mappings": "AAAA,+BAAe",
17861762
"names": [],
17871763
"sources": [
17881764
"virtual:test-mappings:null",

pnpm-lock.yaml

+45-45
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)