Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
packages/*/CHANGELOG.md
packages/vite/src/node/ssr/runtime/__tests__/fixtures
packages/vite/src/node/ssr/__tests__/fixtures/errors
packages/vite/src/node/ssr/__tests__/fixtures/errors/syntax-error.*
playground-temp/
dist/
temp/
LICENSE.md
pnpm-lock.yaml
pnpm-workspace.yaml
Expand Down
2 changes: 0 additions & 2 deletions packages/vite/src/node/ssr/runtime/__tests__/fixtures/c.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


export { a as c } from './a'

import.meta.hot?.accept(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default async function main() {
await import("./entry.js");
await import('./entry.js')
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export async function setupCyclic() {
const mod = await import("./entry-cyclic.js");
await mod.default();
const mod = await import('./entry-cyclic.js')
await mod.default()
}

export async function importAction(id) {
return await import(/* @vite-ignore */ id);
return await import(/* @vite-ignore */ id)
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const dep1 = { ok: true };
export const dep1 = { ok: true }
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { dep1 } from "./index.js"
import { dep1 } from './index.js'
export const dep2 = { ok: dep1.ok }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const dep1 = { ok: true };
export const dep1 = { ok: true }
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { dep1 } from "./index.js"
import { dep1 } from './index.js'
export const dep2 = { ok: dep1.ok }
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { dep1 } from './dep1.js'
export { dep2 } from "./dep2.js"
export { dep2 } from './dep2.js'
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const dep1 = { ok: true };
export const dep1 = { ok: true }
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { dep1 } from "./index.js"
import { dep1 } from './index.js'
export const dep2 = { ok: dep1.ok }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const dep1 = { ok: true };
export const dep1 = { ok: true }
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { dep1 } from "./index.js"
import { dep1 } from './index.js'
export const dep2 = { ok: dep1.ok }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const dep1 = { ok: true };
export const dep1 = { ok: true }
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { dep1 } from "./index.js"
import { dep1 } from './index.js'
export const dep2 = { ok: dep1.ok }
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { dep2 } from "./dep2.js"
export const dep1 = "dep1: " + dep2
import { dep2 } from './dep2.js'
export const dep1 = 'dep1: ' + dep2
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { dep1 } from "./dep1.js"
export const dep2 = "dep2: " + dep1
import { dep1 } from './dep1.js'
export const dep2 = 'dep2: ' + dep1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { IonTypes } from './IonTypes.js';
import * as dom from './dom/index.js';
export { dom };
export { IonTypes } from './IonTypes.js'
import * as dom from './dom/index.js'
export { dom }
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const IonTypes = {
BLOB: 'Blob',
};
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { IonTypes } from '../Ion.js';
export const Blob = IonTypes.BLOB;
import { IonTypes } from '../Ion.js'
export const Blob = IonTypes.BLOB
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Blob } from './Blob.js';
export { Blob } from './Blob.js'
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import dep from "./index.js"
import dep from './index.js'
export default dep
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import dep from "./dep.js";
import dep from './dep.js'
export default dep
2 changes: 0 additions & 2 deletions packages/vite/src/node/ssr/runtime/__tests__/fixtures/d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


export { c as d } from './c'

import.meta.hot?.accept(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ export const initialize = async () => {
const nameRelative = './simple'
const nameAbsolute = '/fixtures/simple'
const nameAbsoluteExtension = '/fixtures/simple.js'
const absolutePath = path.join(import.meta.dirname, "simple.js")
const absolutePath = path.join(import.meta.dirname, 'simple.js')
const fileUrl = pathToFileURL(absolutePath)
return {
dynamicProcessed: await import('./simple'),
dynamicRelative: await import(nameRelative),
dynamicAbsolute: await import(nameAbsolute),
dynamicAbsoluteExtension: await import(nameAbsoluteExtension),
dynamicAbsoluteFull: await import((process.platform === 'win32' ? '/@fs/' : '') + absolutePath),
dynamicAbsoluteFull: await import(
(process.platform === 'win32' ? '/@fs/' : '') + absolutePath
),
dynamicFileUrl: await import(fileUrl),
static: staticModule,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
console.log('dep1');
export {};
console.log('dep1')
export {}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
console.log('dep2');
export {};
console.log('dep2')
export {}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './dep1.js';
export * from './dep1.js'
import './dep2.js'
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import 'tinyglobby'
import 'tinyglobby'
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export default function f() {
return 0;
return 0
}

f = () => 1;
f = () => 1

f = () => 2;
f = () => 2

export function update() {
f = () => 3;
f = () => 3
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import f, { update } from "./dep.js";
import f, { update } from './dep.js'

const x = f();
update();
const y = f();
export default [x, y];
const x = f()
update()
const y = f()
export default [x, y]
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
function f() {
return 0;
return 0
}

f = () => 1;
f = () => 1

export default f;
export default f

f = () => 2;
f = () => 2

export function update() {
f = () => 3;
f = () => 3
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import f, { update } from "./dep.js";
import f, { update } from './dep.js'

const x = f();
update();
const y = f();
export default [x, y];
const x = f()
update()
const y = f()
export default [x, y]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function f() {
return 0;
return 0
}

f = () => 1
Expand All @@ -9,5 +9,5 @@ export { f as default }
f = () => 2

export function update() {
f = () => 3;
f = () => 3
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import f, { update } from "./dep.js";
import f, { update } from './dep.js'

const x = f();
update();
const y = f();
export default [x, y];
const x = f()
update()
const y = f()
export default [x, y]
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
export default class C {
static f = () => 0;
static f = () => 0
}

C = class {
static f = () => 1;
static f = () => 1
}

C = class {
static f = () => 2;
static f = () => 2
}

export function update() {
C = class {
static f = () => 3;
static f = () => 3
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import C, { update } from "./dep.js";
import C, { update } from './dep.js'

const x = C.f();
update();
const y = C.f();
export default [x, y];
const x = C.f()
update()
const y = C.f()
export default [x, y]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const Object = "my-object";
export { Object };
const Object = 'my-object'
export { Object }
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ if (!parentPort) {
const pPort = parentPort

/** @type {import('birpc').BirpcReturn<{ invoke: (data: any) => any }>} */
const rpc = createBirpc({}, {
post: (data) => pPort.postMessage(data),
on: (data) => pPort.on('message', data),
})
const rpc = createBirpc(
{},
{
post: (data) => pPort.postMessage(data),
on: (data) => pPort.on('message', data),
},
)

const runner = new ModuleRunner(
{
transport: {
invoke(data) { return rpc.invoke(data) }
invoke(data) {
return rpc.invoke(data)
},
},
hmr: false,
},
Expand Down
Loading