-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
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.
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 |
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.
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.
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Show resolved
Hide resolved
Co-authored-by: Sarah Rainsberger <[email protected]>
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.
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! 🙌
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
Co-authored-by: Sarah Rainsberger <[email protected]>
Will note on Talking and Doc'ing that someone suggested documenting the |
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.
Great work! A few nits from me 🙌
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/live-content-collections.mdx
Outdated
Show resolved
Hide resolved
|
||
const { entry, error } = await getLiveEntry('products', '123'); | ||
if (error) { | ||
// This could be a network error, not found error, or Zod validation error |
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 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 |
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'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
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.
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!
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.
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.
Co-authored-by: Yan <[email protected]>
…collections.mdx Co-authored-by: Yan <[email protected]>
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 yetRelated issues & labels (optional)