Skip to content

Commit 8d4407d

Browse files
committed
fix: use new insert_hydration function of svelte 3.40.0 when available
1 parent 2b8ccdc commit 8d4407d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"devDependencies": {
2121
"@rixo/eslint-config": "^0.8.1",
22-
"svelte": "^3.35.0",
22+
"svelte": "^3.40.0",
2323
"tap-mocha-reporter": "^5.0.1",
2424
"zoar": "^0.3.0",
2525
"zorax": "^0.0.12"

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtime/proxy-adapter-dom.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/* global window, document */
2-
import { insert } from 'svelte/internal'
2+
import * as svelteInternal from 'svelte/internal'
3+
const svelteInsert = svelteInternal.insert_hydration || svelteInternal.insert;
4+
if(!svelteInsert) {
5+
throw new Error('failed to find insert_hydration and insert in svelte/internal');
6+
}
37

48
import ErrorOverlay from './overlay.js'
59

@@ -52,7 +56,7 @@ export const adapter = class ProxyAdapterDom {
5256
if (!this.insertionPoint) {
5357
this.insertionPoint = document.createComment(debugName)
5458
}
55-
insert(target, this.insertionPoint, anchor)
59+
svelteInsert(target, this.insertionPoint, anchor)
5660
}
5761

5862
rerender() {

0 commit comments

Comments
 (0)