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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃挕 RFC: Improve the page transition experience #1626
Comments
|
Agree that something like this is becoming important for a good MPA experience. There is an extension that does some of this: https://github.com/RafidMuhymin/astro-spa Curious to hear how what you're proposing with Turbo would compare to that? |
|
https://swup.js.org/ Swup.js is a good option for an add-on package that adds animated page transitions, they have some really handy plugins as well for things like accessibility and Google Tag Manager |
|
I think this relates to PJAX and barbajs, imo it should wait until the appHistory API is better supported. |
|
Discussion:
Consensus:
|
|
What type of metadata is |
Possibly dependencies (JS, CSS), but possibly something like hashes (for caching, just some kind of flag for the frontend to leverage). |
|
I have a related use case: a site with a media player. Media playback should persist across page navigations, but the bulk of the page is just static content, so Astro鈥檚 islands approach makes sense. I鈥檝e had success using Swup to make this work, reloading most of the page and just preserving the media player across navigations. So, next challenge and the one where I wonder whether an Astro API may be needed: some pages render inline components that need hydrating. Because a page transition library removes the page load, we need to handle this ourselves. In Astro 0.20.x, I had a working if slightly hacky model based on @RafidMuhymin鈥檚 approach from <div id="swapped-on-navigation">
<!-- static stuff -->
<astro-root ... />
<script that hydrates the above astro-root></script>
<!-- static stuff -->
</div>
<div id="persisted-across-navigations">
<astro-root ... />
<script that hydrates the above astro-root></script>
</div>So it was possible to grab the swapped content and retrigger each script block hydrating only the replaced content. In 0.21.0, Vite does a nice job of bundling everything up so we just get a tidy little script tag in Would it be possible to have some kind of API like: Astro.requestHydration(['component-id', 'component-id', ...]);
// or even better
Astro.requestHydration('#container-selector');That way when managing page transitions, you can 1) handle loading new content, 2) insert it into the page, 3) request a hydration that would be consistent with the usual hydration. Given the zero JS by default approach, I鈥檓 not sure what would be ideal in terms of deciding when the bundle needs this |
|
Hey everyone! Our current RFC process is beginning to break down at this size, with over 50 open RFCs currently in the "discussing" stage. A growing community is a great problem to have, but our ability to give you RFC feedback has suffered as a result. In an effort to improve our RFC process, we are making some changes to better organize things. From now on, all RFCs will live in a standalone repo: https://github.com/withastro/rfcs This allows us to do three things: 1) Use threaded discussions for high-level ideas and improvements, without necessarily requiring an implementation for every idea. 2) Improve the quality of our RFC template and the speed/quality of all feedback. 3) Support inline comments and explicit approvals on RFCs, via a new Pull Request review process. We hope that this new process leads to better RFC weekly calls and faster feedback on your RFCs from maintainers. More detail can be found in the new RFC repo README. We can't automatically convert this issue to an RFC in the new repo because new RFC template is more detailed that this one. But, you can still continue this discussion in the new repo by creating a new Discussion in the RFC repo and copy-and-pasting this post (and any relevant follow-up comments) into it. Discussions are available for high-level ideas and suggestions without the requirement of a full implementation proposal. Then, when you are ready to propose (or re-propose) an implementation for feedback and approval, you can create a new RFC using the new RFC template. More detail about how to do this can be found in the new RFC repo README. Thanks for your patience as we attempt to improve things for both authors and reviewers. If you have any questions, don't hesitate to reach out on Discord. https://astro.build/chat |
|
Did this get ported over to the new RFCS? Very interested in page transitions! |
Background & Motivation
When we are in a SPA we have some options to make a smooth page transition.
There are initial discussions on how to do this for multi-page applications
And there are js libraries that apply solutions on how to make these transitions:
Proposed Solution
Possible solutions
Integration with Turbo Drive and Turbo Frame
Risks, downsides, and/or tradeoffs
Open Questions
Detailed Design
No response
Help make it happen!
The text was updated successfully, but these errors were encountered: