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

MDX routes do not get HMR'd #7788

Closed
1 task done
pcattori opened this issue Oct 27, 2023 · 4 comments
Closed
1 task done

MDX routes do not get HMR'd #7788

pcattori opened this issue Oct 27, 2023 · 4 comments
Labels
bug Something isn't working vite

Comments

@pcattori
Copy link
Contributor

What version of Remix are you using?

v0.0.0-nightly-0c99349-20231027

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

Make any code change within an MDX route after setting up MDX for Vite

Expected Behavior

Route is hot updated without refreshing

Actual Behavior

Page is hard refreshed

@pcattori pcattori added bug Something isn't working vite labels Oct 27, 2023
@pcattori
Copy link
Contributor Author

pcattori commented Oct 27, 2023

MDX is tricky because it overloads export to not only export values to other modules, but also to define local JS/TS variables. And it's not possible to determine if an export was used solely as a local variable or was consumed in another module without doing a full treeshaking bundler pass.

So initially, unstable support for Vite shipped without any attempt to HMR MDX routes. But we can add HMR support for component exports and Remix-specific exports (meta, links, etc.) so that MDX routes that don't export other things still get the benefits of HMR.

Additionally, we should improve the HMR invalidation message for routes that do contain unhandled exports to explicitly point to the problematic exports. We'll probably want to link to docs that explain why those exports cannot be automatically handled as well.

@pcattori
Copy link
Contributor Author

pcattori commented Feb 7, 2024

Fixed by #8711

@pcattori pcattori closed this as completed Feb 7, 2024
Copy link
Contributor

🤖 Hello there,

We just published version 2.7.0-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

🤖 Hello there,

We just published version 2.7.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vite
Projects
None yet
Development

No branches or pull requests

1 participant