-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add SPA Integration #2899
Add SPA Integration #2899
Conversation
|
const uid = island.getAttribute('uid'); | ||
const current = document.querySelector(`astro-root[uid="${uid}"]`); | ||
if (current) { | ||
current.dataset.persist = true; |
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.
data-persist
is a special attribute that instructs micromorph
to leave a node in place during diffing.
Many of the necessary hydration changes are going to land in #3455, at which point this PR can be slimmed down significantly. |
⚖️ Bundle Size CheckLatest commit: 7833459
|
@bholmesdev is exploring this area this week. Don't want to close this PR since it's gotten quite a bit of attention, but Ben might have some more updates to share soon. |
Erm, not this week sadly 😆 But I have an RFC planned, yes! |
No longer in scope for v1.0. Will revisit post v1.0. |
Hopefully, there will be a roadmap for SPA support soon, now that we're past v1.0. |
Is there ever going to be an SPA support. Looking at building a user dashboard, but a bit skeptical about doing that |
Changes
feat/spa
.micromorph
, the same diffing engine that powers our HMR forastro dev
{ persistent: false }
option to disable this behavior.Testing
Manually using the new SPA example
Docs
TODO