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

feat(remix-dev/vite): support HMR for MDX #7954

Closed
wants to merge 2 commits into from

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Nov 9, 2023

Closes: #7788

I went over some relevant discussions and other implementations regarding HMR-ing MDX:

and my conclusion is that HMR should just work as long as MDX files goes through "react-refresh/babel" transform.
Currently remix-react-refresh-babel already enforce: "post" and @mdx-js/rollup has no enforce, so simply tweaking regex filter to allow .mdx seems to be enough.

However, as it's already mentioned, mdx uses export for local variable and also for frontmatter plugin, so this unfortunately forces full-reload when mdx includes frontmatter, but I think this might be okay for starter.
Please let me know if it's desired to improve more HMR feature for MDX (for example, maybe extend HMR acceptExports trick to cover frontmatter in some way? or improve "Could not Fast Refresh" message for frontmatter?).
Thanks!


  • Docs
  • Tests

Testing Strategy:

Copy link

changeset-bot bot commented Nov 9, 2023

🦋 Changeset detected

Latest commit: 39ee9cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@remix-run/dev Patch
create-remix Patch
remix Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/css-bundle Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/testing Patch

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

@hi-ogawa hi-ogawa marked this pull request as ready for review November 9, 2023 09:19
@pcattori
Copy link
Contributor

pcattori commented Feb 7, 2024

Superceded by #8711

Thanks again for looking into this issue! Added you as a co-author on the other PR since our testing setup has changed since this PR was opened.

@pcattori pcattori closed this Feb 7, 2024
@hi-ogawa hi-ogawa deleted the feat-vite-hmr-for-mdx branch February 7, 2024 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants