diff --git a/packages/react/src/ssr.js b/packages/react/src/ssr.js index 4ad5d27..0673f84 100644 --- a/packages/react/src/ssr.js +++ b/packages/react/src/ssr.js @@ -20,14 +20,14 @@ class Ssr extends Transform { async _transform(chunk, encoding, done) { const string = chunk.toString('utf8'); const {appMountId} = this.flecks.get('@flecks/web/server'); - if (-1 !== string.indexOf(`
`)) { + if (-1 !== string.indexOf(`
`)) { try { const renderedRoot = ReactDOMServer.renderToString( React.createElement(await root(this.flecks, this.req)), ); const rendered = string.replaceAll( - `
`, - `
${renderedRoot}
`, + `
`, + `
${renderedRoot}`, ); this.push(rendered); } diff --git a/packages/web/src/server/build/entry.js b/packages/web/src/server/build/entry.js index 8e67c45..dccbe63 100644 --- a/packages/web/src/server/build/entry.js +++ b/packages/web/src/server/build/entry.js @@ -63,8 +63,8 @@ const {version} = require('@flecks/web/package.json'); try { await Promise.all(flecks.invokeFlat('@flecks/core.starting')); await flecks.invokeSequentialAsync('@flecks/web/client.up'); - const appMountId = `#${config['@flecks/web/client'].appMountId}`; - window.document.querySelector(appMountId).style.display = 'block'; + const appMountContainerId = `#${config['@flecks/web/client'].appMountId}-container`; + window.document.querySelector(appMountContainerId).style.display = 'block'; debug('up!'); } catch (error) { diff --git a/packages/web/src/server/build/template.ejs b/packages/web/src/server/build/template.ejs index 6b72d3e..52f0321 100644 --- a/packages/web/src/server/build/template.ejs +++ b/packages/web/src/server/build/template.ejs @@ -11,7 +11,6 @@ <% }); %> -
<%= htmlWebpackPlugin.tags.bodyTags %> diff --git a/packages/web/src/server/config.js b/packages/web/src/server/config.js index 52f505d..20b3bcb 100644 --- a/packages/web/src/server/config.js +++ b/packages/web/src/server/config.js @@ -45,20 +45,18 @@ class InlineConfig extends Transform { async _transform(chunk, encoding, done) { const string = chunk.toString('utf8'); const {appMountId} = this.flecks.get('@flecks/web/server'); - if (-1 !== string.indexOf(`
`)) { - const rendered = string.replaceAll( + const rendered = string.replaceAll( + '', + [ + '', + `
`, + ``, + ``, `
`, - [ - `
`, - ``, - ``, - ].join(''), - ); - this.push(rendered); - } - else { - this.push(string); - } + '
', + ].join(''), + ); + this.push(rendered); done(); }