From 3ec2d6749f2308f0cfc63d7780ff56b0f8fc12a3 Mon Sep 17 00:00:00 2001 From: John Muhl Date: Sun, 2 Aug 2020 15:20:09 -0500 Subject: [PATCH] Remove head hydration workaround (#1067) --- package.json | 2 +- runtime/src/app/app.ts | 10 ---------- runtime/src/server/middleware/get_page_handler.ts | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index b69efc4fc..0ea437795 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "webpack-modules": "^1.0.0" }, "peerDependencies": { - "svelte": "^3.5.0" + "svelte": "^3.17.3" }, "scripts": { "test": "mocha --opts mocha.opts", diff --git a/runtime/src/app/app.ts b/runtime/src/app/app.ts index 61f96bc22..88544a6a8 100644 --- a/runtime/src/app/app.ts +++ b/runtime/src/app/app.ts @@ -230,16 +230,6 @@ async function render(redirect: Redirect, branch: any[], props: any, page: Page) }; props.notify = stores.page.notify; - // first load — remove SSR'd contents - const start = document.querySelector('#sapper-head-start'); - const end = document.querySelector('#sapper-head-end'); - - if (start && end) { - while (start.nextSibling !== end) detach(start.nextSibling); - detach(start); - detach(end); - } - root_component = new App({ target, props, diff --git a/runtime/src/server/middleware/get_page_handler.ts b/runtime/src/server/middleware/get_page_handler.ts index e8823ae6a..3ac125004 100644 --- a/runtime/src/server/middleware/get_page_handler.ts +++ b/runtime/src/server/middleware/get_page_handler.ts @@ -334,7 +334,7 @@ export function get_page_handler( .replace('%sapper.base%', () => ``) .replace('%sapper.scripts%', () => `${script}`) .replace('%sapper.html%', () => html) - .replace('%sapper.head%', () => `${head}`) + .replace('%sapper.head%', () => head) .replace('%sapper.styles%', () => styles); res.statusCode = status;