Skip to content
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

Runtime API restructure #10062

Merged
merged 93 commits into from
Dec 2, 2024
Merged

Runtime API restructure #10062

merged 93 commits into from
Dec 2, 2024

Conversation

sarah11918
Copy link
Member

@sarah11918 sarah11918 commented Nov 19, 2024

Description (required)

Combines the Astro.global and context object entries since several are duplicates or only links up to the global entry anyway.

This also makes each entry more visible to see where we haven't sufficiently documented.

Also:

  • creates a new Routing reference page for the getStaticPaths() content
    • adds entry for prerender
    • adds entry for partial
  • moves Astro.self and Astro.slots to the Template Reference page, as a second item to go with JSX-like expressions, since that's where this content is most similar

Links pass checks, but follow up for error reference will be needed once we are sure we are done.

We could further:

  • rename api-reference -- will give us more links to fix, but will be more accurate? Not needed, and we can always tackle this with our few pages that are still left in /basics/.

Copy link

netlify bot commented Nov 19, 2024

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 862d442
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/674dc33293daf500086d0064
😎 Deploy Preview https://deploy-preview-10062--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 site configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Nov 19, 2024

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
ar/basics/astro-components.mdx Localization changed, will be marked as complete.
ar/getting-started.mdx Localization changed, will be marked as complete.
de/basics/astro-components.mdx Localization changed, will be marked as complete.
de/getting-started.mdx Localization changed, will be marked as complete.
de/guides/migrate-to-astro/from-create-react-app.mdx Localization changed, will be marked as complete. 🔄️
de/guides/troubleshooting.mdx Localization changed, will be marked as complete.
de/reference/astro-syntax.mdx Localization added, will be marked as complete.
en/basics/astro-components.mdx Source changed, localizations will be marked as outdated.
en/basics/astro-pages.mdx Source changed, localizations will be marked as outdated.
en/getting-started.mdx Source changed, localizations will be marked as outdated.
en/guides/actions.mdx Source changed, localizations will be marked as outdated.
en/guides/cms/builderio.mdx Source changed, localizations will be marked as outdated.
en/guides/cms/contentful.mdx Source changed, localizations will be marked as outdated.
en/guides/cms/strapi.mdx Source changed, localizations will be marked as outdated.
en/guides/content-collections.mdx Source changed, localizations will be marked as outdated.
en/guides/endpoints.mdx Source changed, localizations will be marked as outdated.
en/guides/images.mdx Source changed, localizations will be marked as outdated.
en/guides/integrations-guide/vercel.mdx Source changed, localizations will be marked as outdated.
en/guides/internationalization.mdx Source changed, localizations will be marked as outdated.
en/guides/middleware.mdx Source changed, localizations will be marked as outdated.
en/guides/migrate-to-astro/from-create-react-app.mdx Source changed, localizations will be marked as outdated.
en/guides/migrate-to-astro/from-gatsby.mdx Source changed, localizations will be marked as outdated.
en/guides/migrate-to-astro/from-jekyll.mdx Source changed, localizations will be marked as outdated.
en/guides/migrate-to-astro/from-nextjs.mdx Source changed, localizations will be marked as outdated.
en/guides/on-demand-rendering.mdx Source changed, localizations will be marked as outdated.
en/guides/routing.mdx Source changed, localizations will be marked as outdated.
en/guides/troubleshooting.mdx Source changed, localizations will be marked as outdated.
en/guides/typescript.mdx Source changed, localizations will be marked as outdated.
en/guides/upgrade-to/v1.mdx Localization changed, will be marked as complete.
en/guides/upgrade-to/v2.mdx Source changed, localizations will be marked as outdated.
en/guides/upgrade-to/v3.mdx Source changed, localizations will be marked as outdated.
en/guides/upgrade-to/v4.mdx Source changed, localizations will be marked as outdated.
en/guides/upgrade-to/v5.mdx Source changed, localizations will be marked as outdated.
en/recipes/call-endpoints.mdx Source changed, localizations will be marked as outdated.
en/recipes/rss.mdx Source changed, localizations will be marked as outdated.
en/reference/adapter-reference.mdx Source changed, localizations will be marked as outdated.
en/reference/api-reference.mdx Source changed, localizations will be marked as outdated.
en/reference/astro-syntax.mdx Localization added, will be marked as complete.
en/reference/container-reference.mdx Localization changed, will be marked as complete.
en/reference/directives-reference.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/action-called-from-server-error.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/client-address-not-available.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/get-static-paths-expected-params.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/get-static-paths-invalid-route-param.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/get-static-paths-required.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/invalid-get-static-path-param.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/invalid-get-static-paths-entry.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/invalid-get-static-paths-return.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/no-matching-static-path-found.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/prerender-client-address-not-available.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/prerender-dynamic-endpoint-path-collide.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/redirect-with-no-location.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/rewrite-with-body-used.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/static-client-address-not-available.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/static-redirect-not-available.mdx Source changed, localizations will be marked as outdated.
en/reference/experimental-flags/svg.mdx Source changed, localizations will be marked as outdated.
en/reference/modules/astro-actions.mdx Source changed, localizations will be marked as outdated.
en/reference/modules/astro-middleware.mdx Source changed, localizations will be marked as outdated.
en/reference/routing-reference.mdx Localization added, will be marked as complete.
en/tutorial/2-pages/3.mdx Source changed, localizations will be marked as outdated.
en/tutorial/2-pages/4.mdx Source changed, localizations will be marked as outdated.
en/tutorial/2-pages/5.mdx Source changed, localizations will be marked as outdated.
en/tutorial/5-astro-api/2.mdx Source changed, localizations will be marked as outdated.
es/basics/astro-components.mdx Localization changed, will be marked as complete.
es/getting-started.mdx Localization changed, will be marked as complete.
es/guides/images.mdx Localization changed, will be marked as complete. 🔄️
es/guides/migrate-to-astro/from-create-react-app.mdx Localization changed, will be marked as complete. 🔄️
es/guides/migrate-to-astro/from-gatsby.mdx Localization changed, will be marked as complete. 🔄️
es/guides/migrate-to-astro/from-jekyll.mdx Localization changed, will be marked as complete. 🔄️
es/guides/migrate-to-astro/from-nextjs.mdx Localization changed, will be marked as complete. 🔄️
es/guides/troubleshooting.mdx Localization changed, will be marked as complete.
es/reference/api-reference.mdx Localization changed, will be marked as complete.
es/reference/astro-syntax.mdx Localization added, will be marked as complete.
es/reference/directives-reference.mdx Localization changed, will be marked as complete.
es/tutorial/2-pages/3.mdx Localization changed, will be marked as complete.
es/tutorial/2-pages/4.mdx Localization changed, will be marked as complete.
es/tutorial/2-pages/5.mdx Localization changed, will be marked as complete.
fr/basics/astro-components.mdx Localization changed, will be marked as complete.
fr/getting-started.mdx Localization changed, will be marked as complete.
fr/guides/images.mdx Localization changed, will be marked as complete. 🔄️
fr/guides/migrate-to-astro/from-create-react-app.mdx Localization changed, will be marked as complete. 🔄️
fr/guides/migrate-to-astro/from-gatsby.mdx Localization changed, will be marked as complete. 🔄️
fr/guides/migrate-to-astro/from-jekyll.mdx Localization changed, will be marked as complete. 🔄️
fr/guides/migrate-to-astro/from-nextjs.mdx Localization changed, will be marked as complete. 🔄️
fr/guides/troubleshooting.mdx Localization changed, will be marked as complete.
fr/reference/astro-syntax.mdx Localization added, will be marked as complete.
fr/reference/directives-reference.mdx Localization changed, will be marked as complete.
fr/tutorial/2-pages/3.mdx Localization changed, will be marked as complete.
fr/tutorial/2-pages/4.mdx Localization changed, will be marked as complete.
fr/tutorial/2-pages/5.mdx Localization changed, will be marked as complete.
hi/basics/astro-components.mdx Localization changed, will be marked as complete.
hi/getting-started.mdx Localization changed, will be marked as complete.
hi/reference/astro-syntax.mdx Localization added, will be marked as complete.
it/basics/astro-components.mdx Localization changed, will be marked as complete.
it/getting-started.mdx Localization changed, will be marked as complete.
it/guides/endpoints.mdx Localization changed, will be marked as complete.
it/guides/routing.mdx Localization changed, will be marked as complete.
it/recipes/call-endpoints.mdx Localization changed, will be marked as complete.
it/reference/astro-syntax.mdx Localization added, will be marked as complete.
ja/basics/astro-components.mdx Localization changed, will be marked as complete.
ja/getting-started.mdx Localization changed, will be marked as complete.
ja/guides/cms/contentful.mdx Localization changed, will be marked as complete.
ja/guides/content-collections.mdx Localization changed, will be marked as complete. 🔄️
ja/guides/endpoints.mdx Localization changed, will be marked as complete.
ja/guides/images.mdx Localization changed, will be marked as complete. 🔄️
ja/guides/middleware.mdx Localization changed, will be marked as complete.
ja/guides/routing.mdx Localization changed, will be marked as complete.
ja/guides/troubleshooting.mdx Localization changed, will be marked as complete.
ja/guides/typescript.mdx Localization changed, will be marked as complete.
ja/guides/upgrade-to/v3.mdx Localization changed, will be marked as complete.
ja/guides/upgrade-to/v4.mdx Localization changed, will be marked as complete. 🔄️
ja/reference/adapter-reference.mdx Localization changed, will be marked as complete. 🔄️
ja/reference/astro-syntax.mdx Localization added, will be marked as complete.
ja/reference/directives-reference.mdx Localization changed, will be marked as complete.
ja/reference/errors/client-address-not-available.mdx Localization changed, will be marked as complete.
ja/reference/errors/get-static-paths-expected-params.mdx Localization changed, will be marked as complete.
ja/reference/errors/get-static-paths-invalid-route-param.mdx Localization changed, will be marked as complete.
ja/reference/errors/get-static-paths-required.mdx Localization changed, will be marked as complete. 🔄️
ja/reference/errors/invalid-get-static-path-param.mdx Localization changed, will be marked as complete.
ja/reference/errors/invalid-get-static-paths-entry.mdx Localization changed, will be marked as complete.
ja/reference/errors/invalid-get-static-paths-return.mdx Localization changed, will be marked as complete.
ja/reference/errors/no-matching-static-path-found.mdx Localization changed, will be marked as complete.
ja/reference/errors/static-client-address-not-available.mdx Localization changed, will be marked as complete. 🔄️
ja/reference/errors/static-redirect-not-available.mdx Localization changed, will be marked as complete. 🔄️
ja/tutorial/2-pages/3.mdx Localization changed, will be marked as complete.
ja/tutorial/2-pages/4.mdx Localization changed, will be marked as complete.
ja/tutorial/2-pages/5.mdx Localization changed, will be marked as complete.
ja/tutorial/5-astro-api/2.mdx Localization changed, will be marked as complete. 🔄️
ko/basics/astro-components.mdx Localization changed, will be marked as complete.
ko/getting-started.mdx Localization changed, will be marked as complete.
ko/guides/images.mdx Localization changed, will be marked as complete. 🔄️
ko/guides/migrate-to-astro/from-create-react-app.mdx Localization changed, will be marked as complete. 🔄️
ko/guides/migrate-to-astro/from-gatsby.mdx Localization changed, will be marked as complete. 🔄️
ko/guides/migrate-to-astro/from-jekyll.mdx Localization changed, will be marked as complete. 🔄️
ko/guides/migrate-to-astro/from-nextjs.mdx Localization changed, will be marked as complete. 🔄️
ko/guides/troubleshooting.mdx Localization changed, will be marked as complete.
ko/reference/astro-syntax.mdx Localization added, will be marked as complete.
ko/reference/directives-reference.mdx Localization changed, will be marked as complete.
ko/tutorial/2-pages/3.mdx Localization changed, will be marked as complete.
ko/tutorial/2-pages/4.mdx Localization changed, will be marked as complete.
ko/tutorial/2-pages/5.mdx Localization changed, will be marked as complete.
pl/basics/astro-components.mdx Localization changed, will be marked as complete.
pl/getting-started.mdx Localization changed, will be marked as complete.
pl/guides/upgrade-to/v4.mdx Localization changed, will be marked as complete. 🔄️
pl/reference/astro-syntax.mdx Localization added, will be marked as complete.
pt-br/basics/astro-components.mdx Localization changed, will be marked as complete.
pt-br/getting-started.mdx Localization changed, will be marked as complete.
pt-br/guides/images.mdx Localization changed, will be marked as complete. 🔄️
pt-br/guides/troubleshooting.mdx Localization changed, will be marked as complete.
pt-br/reference/astro-syntax.mdx Localization added, will be marked as complete.
pt-br/reference/directives-reference.mdx Localization changed, will be marked as complete.
pt-br/tutorial/2-pages/3.mdx Localization changed, will be marked as complete.
pt-br/tutorial/2-pages/4.mdx Localization changed, will be marked as complete.
pt-br/tutorial/2-pages/5.mdx Localization changed, will be marked as complete.
ru/basics/astro-components.mdx Localization changed, will be marked as complete.
ru/getting-started.mdx Localization changed, will be marked as complete.
ru/reference/api-reference.mdx Localization changed, will be marked as complete.
ru/reference/astro-syntax.mdx Localization added, will be marked as complete.
ru/tutorial/2-pages/3.mdx Localization changed, will be marked as complete.
ru/tutorial/2-pages/4.mdx Localization changed, will be marked as complete.
ru/tutorial/2-pages/5.mdx Localization changed, will be marked as complete.
zh-cn/basics/astro-components.mdx Localization changed, will be marked as complete.
zh-cn/getting-started.mdx Localization changed, will be marked as complete.
zh-cn/guides/images.mdx Localization changed, will be marked as complete. 🔄️
zh-cn/guides/migrate-to-astro/from-create-react-app.mdx Localization changed, will be marked as complete. 🔄️
zh-cn/guides/migrate-to-astro/from-gatsby.mdx Localization changed, will be marked as complete. 🔄️
zh-cn/guides/migrate-to-astro/from-jekyll.mdx Localization changed, will be marked as complete. 🔄️
zh-cn/guides/migrate-to-astro/from-nextjs.mdx Localization changed, will be marked as complete. 🔄️
zh-cn/guides/troubleshooting.mdx Localization changed, will be marked as complete.
zh-cn/reference/astro-syntax.mdx Localization added, will be marked as complete.
zh-cn/reference/directives-reference.mdx Localization changed, will be marked as complete.
zh-cn/tutorial/2-pages/3.mdx Localization changed, will be marked as complete.
zh-cn/tutorial/2-pages/4.mdx Localization changed, will be marked as complete.
zh-cn/tutorial/2-pages/5.mdx Localization changed, will be marked as complete.
zh-tw/basics/astro-components.mdx Localization changed, will be marked as complete.
zh-tw/getting-started.mdx Localization changed, will be marked as complete.
zh-tw/reference/astro-syntax.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.

