Skip to content

Commit 2f51a3a

Browse files
authored
fix(test): improve stability by removing a log and vite cache (#894)
* fix(test): improve stability by removing an unexpected log and ensuring that vite cache isn't persisted * fix: remove log use * fix: wait 500ms after vite connected * increase timeout in ci * fix: remove workaround to mount test apps with svelte 4 or 5 * chore(docs): improve changelog about removal of svelte5 warning
1 parent 49324db commit 2f51a3a

File tree

20 files changed

+127
-188
lines changed

20 files changed

+127
-188
lines changed

.changeset/popular-islands-remain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/vite-plugin-svelte': patch
3+
---
4+
5+
Remove log about experimental status of Svelte 5. Note that breaking changes can still occur while vite-plugin-svelte 4 is in prerelease mode
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
import App from './App.svelte';
2-
3-
if (App.toString().startsWith('class ')) {
4-
new App({ target: document.body });
5-
} else {
6-
import('svelte').then(({ mount }) => mount(App, { target: document.body }));
7-
}
2+
import { mount } from 'svelte';
3+
mount(App, { target: document.body });
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
import App from './App.svelte';
2-
3-
if (App.toString().startsWith('class ')) {
4-
new App({ target: document.body });
5-
} else {
6-
import('svelte').then(({ mount }) => mount(App, { target: document.body }));
7-
}
2+
import { mount } from 'svelte';
3+
mount(App, { target: document.body });
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
import App from './App.svelte';
2-
3-
if (App.toString().startsWith('class ')) {
4-
new App({ target: document.body });
5-
} else {
6-
import('svelte').then(({ mount }) => mount(App, { target: document.body }));
7-
}
2+
import { mount } from 'svelte';
3+
mount(App, { target: document.body });
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
import App from './App.svelte';
2-
3-
if (App.toString().startsWith('class ')) {
4-
new App({ target: document.body });
5-
} else {
6-
import('svelte').then(({ mount }) => mount(App, { target: document.body }));
7-
}
2+
import { mount } from 'svelte';
3+
mount(App, { target: document.body });
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
import App from './App.svelte';
2-
3-
if (App.toString().startsWith('class ')) {
4-
new App({ target: document.body });
5-
} else {
6-
import('svelte').then(({ mount }) => mount(App, { target: document.body }));
7-
}
2+
import { mount } from 'svelte';
3+
mount(App, { target: document.body });

packages/e2e-tests/env/src/main.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
import App from './App.svelte';
2-
3-
if (App.toString().startsWith('class ')) {
4-
new App({ target: document.body });
5-
} else {
6-
import('svelte').then(({ mount }) => mount(App, { target: document.body }));
7-
}
2+
import { mount } from 'svelte';
3+
mount(App, { target: document.body });

packages/e2e-tests/hmr/src/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
import App from './App.svelte';
2-
3-
if (App.toString().startsWith('class ')) {
4-
new App({ target: document.body });
5-
} else {
6-
import('svelte').then(({ mount }) => mount(App, { target: document.body }));
7-
}
2+
import { mount } from 'svelte';
3+
mount(App, { target: document.body });
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
import App from './App.svelte';
2-
3-
if (App.toString().startsWith('class ')) {
4-
new App({ target: document.body });
5-
} else {
6-
import('svelte').then(({ mount }) => mount(App, { target: document.body }));
7-
}
2+
import { mount } from 'svelte';
3+
mount(App, { target: document.body });
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
import App from './App.svelte';
2-
3-
if (App.toString().startsWith('class ')) {
4-
new App({ target: document.getElementById('app') });
5-
} else {
6-
import('svelte').then(({ mount }) => mount(App, { target: document.getElementById('app') }));
7-
}
2+
import { mount } from 'svelte';
3+
mount(App, { target: document.body });

0 commit comments

Comments
 (0)