diff options
Diffstat (limited to '.changeset')
-rw-r--r-- | .changeset/brave-pots-listen.md | 5 | ||||
-rw-r--r-- | .changeset/dull-lizards-jog.md | 5 | ||||
-rw-r--r-- | .changeset/fair-singers-reflect.md | 30 | ||||
-rw-r--r-- | .changeset/gold-mayflies-beam.md | 36 | ||||
-rw-r--r-- | .changeset/nervous-pens-retire.md | 7 | ||||
-rw-r--r-- | .changeset/poor-berries-occur.md | 70 | ||||
-rw-r--r-- | .changeset/sweet-trainers-eat.md | 5 | ||||
-rw-r--r-- | .changeset/swift-phones-rhyme.md | 5 | ||||
-rw-r--r-- | .changeset/tidy-days-decide.md | 5 |
9 files changed, 0 insertions, 168 deletions
diff --git a/.changeset/brave-pots-listen.md b/.changeset/brave-pots-listen.md deleted file mode 100644 index bc6d58963..000000000 --- a/.changeset/brave-pots-listen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"astro": patch ---- - -Improves DX by throwing the original `AstroUserError` when an error is thrown inside a `.mdx` file. diff --git a/.changeset/dull-lizards-jog.md b/.changeset/dull-lizards-jog.md deleted file mode 100644 index 9f5d7bdb2..000000000 --- a/.changeset/dull-lizards-jog.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"astro": patch ---- - -Errors that are emitted during a rewrite are now bubbled up and shown to the user. A 404 response is not returned anymore. diff --git a/.changeset/fair-singers-reflect.md b/.changeset/fair-singers-reflect.md deleted file mode 100644 index e18ec42f9..000000000 --- a/.changeset/fair-singers-reflect.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -"@astrojs/preact": minor -"@astrojs/svelte": minor -"@astrojs/react": minor -"@astrojs/solid-js": minor -"@astrojs/lit": minor -"@astrojs/mdx": minor -"@astrojs/vue": minor -"astro": patch ---- - -The integration now exposes a function called `getContainerRenderer`, that can be used inside the Container APIs to load the relative renderer. - -```js -import { experimental_AstroContainer as AstroContainer } from 'astro/container'; -import ReactWrapper from '../src/components/ReactWrapper.astro'; -import { loadRenderers } from "astro:container"; -import { getContainerRenderer } from "@astrojs/react"; - -test('ReactWrapper with react renderer', async () => { - const renderers = await loadRenderers([getContainerRenderer()]) - const container = await AstroContainer.create({ - renderers, - }); - const result = await container.renderToString(ReactWrapper); - - expect(result).toContain('Counter'); - expect(result).toContain('Count: <!-- -->5'); -}); -``` diff --git a/.changeset/gold-mayflies-beam.md b/.changeset/gold-mayflies-beam.md deleted file mode 100644 index d500b30b4..000000000 --- a/.changeset/gold-mayflies-beam.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -"astro": patch ---- - -**BREAKING CHANGE to the experimental Container API only** - -Changes the **type** of the `renderers` option of the `AstroContainer::create` function and adds a dedicated function `loadRenderers()` to load the rendering scripts from renderer integration packages (`@astrojs/react`, `@astrojs/preact`, `@astrojs/solid-js`, `@astrojs/svelte`, `@astrojs/vue`, `@astrojs/lit`, and `@astrojs/mdx`). - -You no longer need to know the individual, direct file paths to the client and server rendering scripts for each renderer integration package. Now, there is a dedicated function to load the renderer from each package, which is available from `getContainerRenderer()`: - -```diff -import { experimental_AstroContainer as AstroContainer } from 'astro/container'; -import ReactWrapper from '../src/components/ReactWrapper.astro'; -import { loadRenderers } from "astro:container"; -import { getContainerRenderer } from "@astrojs/react"; - -test('ReactWrapper with react renderer', async () => { -+ const renderers = await loadRenderers([getContainerRenderer()]) -- const renderers = [ -- { -- name: '@astrojs/react', -- clientEntrypoint: '@astrojs/react/client.js', -- serverEntrypoint: '@astrojs/react/server.js', -- }, -- ]; - const container = await AstroContainer.create({ - renderers, - }); - const result = await container.renderToString(ReactWrapper); - - expect(result).toContain('Counter'); - expect(result).toContain('Count: <!-- -->5'); -}); -``` - -The new `loadRenderers()` helper function is available from `astro:container`, a virtual module that can be used when running the Astro container inside `vite`. diff --git a/.changeset/nervous-pens-retire.md b/.changeset/nervous-pens-retire.md deleted file mode 100644 index 7815d37ad..000000000 --- a/.changeset/nervous-pens-retire.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"astro": patch ---- - -It's not possible anymore to use `Astro.rewrite("/404")` inside static pages. This isn't counterproductive because Astro will end-up emitting a page that contains the HTML of 404 error page. - -It's still possible to use `Astro.rewrite("/404")` inside on-demand pages, or pages that opt-out from prerendering. diff --git a/.changeset/poor-berries-occur.md b/.changeset/poor-berries-occur.md deleted file mode 100644 index 49b3c75ec..000000000 --- a/.changeset/poor-berries-occur.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -"astro": minor ---- - -Adds experimental support for the `astro:env` API. - -The `astro:env` API lets you configure a type-safe schema for your environment variables, and indicate whether they should be available on the server or the client. Import and use your defined variables from the appropriate `/client` or `/server` module: - -```astro ---- -import { PUBLIC_APP_ID } from "astro:env/client" -import { PUBLIC_API_URL, getSecret } from "astro:env/server" -const API_TOKEN = getSecret("API_TOKEN") - -const data = await fetch(`${PUBLIC_API_URL}/users`, { - method: "POST", - headers: { - "Content-Type": "application/json", - "Authorization": `Bearer ${API_TOKEN}` - }, - body: JSON.stringify({ appId: PUBLIC_APP_ID }) -}) ---- -``` - -To define the data type and properties of your environment variables, declare a schema in your Astro config in `experimental.env.schema`. The `envField` helper allows you define your variable as a string, number, or boolean and pass properties in an object: - -```js -// astro.config.mjs -import { defineConfig, envField } from "astro/config" - -export default defineConfig({ - experimental: { - env: { - schema: { - PUBLIC_API_URL: envField.string({ context: "client", access: "public", optional: true }), - PUBLIC_PORT: envField.number({ context: "server", access: "public", default: 4321 }), - API_SECRET: envField.string({ context: "server", access: "secret" }), - } - } - } -}) -``` - -There are three kinds of environment variables, determined by the combination of `context` (`client` or `server`) and `access` (`private` or `public`) settings defined in your [`env.schema`](#experimentalenvschema): - -- **Public client variables**: These variables end up in both your final client and server bundles, and can be accessed from both client and server through the `astro:env/client` module: - - ```js - import { PUBLIC_API_URL } from "astro:env/client" - ``` - -- **Public server variables**: These variables end up in your final server bundle and can be accessed on the server through the `astro:env/server` module: - - ```js - import { PUBLIC_PORT } from "astro:env/server" - ``` - -- **Secret server variables**: These variables are not part of your final bundle and can be accessed on the server through the `getSecret()` helper function available from the `astro:env/server` module: - - ```js - import { getSecret } from "astro:env/server" - - const API_SECRET = getSecret("API_SECRET") // typed - const SECRET_NOT_IN_SCHEMA = getSecret("SECRET_NOT_IN_SCHEMA") // string | undefined - ``` - -**Note:** Secret client variables are not supported because there is no safe way to send this data to the client. Therefore, it is not possible to configure both `context: "client"` and `access: "secret"` in your schema. - -To learn more, check out [the documentation](https://docs.astro.build/en/reference/configuration-reference/#experimentalenv).
\ No newline at end of file diff --git a/.changeset/sweet-trainers-eat.md b/.changeset/sweet-trainers-eat.md deleted file mode 100644 index 7a094fc48..000000000 --- a/.changeset/sweet-trainers-eat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"astro": patch ---- - -Fixes a case where `Astro.url` would be incorrect when having `build.format` set to `'preserve'` in the Astro config diff --git a/.changeset/swift-phones-rhyme.md b/.changeset/swift-phones-rhyme.md deleted file mode 100644 index 3675fac14..000000000 --- a/.changeset/swift-phones-rhyme.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes an issue where `Astro.rewrite` wasn't carrying over the body of a `Request` in on-demand pages. diff --git a/.changeset/tidy-days-decide.md b/.changeset/tidy-days-decide.md deleted file mode 100644 index 53398e057..000000000 --- a/.changeset/tidy-days-decide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes an issue where the function `getViteConfig` wasn't returning the correct merged Astro configuration |