@sarah11918 sarah11918 added 5.0.0-beta information architecture reorganizes content on the site labels Nov 19, 2024
Copy link
Contributor

@trueberryless trueberryless left a comment

Choose a reason for hiding this comment

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

I have quickly looked over the page (the first half more in depth).

I think moving all headings up one step is a good decision cause before everthing was kinda nested under Astro global which didn't provide much context. Generally speaking, it just looks cleaner...

I'm wondering if the h4 headings should be visible in ToC, maybe on this page it would be more beneficial to override it, but I also love if it is consistent across all pages, so we prob should just leave it as it is...

From the content point of view, I think I know the Astro basics too bad to comment on that. Let me read the docs first xD

src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
@sarah11918 sarah11918 marked this pull request as ready for review November 26, 2024 18:03
Copy link
Member

@TheOtterlord TheOtterlord left a comment

Choose a reason for hiding this comment

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

Most of these add text highlighting, but there's a couple points relating to accuracy/missing content.

src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved

See also: [`Astro.locals`](#astrolocals)
The locale computed from the current URL, using the syntax specified in your `locales` configuration. If the URL does not contain a `/[locale]/` prefix, then the value will default to `i18n.defaultLocale`.
Copy link
Member

Choose a reason for hiding this comment

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

This is undefined if you have routing.prefixDefaultLocale set to true.

src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
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.

Good work!

src/content/docs/en/basics/astro-syntax.mdx Outdated Show resolved Hide resolved
src/content/docs/en/basics/astro-syntax.mdx Outdated Show resolved Hide resolved
src/content/docs/en/basics/astro-syntax.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/api-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/routing-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/routing-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/routing-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/routing-reference.mdx Outdated Show resolved Hide resolved
src/content/docs/en/reference/routing-reference.mdx Outdated Show resolved Hide resolved
sarah11918 and others added 9 commits November 26, 2024 15:34
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
<button type="submit">Log out</button>
</form>
{result?.error && <p>Failed to log out. Please try again.</p>}
```astro title="src/pages/index.astro" "Astro.site"
Copy link
Member Author

Choose a reason for hiding this comment

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

Flagging that I had asked for an example here, and Reuben provided a placeholder one. Will this work, or do we need to change it?

Copy link
Member

Choose a reason for hiding this comment

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

I think the example is fine!

sarah11918 and others added 14 commits November 29, 2024 15:42
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
@sarah11918
Copy link
Member Author

we could use a syncKey on the tabs

I could only find one entry that used multiple tabs (rewrite()), so I added that there! Otherwise, I had thought about it, but since the labels are the names of the entries, it's not a straight up match down the page.

@ArmandPhilippot
Copy link
Member

ArmandPhilippot commented Nov 29, 2024

I could only find one entry that used multiple tabs (rewrite()), so I added that there! Otherwise, I had thought about it, but since the labels are the names of the entries, it's not a straight up match down the page.

I think Chris meant across the whole page. So if I select context in rewrite(), all the other sections (redirect(), generator, etc.) show me the context tab directly. If someone is viewing the page with Astro. in mind, they are likely to only want to see Astro. tabs, and vice versa with context.
So exactly the same functioning as PackageManagerTabs (which uses the package-managers key), except that here it is Astro and context (instead of npm, pnpm and yarn).

I think this is a good idea! I didn't add suggestions to the relevant places because, in that case, the key name (rewrite) may no longer be appropriate. But I can't find a meaningful word to connect the two... (same issue as the page title 😅 ). I did think of context (since the word is used in the title) but it could be confusing because of the context tab... Perhaps render or render-context or even astro-context?

<p>

**Type:** `boolean`<br />
**Default:** `true` <br />
Copy link
Member

Choose a reason for hiding this comment

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

I already approved, but with Chris suggestions (🙌🏽 ) the content has changed a bit. Everything looks fine with a quick read (I didn't check for typo), but I'm a bit concern about this Default:.

Both Per-page override and Switch to server mode are under this h2. And while true is the default in static mode, this is not the case (from my understanding) with server mode. So it could be confusing.
I think we should either move Default: into subsections or use a slightly more complex Default:. Perhaps something like:

Suggested change
**Default:** `true` <br />
**Default:** `true` with `output: 'static'` or `false` with `output: 'server'` <br />

Copy link
Member Author

@sarah11918 sarah11918 Nov 29, 2024

Choose a reason for hiding this comment

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

Thanks for commenting on this! I had wondered about this, because you're right, it's not the default in server mode. It is true that it's default until you do something to change the nature of your project, which is how the text was handling it. I wasn't sure whether we had a standard way of either/or 'ing it, or whether it was in fact actually helpful to present the default as true (because it is until something else happens.)

The wording kind of explains setting output: 'server' as the way to change the default and I do like that framing. But I'm open to people's opinions!

Copy link
Member

Choose a reason for hiding this comment

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

I was hesitant about that. I understood the intention given the structure of the page, but I am now quite familiar with how it works (I think 😄 ). So I totally understand what you mean.
But for someone new it might be less obvious... especially if they quickly scan the page instead of reading the explanations in detail...
(When I see some questions asked, sometimes I just want to say "but have you read the doc"!? I admire your patience! 🙄) So I don't know what the best way to solve this is, but I think it could be problematic.

Regarding the standard way of doing it, I don't think so. But I'm sure there is another place where Default: is used as I suggested (two possible values, not the wording). But I can't find the page anymore... I don't think it's been edited, maybe moved. Or I'm not looking in the right place.

Copy link
Member Author

@sarah11918 sarah11918 Nov 29, 2024

Choose a reason for hiding this comment

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

I had thought we had another place too, but I didn't immediately find it and didn't want to introduce inconsistency! If you can't find it either, maybe it didn't make it into the new docs!

I'm happy to go with your suggestion if you feel it's more helpful! My only slight nagging concern is that output: 'static' is a default that no one would set. And, it's def true by default default, even if they don't know what output: 'static' is. Like, this is really the default. And I do think there's value in it being presented that way.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if this is the example I was thinking about, but I finally found a page where Default: uses two values:

Default: "development" when running astro dev, "production" when running astro build

( https://deploy-preview-10062--astro-docs-2.netlify.app/en/reference/programmatic-reference/#mode )

So I think something like this might be useful here...

Copy link
Member

Choose a reason for hiding this comment

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

Ok, so I only just saw your comment now... (thanks the email notifications...) I was on the page, but it seems I'm having auto-refresh issues with Github the last few days (notifs in particular). Even after posting the link, your comment wasn't displayed...

I'm happy to go with your suggestion if you feel it's more helpful! My only slight nagging concern is that output: 'static' is a default that no one would set. And, it's def true by default default, even if they don't know what output: 'static' is. Like, this is really the default. And I do think there's value in it being presented that way.

Yeah, I understand your concern and honestly I don't have a perfect solution. Considering the way the content is presented, I would say it is fine the way it is. But then I think that some people read the doc too quickly and they risk stopping at the word in bold (Default:) without reading the rest and that could cause confusion.

So I thought I'd just mention it just in case. Now, especially since we're not sure what's best, I also agree to leave it as is, and if it's a problem, we'll update later.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for the conversation! I'm leaning towards leaving it like this and then waiting to see whether it causes confusion or more people mention it. It can always be changed!

I think part of why I have this opinion is the reason behind making the old hybrid behaviour the default is because too many people were simply enabling output: 'server' just to have ANY on-demand rendering features, even when they only needed it on one page. We're also trying to position the docs to nudge towards the behaviour of thinking of your site as prerendered, opting in per-route when you need it, and only when and if you realize you really need it, switching to server mode. I do think this framing helps that story as well!

@sarah11918
Copy link
Member Author

I think Chris meant across the whole page.

If you look at how the labels are implemented, it's not that simple! 😅 That's what I meant when I said it's not easy to get it sync'd all down the page. The tabs don't all share the same label because the tabs themselves are the Astro.x and context.x of the entry. So, there aren't duplicates!

label does double duty of syncing the tabs and it's what the visual tab label is: and I want the tabs visually to show the very specific occurrence of Astro. and context. the things. We would need to be able to designate a tab property as Astro or context while showing something different as the tab label. Right now, these are controlled by the same value.

@ArmandPhilippot
Copy link
Member

That's what I meant when I said it's not easy to get it sync'd all down the page.

Oh! So I was right to think that I might not have understood the end of your sentence... I hesitated to clarify it. 😅 Thanks for the explanation, now I understand!
If it is not possible to differentiate the label, in this case yes I doubt that it is doable... and indeed, apart from rewrite() I don't think there is another place. And since I still haven't touched Starlight 👀 I cannot comment on that!
It would have been an improvement, but without it I don't think it's really annoying.

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Looking good @sarah11918! I bow down to your indomitable spirit in taming the reference wilderness.

I do agree with @ArmandPhilippot re: the “default” field for prerender potentially being confusing given it varies depending on mode, but will leave it to your discretion whether you want to address that or are happy leaving it as is.

@sarah11918 sarah11918 merged commit 2afb32c into 5.0.0-beta Dec 2, 2024
10 checks passed
@sarah11918 sarah11918 deleted the runtime-api branch December 2, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0.0-beta i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! information architecture reorganizes content on the site
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants