Skip to content

Commit 0b2db41

Browse files
committed
chore: remove noScriptHere counter
1 parent 2c85df4 commit 0b2db41

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/qwik/src/server/ssr-container.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,6 @@ class SSRContainer extends _SharedContainer implements ISSRContainer {
350350
openContainer() {
351351
if (this.tag == 'html') {
352352
this.write('<!DOCTYPE html>');
353-
// -1 so we only emit inside body
354-
this.$noScriptHere$ = -1;
355353
}
356354

357355
const containerAttributes = this.renderOptions.containerAttributes || {};
@@ -383,7 +381,6 @@ class SSRContainer extends _SharedContainer implements ISSRContainer {
383381
return this.closeElement();
384382
}
385383

386-
// -1 so we only emit inside body
387384
private $noScriptHere$: number = 0;
388385

389386
/** Renders opening tag for DOM element */
@@ -402,12 +399,12 @@ class SSRContainer extends _SharedContainer implements ISSRContainer {
402399
!isQwikStyle &&
403400
this.qlInclude === QwikLoaderInclude.Inline
404401
) {
405-
if (this.$noScriptHere$ === 0 && this.size > 30 * 1024) {
402+
if (this.$noScriptHere$ === 0 && this.size > 30 * 1024 && elementName !== 'body') {
406403
// We waited long enough, on slow connections the page is already partially visible
407404
this.emitQwikLoaderInline();
408405
}
409406
// keep track of noscript and template, and for html we only emit inside body
410-
else if (elementName === 'noscript' || elementName === 'template' || elementName === 'body') {
407+
else if (elementName === 'noscript' || elementName === 'template') {
411408
this.$noScriptHere$++;
412409
}
413410
}

0 commit comments

Comments
 (0)