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
[Markdoc] Fix global asset bleed #6758
Merged
Merged
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
d26721b
wip: propagatedAssets flag per-component
bholmesdev b4bf54a
Propagate in TreeNode
matthewp 535bf98
fix: remove unused inject comment
bholmesdev 3a34cb2
feat: make asset propagation an integration opt-in
bholmesdev 087e676
fix: remove crawlGraph stopper
bholmesdev 16481a4
wip: logs to understand what's happening
bholmesdev 4dd3dd5
SSR mdoc files in dev
matthewp 1f05fdb
feat: add astroPropagatedAssets flag with vite
bholmesdev ec1a315
chore: remove console logs
bholmesdev df3e433
chore: cleanup hasContentFlag
bholmesdev fbd2801
fix: set handlePropagation default for legacy integrations
bholmesdev b90eebb
chore: changeset
bholmesdev 9881738
temp: silence acorn type error
bholmesdev 5b8d2b2
chore: revert pnpm-lock changes
bholmesdev 4b18f42
fix: check correct flag
bholmesdev 39e657f
Merge branch 'main' into fix/markdoc-global-assets
matthewp 303792c
We need to handle propagation on markdown because of layouts
matthewp 04daea0
Remove use of renderStyleElement
matthewp 7c37771
Fix heading tests
matthewp e642caf
Merge branch 'main' into fix/markdoc-global-assets
matthewp 568aed8
Fix merge conflict
matthewp 61bf92e
typeof function
matthewp 0e94ed4
Switch the check
matthewp 96e470b
Add comment on injection detection regexp
matthewp File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'astro': patch | ||
'@astrojs/markdoc': patch | ||
'@astrojs/mdx': patch | ||
--- | ||
|
||
Improve style and script handling across content collection files. This addresses style bleed present in `@astrojs/markdoc` v0.1.0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
export const PROPAGATED_ASSET_FLAG = 'astroPropagatedAssets'; | ||
export const CONTENT_RENDER_FLAG = 'astroRenderContent'; | ||
export const CONTENT_FLAG = 'astroContentCollectionEntry'; | ||
export const DATA_FLAG = 'astroDataCollectionEntry'; | ||
export const CONTENT_FLAGS = [CONTENT_FLAG, DATA_FLAG, PROPAGATED_ASSET_FLAG] as const; | ||
|
||
export const VIRTUAL_MODULE_ID = 'astro:content'; | ||
export const LINKS_PLACEHOLDER = '@@ASTRO-LINKS@@'; | ||
export const STYLES_PLACEHOLDER = '@@ASTRO-STYLES@@'; | ||
export const SCRIPTS_PLACEHOLDER = '@@ASTRO-SCRIPTS@@'; | ||
|
||
export const CONTENT_FLAGS = [CONTENT_FLAG, CONTENT_RENDER_FLAG, DATA_FLAG, PROPAGATED_ASSET_FLAG] as const; | ||
|
||
export const CONTENT_TYPES_FILE = 'types.d.ts'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is there a reason we're hardcoding
.mdoc
here?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.
These are modules that we need to ensure are imported before we do rendering in dev. We need to do this so that we can discover which CSS to include on the page.
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.
Thanks. I was hoping there's a way the markdoc integration could tell about this information so we don't have to hardcode this, but if it's not easy to do so, I'm usually fine with things like this 👍
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.
Yeah, I mean it definitely could. We need a generic solution if we keep going down that path. Maybe using metadata or something like that... probably would rather hold off until the next time to tackle that.