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
Partials #8755
Conversation
🦋 Changeset detectedLatest commit: 5a8d9fa 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 |
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.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
!preview fragments |
1 similar comment
!preview fragments |
!preview fragments |
!preview fragments |
!preview fragments |
3 similar comments
!preview fragments |
!preview fragments |
!preview fragments |
This feature can be tried out by installing the preview release: npm install astro@next--fragments |
!preview fragments |
|
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.
Looks good to me.
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.
Implementation looks simpler than I expected 😄
Just a note that I'll probably be in here with some changeset suggestions after Matthew and I have hashed out the docs PR, so that the two forms of documentation align! 🙌 |
is it possible to add the |
Just pointing out that Docs is waiting on confirmation whether only |
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.
Added some changset comments to suggest a structure for this! Edit as you like!
|
||
Any page component can now be identified as a *partial*, allowing you fetch them in the client in order to replace only parts of the page. Partials are used in conjuction with a rendering library, like htmx or Stimulus or even just jQuery. | ||
|
||
Pages marked as partials do not have a `doctype` or any head content included in the rendered result. You can mark any page as a partial by setting this option: |
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.
Pages marked as partials do not have a `doctype` or any head content included in the rendered result. You can mark any page as a partial by setting this option: | |
You can mark any `.astro` page as a partial with an export statement: |
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.
Do you not think it's worth mentioning what this feature does here? I'm thinking in the context of the blog post, shouldn't we explain that it removes the head content?
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.
I'm looking now and one of my comments (my main one) is entirely missing! I rewrote a bunch of stuff to add this earlier!
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
* Fragment support * Add a changeset * Linting * debuggin * Rename to partial * Update the chagneset * Make work with mdx * Update .changeset/brave-pots-drop.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update .changeset/brave-pots-drop.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update .changeset/brave-pots-drop.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Changes
fragment
boolean which is used to determine if rendering should be fragment mode.Testing
Docs