Skip to content
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 asset bleed, second try #7185

Merged
merged 17 commits into from May 31, 2023
Merged

Markdoc asset bleed, second try #7185

merged 17 commits into from May 31, 2023

Conversation

bholmesdev
Copy link
Contributor

@bholmesdev bholmesdev commented May 23, 2023

Changes

  • Un-reverts [Markdoc] Fix global asset bleed #6758, which introduced issues for Astro component imports and Windows test failures. Fixes:
    • Use manualChunks to split Astro components as separate modules from the markdoc.config.mjs. Vite bundles these in-line by default, which introduced bugs in the previous version
    • Update renderStylesheet calls to use new APIs (this was broken during the merge in the previous version)

Original changes brought back:

  • Fix script and style bleed in Markdoc when using Astro component tags. This was introduced by the new markdoc.config.mjs in version 0.1.0.
    • Inject the astroPropagatedAssets on all Astro component imports
    • Handle propagated assets from the Markdoc renderer
  • Add a handlePropagation 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

  • New test that verifies no asset bleeding occurs in dev and prod.

Docs

N/A, bug fix

@changeset-bot
Copy link

changeset-bot bot commented May 23, 2023

🦋 Changeset detected

Latest commit: e109dbb

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

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope) labels May 23, 2023
@github-actions github-actions bot removed the pkg: astro Related to the core `astro` package (scope) label May 23, 2023
@bholmesdev bholmesdev closed this May 23, 2023
@bholmesdev bholmesdev reopened this May 23, 2023
@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label May 25, 2023
@matthewp matthewp changed the title wip: Markdoc asset bleed fixes Markdoc asset bleed fixes May 25, 2023
@matthewp
Copy link
Contributor

I think the windows failure here might be legitimate. I'm going to test on my Windows computer.

@github-actions github-actions bot added pkg: example Related to an example package (scope) pkg: preact Related to Preact (scope) pkg: react Related to React (scope) pkg: svelte Related to Svelte (scope) pkg: vue Related to Vue (scope) labels May 30, 2023
@github-actions github-actions bot removed pkg: vue Related to Vue (scope) pkg: react Related to React (scope) pkg: svelte Related to Svelte (scope) pkg: example Related to an example package (scope) pkg: preact Related to Preact (scope) labels May 30, 2023
@github-actions github-actions bot added pkg: preact Related to Preact (scope) pkg: react Related to React (scope) pkg: svelte Related to Svelte (scope) pkg: vue Related to Vue (scope) labels May 30, 2023
@bholmesdev bholmesdev changed the base branch from fix/markdoc-stylesheet-render-error to main May 31, 2023 13:52
@github-actions github-actions bot added pkg: example Related to an example package (scope) and removed pkg: preact Related to Preact (scope) pkg: svelte Related to Svelte (scope) pkg: vue Related to Vue (scope) pkg: react Related to React (scope) labels May 31, 2023
@bholmesdev bholmesdev marked this pull request as ready for review May 31, 2023 14:19
@bholmesdev bholmesdev requested a review from a team as a code owner May 31, 2023 14:19
@bholmesdev bholmesdev changed the title Markdoc asset bleed fixes Markdoc asset bleed, second try May 31, 2023
Co-authored-by: Ben Holmes <hey@bholmes.dev>
@bholmesdev bholmesdev merged commit 339529f into main May 31, 2023
15 checks passed
@bholmesdev bholmesdev deleted the fix/markdoc-asset-bleed branch May 31, 2023 23:18
@astrobot-houston astrobot-houston mentioned this pull request May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pkg: example Related to an example package (scope) pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants