From e247d5733721d353f71eaf031ba53d16fbdecaf3 Mon Sep 17 00:00:00 2001 From: jimafisk Date: Mon, 21 Sep 2020 19:56:53 -0400 Subject: [PATCH] Remove hydrate-plenti ID and target html element (#65). --- cmd/build/data_source.go | 2 -- ejected/main.js | 2 +- generated/ejected.go | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/build/data_source.go b/cmd/build/data_source.go index 6fbc6452..fa133abb 100644 --- a/cmd/build/data_source.go +++ b/cmd/build/data_source.go @@ -191,8 +191,6 @@ func DataSource(buildPath string, siteConfig readers.SiteConfig) { } // Get the string value of the static HTML. renderedHTMLStr := renderedHTML.String() - // Inject ID needed for hydrating the SPA. - renderedHTMLStr = strings.Replace(renderedHTMLStr, "", "", 1) // Convert the string to byte array that can be written to file system. diff --git a/ejected/main.js b/ejected/main.js index eafa96aa..a5a6ff7d 100755 --- a/ejected/main.js +++ b/ejected/main.js @@ -1,6 +1,6 @@ import Router from './router.svelte'; -let target = document.querySelector('#hydrate-plenti').parentNode; +let target = document.querySelector('html').parentNode; new Router({ target: target, diff --git a/generated/ejected.go b/generated/ejected.go index fa0b0dfc..b757b7f8 100644 --- a/generated/ejected.go +++ b/generated/ejected.go @@ -110,7 +110,7 @@ staticBuildStr.forEach(arg => { });`), "/main.js": []byte(`import Router from './router.svelte'; -let target = document.querySelector('#hydrate-plenti').parentNode; +let target = document.querySelector('html').parentNode; new Router({ target: target,