Skip to content

Add docs for experimental live collections #11782

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

Merged
merged 14 commits into from
Jun 19, 2025
Merged

Add docs for experimental live collections #11782

merged 14 commits into from
Jun 19, 2025

Conversation

ascorbic
Copy link
Contributor

Description (required)

Adds docs for live collections. It's not certain which release this will be in, so I've not included the since value and won't add this to a milestone just yet

Related issues & labels (optional)

  • Closes #
  • Suggested label:

Copy link

netlify bot commented May 28, 2025

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 4a7b8e4
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/6853eb66f61b6c000870353b
😎 Deploy Preview https://deploy-preview-11782--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented May 28, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/reference/experimental-flags/live-content-collections.mdx Localization added, will be marked as complete.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@ascorbic ascorbic added add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah! labels May 28, 2025
@ascorbic ascorbic self-assigned this May 28, 2025
@sarah11918 sarah11918 added the merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) label May 28, 2025
@sarah11918 sarah11918 modified the milestone: 5.9.0 May 28, 2025
@sarah11918 sarah11918 removed the minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah! label Jun 2, 2025
@ascorbic ascorbic added this to the 5.10.0 milestone Jun 6, 2025
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really great, Matt! 🙌

Just left some broad stroke comments after reading through for a first pass with some comments!

- The error type defined by the loader (if it returned an error)
- An `AstroError` for schema validation failures or uncaught errors thrown in the loader

```astro
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting here that we want to make all code blocks copy/paste and it's working code. We try not to put multiple options in a code sample that would make it not run as-is.

There's a lot going on in this whole snippet. Can ALL of it happen together in a working function? e.g. "throw an Astro error or handle it yourself" If these can't be done together, then instead one of them could be commented out entirely e.g.

// Or handle errors yourself
// return Astro.redirect('/500');

And, the same goes for e.g. defining entries in multiple places. I know it's convenient to throw everything in one block, but I think we might need another pattern here if this, as a whole, isn't functioning code.

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd pass! This is looking great and probably doesn't require anything more than a Yan review after this! Would be perfectly happy with that state! 🙌

@sarah11918
Copy link
Member

Will note on Talking and Doc'ing that someone suggested documenting the LiveLoader type would be helpful! Would anyone like to add this?

@sarah11918 sarah11918 requested a review from yanthomasdev June 17, 2025 19:26
Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! A few nits from me 🙌


const { entry, error } = await getLiveEntry('products', '123');
if (error) {
// This could be a network error, not found error, or Zod validation error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This could be a network error, not found error, or Zod validation error
// This could be a network error, not found error or Zod validation error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had it hammered into me to use Oxford comma for Astro stuff, so isn't this right as it stands? I think I'll reword this anyway though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm not sure why Yan would remove an Oxford comma. Chalk it up to exam week brain, unless there's something I'm missing? 😄

So fine as is, I think!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably the thing I find hardest to remember when writing Astro stuff! Even harder than using US spelling, because at least that's obvious.

@sarah11918 sarah11918 changed the base branch from main to 5.10.0 June 19, 2025 10:57
@sarah11918 sarah11918 merged commit 94a27bf into 5.10.0 Jun 19, 2025
6 checks passed
@sarah11918 sarah11918 deleted the live-loaders branch June 19, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants