fix(5.0.0): nitpicking and suggestions regarding on-demand-rendering.mdx#9673
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
| The following example shows opting out of prerendering in order to display a random number each time the endpoint is hit: | ||
|
|
||
| ```js title="src/pages/randomnumber.js" {1} | ||
| ```js title="src/pages/randomnumber.js" ins={1} |
There was a problem hiding this comment.
nit: The previous example use ins={2}, shouldn't we use the same visual information here? (or the other way around... not covered by my suggestion)
| Then, if needed, you can choose to prerender any individual pages that do not require a server to execute, such as a privacy policy or about page. | ||
|
|
||
| ```astro title="src/pages/about-my-app.astro" | ||
| ```astro title="src/pages/about-my-app.astro" {2} |
There was a problem hiding this comment.
Same concern here about the highlighting. The next example uses "highlighting" but we don't use it here. Maybe we should use ins here and in the next example too? (I just updated from the next example)
There was a problem hiding this comment.
Sure, let's make them all ins!
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
|
| The example below sets a response status and status text for a product page when the product does not exist: | ||
|
|
||
| ```astro title="src/pages/my-product.astro" {10,11} | ||
| ```astro title="src/pages/product/[id].astro" {10,11} |
There was a problem hiding this comment.
From my understanding, Astro.params only works with path segments (e.g. [id]). See Astro.params (besides on this page, I wonder if the example should not be above the sentence related to SSR...)
There was a problem hiding this comment.
Sorry, where would you place this example?
There was a problem hiding this comment.
To avoid any confusion I am talking about the example in the section Astro.params.
Sorry, I didn't detail as it's not related to this PR, it's just by checking Astro.params that I thought the location of the example seemed strange.
The example shows the use of getStaticPaths which is usable with static builds while the sentence just above talks about SSR builds. So what would seem more logical to me would be between the two sentences (In static builds,... > getStaticPaths example > In SSR builds, ...).
But thinking back, I guess that was to avoid isolating the "SSR builds" sentence.
There was a problem hiding this comment.
Ah, gotcha now, thanks! Yes, I see what you mean. I think it could be helpful on that page to also have an SSR example maybe? And then yes, the example there above the SSR sentence, which itself gets its own example?
There was a problem hiding this comment.
I almost forgot about this comment, sorry. Yes I think it would be useful to show both uses here. 💯 I'm going to prepare a PR.
| The example below returns a 404 on a dynamic page after looking up an ID in the database: | ||
|
|
||
| ```astro title="src/pages/[id].astro" {10-13} | ||
| ```astro title="src/pages/product/[id].astro" {10-13} |
There was a problem hiding this comment.
I only updated because that's the path I had used before... it wasn't really a problem, just a matter of consistency.
Co-authored-by: Matthew Justice <72817096+JusticeMatthew@users.noreply.github.com>
There was a problem hiding this comment.
Thank you @ArmandPhilippot these changes look great to me! I made one ins suggestion where I could, and pointed out the one where I couldn't. But happy with this!
I will say, for the changes to the "Features" sections, which is basically copied from the existing server-side-rendering page in main branch, you can feel free to PR them to that page directly too, and this will let the translators work on that updated content in advance of this branch merging eventually. That would make that merge more just "copy paste" of that entire Features section, which I really hadn't intended to change here!
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
|
Thanks for your feedback @sarah11918! I'm going to make a PR to update the current doc! 🫡 |
|
!coauthor |
Description (required)
every)ins)Astro.paramsseemed wrong otherwiseAstro.redirectinResponsesubsectionRelated issues & labels (optional)