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

fix(container): add caution #9582

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/content/docs/en/reference/container-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ For each official Astro integration, import and use the `getContainerRenderer()`

For renderer packages outside the `@astrojs` npm org, look in their documentation for `getContainerRenderer()` or a similar function provided.

When using `vite` (`vitest`, Astro integrations, etc.), the renderers are loaded with the function `loadRenderers()` from the virtual module `astro:container`. Outside `vite`, you'll have to load the renderers manually.
When using `vite` (`vitest`, Astro integrations, etc.), the renderers are loaded with the function `loadRenderers()` from the virtual module `astro:container`.

:::caution
Outside `vite` or for on-demand usage, you'll have to [load the renderers manually](#adding-a-renderer-manually).
:::
Comment on lines +73 to +75
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
:::caution
Outside `vite` or for on-demand usage, you'll have to [load the renderers manually](#adding-a-renderer-manually).
:::
Outside `vite` or for on-demand usage, you'll have to [load the renderers manually](#adding-a-renderer-manually).

Let's try without the big caution first, as this isn't like a security warning or anything, and see if just having it written explicitly here before the example is enough! If you still find people are struggling with this, then we can look at making it more visible!

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not really sure. Currently, we already have this phrase in production, and I still get users that use the container API incorrectly. :/


The following example provides the necessary object to render an Astro component that renders a React component and a Svelte component:

Expand Down
Loading