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

Supporting Vite 6 #207

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@swc/core": "^1.5.7"
},
"peerDependencies": {
"vite": "^4 || ^5"
"vite": "^4 || ^5 || ^6"
},
"devDependencies": {
"@arnaud-barre/tnode": "^0.19.2",
Expand All @@ -30,6 +30,6 @@
"picocolors": "^1.0.1",
"prettier": "^3.0.3",
"typescript": "^5.4.5",
"vite": "^5.2.11"
"vite": "^6.0.0-alpha.13"
}
}
2 changes: 1 addition & 1 deletion playground/emotion-plugin/__tests__/emotion-plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test("Emotion plugin HMR", async ({ page }) => {
const { testUrl, server, editFile } = await setupDevServer("emotion-plugin");
const waitForLogs = await setupWaitForLogs(page);
await page.goto(testUrl);
await waitForLogs("[vite] connected.");
await waitForLogs("connected.");

const button = page.locator("button");
await button.hover();
Expand Down
2 changes: 1 addition & 1 deletion playground/emotion/__tests__/emotion.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test("Emotion HMR", async ({ page }) => {
const { testUrl, server, editFile } = await setupDevServer("emotion");
const waitForLogs = await setupWaitForLogs(page);
await page.goto(testUrl);
await waitForLogs("[vite] connected.");
await waitForLogs("connected.");

const button = page.locator("button");
await button.hover();
Expand Down
4 changes: 2 additions & 2 deletions playground/hmr/__tests__/hmr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test("HMR invalidate", async ({ page }) => {
const { testUrl, server, editFile } = await setupDevServer("hmr");
const waitForLogs = await setupWaitForLogs(page);
await page.goto(testUrl);
await waitForLogs("[vite] connected.");
await waitForLogs("connected.");

await page.click("button");
await expect(page.locator("button")).toHaveText("count is 1");
Expand Down Expand Up @@ -74,7 +74,7 @@ test("HMR invalidate", async ({ page }) => {
await waitForLogs(
"[vite] invalidate /src/TitleWithExport.tsx: Could not Fast Refresh (export removed)",
"[vite] hot updated: /src/App.tsx",
"[hmr] Failed to reload /src/App.tsx. This could be due to syntax errors or importing non-existent modules. (see errors above)",
"[vite] Failed to reload /src/App.tsx. This could be due to syntax errors or importing non-existent modules. (see errors above)",
);

// Remove usage from App
Expand Down
2 changes: 1 addition & 1 deletion playground/mdx/__tests__/mdx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test("MDX HMR", async ({ page }) => {
const { testUrl, server, editFile } = await setupDevServer("mdx");
const waitForLogs = await setupWaitForLogs(page);
await page.goto(testUrl);
await waitForLogs("[vite] connected.");
await waitForLogs("connected.");

await expect(page.getByRole("heading", { name: "Hello" })).toBeVisible();

Expand Down
2 changes: 1 addition & 1 deletion playground/shadow-export/__tests__/shadow-export.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test("Shadow export HMR", async ({ page }) => {
const { testUrl, server, editFile } = await setupDevServer("shadow-export");
const waitForLogs = await setupWaitForLogs(page);
await page.goto(testUrl);
await waitForLogs("[vite] connected.");
await waitForLogs("connected.");
await expect(page.locator("body")).toHaveText("Shadow export");

editFile("src/App.tsx", ["Shadow export", "Shadow export updates!"]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test("styled-components HMR", async ({ page }) => {
await setupDevServer("styled-components");
const waitForLogs = await setupWaitForLogs(page);
await page.goto(testUrl);
await waitForLogs("[vite] connected.");
await waitForLogs("connected.");

const button = page.locator("button");
await expect(button).toHaveText("count is 0", { timeout: 30000 });
Expand Down
41 changes: 39 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports.default = react;`,
copyFileSync("README.md", "dist/README.md");

execSync(
"tsc src/index.ts --declaration --emitDeclarationOnly --outDir dist --module es2020 --moduleResolution bundler",
"tsc src/index.ts --declaration --emitDeclarationOnly --outDir dist --module es2020 --moduleResolution bundler --skipLibCheck",
RobinTail marked this conversation as resolved.
Show resolved Hide resolved
{ stdio: "inherit" },
);

Expand Down