-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversation
🦋 Changeset detectedLatest commit: 96e470b 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 |
4443690
to
df3e433
Compare
672639a
to
4b18f42
Compare
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.
Seeing a review request, but I don’t think this needs a docs maintainers review? This is mostly invisible to users and just a bug fix right? Nice work, Ben!
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.
Only one question, other than that it looks good to me. Propagation stuff is quite magical to me 😄
@@ -10,9 +9,10 @@ import { isCSSRequest } from './util.js'; | |||
* List of file extensions signalling we can (and should) SSR ahead-of-time | |||
* See usage below | |||
*/ | |||
const fileExtensionsToSSR = new Set(['.astro', ...SUPPORTED_MARKDOWN_FILE_EXTENSIONS]); | |||
const fileExtensionsToSSR = new Set(['.astro', '.mdoc', ...SUPPORTED_MARKDOWN_FILE_EXTENSIONS]); |
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.
Changes
markdoc.config.mjs
in version 0.1.0.astroPropagatedAssets
on all Astro component importshandlePropagation
option for content collection integrations. This allows us to toggle asset propagation wrappers on or off by file extension. Ex. MDX needs this wrapper, but Markdown and Markdoc do not.Testing
TODO
Docs
N/A