-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix hoisted script propagation in content collection pages #6119
Conversation
🦋 Changeset detectedLatest commit: 9df9d3a The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't say I grok this fully, but the test looks good and I'm cool with the approach. LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple comments, mostly for cleaning up code I wrote originally. Propagreat stuff!
@@ -22,6 +22,7 @@ export interface PageBuildData { | |||
moduleSpecifier: string; | |||
css: Map<string, { depth: number; order: number }>; | |||
contentCollectionCss: Map<string, Set<string>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Meant to rename contentCollectionCss
to propagatedCss
or propagatedStyles
for consistency. Possible to add to this PR?
ctx: { getModuleInfo: GetModuleInfo }, | ||
walkUntil?: (importer: string) => boolean | ||
): Generator<[ModuleInfo, number, number], void, unknown> { | ||
for (const res of walkParentInfos(id, ctx)) { | ||
for (const res of walkParentInfos(id, ctx, walkUntil)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This refactor is unused looks like. Good to revert changes to this file!
); | ||
} | ||
if (entryScripts.size) { | ||
const entryFileNames = new Set<string>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love that we can look these up now 👏 Way simpler than scary naming conventions!
Changes
Testing
Docs
N/A