Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Remove head hydration workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
John Muhl authored and John Muhl committed Jan 23, 2020
1 parent b1c4585 commit fcdd67b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions runtime/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,6 @@ async function render(redirect: Redirect, branch: any[], props: any, page: Page)
props: await root_preloaded
};

// first load — remove SSR'd <head> 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,
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/server/middleware/get_page_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export function get_page_handler(
.replace('%sapper.base%', () => `<base href="${req.baseUrl}/">`)
.replace('%sapper.scripts%', () => `<script${nonce_attr}>${script}</script>`)
.replace('%sapper.html%', () => html)
.replace('%sapper.head%', () => `<noscript id='sapper-head-start'></noscript>${head}<noscript id='sapper-head-end'></noscript>`)
.replace('%sapper.head%', () => head)
.replace('%sapper.styles%', () => styles);

res.statusCode = status;
Expand Down

0 comments on commit fcdd67b

Please sign in to comment.