Skip to content

Commit

Permalink
Provide a better name for tracking if we have added a hydration script
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed May 3, 2022
1 parent 6af3399 commit 71f3694
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/astro/src/runtime/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const htmlEnumAttributes = /^(contenteditable|draggable|spellcheck|value)$/i;
// Note: SVG is case-sensitive!
const svgEnumAttributes = /^(autoReverse|externalResourcesRequired|focusable|preserveAlpha)$/i;

const hydrationedRenders = new WeakSet<SSRResult>();
const resultsWithHydrationScript = new WeakSet<SSRResult>();

// INVESTIGATE:
// 2. Less anys when possible and make it well known when they are needed.
Expand Down Expand Up @@ -333,8 +333,8 @@ If you're still stuck, please open an issue on GitHub or join us at https://astr
// is scoped to a page renderer we can use it as a key to know if the script
// has been rendered or not.
let script = '';
if(!hydrationedRenders.has(result)) {
hydrationedRenders.add(result);
if(!resultsWithHydrationScript.has(result)) {
resultsWithHydrationScript.add(result);
script = `<script>${islandScript}</script>`;
}

Expand Down

0 comments on commit 71f3694

Please sign in to comment.