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

fix(markdoc & mdx): Proxy crimes #10278

Merged
merged 2 commits into from
Mar 1, 2024
Merged

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Feb 29, 2024

Changes

In both MDX and Markdoc we had issues with the proxy. Well, actually it's only in Markdoc, in MDX the issue is that our JSX renderer tries to access some stuff it shouldn't, I tried to fix that, but couldn't figure it out, so I went another way by making the proxy only trigger if the property exists.

In Markdoc we unfortunately just lose the proxy completely, so we can't track references. Oh well, we'll just assume images are always used, it's not the end of the world.

Fix #10066 (the Markdoc issue doesn't have a corresponding issue, noticed the problem on my website)

Testing

Added a test! For Markdoc I additionally tried on my own website that has a complex Markdoc setup (custom component and everything) to see if it fixes the issue and everything worked.

Docs

N/A

Copy link

changeset-bot bot commented Feb 29, 2024

🦋 Changeset detected

Latest commit: 881e02f

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: integration Related to any renderer integration (scope) pkg: astro Related to the core `astro` package (scope) labels Feb 29, 2024
@@ -108,6 +108,7 @@
"dev": "astro-scripts dev --copy-wasm --prebuild \"src/runtime/server/astro-island.ts\" --prebuild \"src/runtime/client/{idle,load,media,only,visible}.ts\" \"src/**/*.{ts,js}\"",
"postbuild": "astro-scripts copy \"src/**/*.astro\" && astro-scripts copy \"src/**/*.wasm\"",
"test": "pnpm run test:node",
"test:match": "pnpm run test:node --match",
Copy link
Member Author

@Princesseuh Princesseuh Feb 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node:test's match is unfortunately terrible, it takes multiple minutes on my computer since it runs through every file still. (also, it outputs every single test with "skipped because it doesn't match", terrible) However, the command in the root repo was broken, so this fixes that.

@Princesseuh Princesseuh merged commit a548a3a into main Mar 1, 2024
13 checks passed
@Princesseuh Princesseuh deleted the fix/proxy-crimes-content-edition branch March 1, 2024 14:48
@astrobot-houston astrobot-houston mentioned this pull request Mar 1, 2024
peng added a commit to peng/astro that referenced this pull request Mar 4, 2024
* main:
  [ci] format
  fix(withastro#8625): smooth scrolling in SPA mode on iOS (withastro#10235)
  [ci] release (withastro#10292)
  [ci] format
  finalize WIP API (withastro#10280)
  [ci] format
  fix(markdoc & mdx): Proxy crimes (withastro#10278)
  [ci] release (withastro#10286)
  fix(audits): Don't warn about loading on data URIs (withastro#10275)
  fix(node): Safely create requests (withastro#10285)
  [ci] release (withastro#10265)
  [ci] format
  fix(assets): Solidify Node endpoint (withastro#10284)
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: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using MDX and building for production outputs both optimized and original image assets
2 participants