Skip to content

Commit

Permalink
Merge branch 'next' into remove-unused-deps-next
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Aug 26, 2024
2 parents e809c1b + 5966acc commit 0bccac7
Show file tree
Hide file tree
Showing 146 changed files with 783 additions and 13,570 deletions.
9 changes: 9 additions & 0 deletions .changeset/blue-boats-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'astro': major
---

Unflag globalRoutePriority

The previously experimental feature `globalRoutePriority` is now the default in Astro 5.

This was a refactoring of route prioritization in Astro, making it so that injected routes, file-based routes, and redirects are all prioritized using the same logic. This feature has been enabled for all Starlight projects since it was added and should not affect most users.
48 changes: 48 additions & 0 deletions .changeset/eighty-boxes-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
'astro': major
---

The `astro:env` feature introduced behind a flag in [v4.10.0](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md#x4100) is no longer experimental and is available for general use. If you have been waiting for stabilization before using `astro:env`, you can now do so.

This feature lets you configure a type-safe schema for your environment variables, and indicate whether they should be available on the server or the client.

To configure a schema, add the `env` option to your Astro config and define your client and server variables. If you were previously using this feature, please remove the experimental flag from your Astro config and move your entire `env` configuration unchanged to a top-level option.

```js
import { defineConfig, envField } from 'astro/config'

export default defineConfig({
env: {
schema: {
API_URL: envField.string({ context: "client", access: "public", optional: true }),
PORT: envField.number({ context: "server", access: "public", default: 4321 }),
API_SECRET: envField.string({ context: "server", access: "secret" }),
}
}
})
```

You can import and use your defined variables from the appropriate `/client` or `/server` module:

```astro
---
import { API_URL } from "astro:env/client"
import { API_SECRET_TOKEN } from "astro:env/server"
const data = await fetch(`${API_URL}/users`, {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_SECRET_TOKEN}`
},
})
---
<script>
import { API_URL } from "astro:env/client"
fetch(`${API_URL}/ping`)
</script>
```

Please see our [guide to using environment variables](https://docs.astro.build/en/guides/environment-variables/#astroenv) for more about this feature.
13 changes: 13 additions & 0 deletions .changeset/healthy-ads-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'astro': patch
---

Use GET requests with preloading for Server Islands

Server Island requests include the props used to render the island as well as any slots passed in (excluding the fallback slot). Since browsers have a max 4mb URL length we default to using a POST request to avoid overflowing this length.

However in reality most usage of Server Islands are fairly isolated and won't exceed this limit, so a GET request is possible by passing this same information via search parameters.

Using GET means we can also include a `<link rel="preload">` tag to speed up the request.

This change implements this, with safe fallback to POST.
17 changes: 17 additions & 0 deletions .changeset/itchy-toys-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'astro': major
---

Updates the default value of `security.checkOrigin` to `true`, which enables Cross-Site Request Forgery (CSRF) protection by default for pages rendered on demand.

If you had previously configured `security.checkOrigin: true`, you no longer need this set in your Astro config. This is now the default and it is safe to remove.

To disable this behavior and opt out of automatically checking that the “origin” header matches the URL sent by each request, you must explicitly set `security.checkOrigin: false`:

```diff
export default defineConfig({
+ security: {
+ checkOrigin: false
+ }
})
```
16 changes: 16 additions & 0 deletions .changeset/modern-bears-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'astro': major
---

Makes the `compiledContent` property of Markdown content an async function, this change should fix underlying issues where sometimes when using a custom image service and images inside Markdown, Node would exit suddenly without any error message.

```diff
---
import * as myPost from "../post.md";

- const content = myPost.compiledContent();
+ const content = await myPost.compiledContent();
---

<Fragment set:html={content} />
```
17 changes: 16 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,30 @@
"@astrojs/upgrade": "0.3.1"
},
"changesets": [
"blue-boats-relax",
"chatty-teachers-sit",
"eighty-boxes-applaud",
"fair-rats-fail",
"healthy-ads-scream",
"itchy-toys-march",
"long-months-burn",
"many-garlics-lick",
"mighty-trees-teach",
"modern-bears-deny",
"new-pillows-kick",
"odd-donuts-impress",
"perfect-fans-fly",
"poor-frogs-dream",
"quick-ads-exercise",
"selfish-impalas-grin",
"small-ties-sort",
"smart-comics-doubt",
"smooth-melons-cough",
"spicy-houses-fry",
"spotty-garlics-cheat",
"ten-students-repair",
"weak-dancers-beam"
"tiny-lamps-lick",
"weak-dancers-beam",
"weak-masks-do"
]
}
6 changes: 6 additions & 0 deletions .changeset/selfish-impalas-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@astrojs/vercel': major
'@astrojs/node': major
---

Adds stable support for `astro:env`
22 changes: 22 additions & 0 deletions .changeset/spotty-garlics-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@astrojs/vercel': major
'@astrojs/node': major
'astro': major
---

Removed support for the Squoosh image service. As the underlying library `libsquoosh` is no longer maintained, and the image service sees very little usage we have decided to remove it from Astro.

Our recommendation is to use the base Sharp image service, which is more powerful, faster, and more actively maintained.

```diff
- import { squooshImageService } from "astro/config";
import { defineConfig } from "astro/config";

export default defineConfig({
- image: {
- service: squooshImageService()
- }
});
```

If you are using this service, and cannot migrate to the base Sharp image service, a third-party extraction of the previous service is available here: https://github.com/Princesseuh/astro-image-service-squoosh
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.0.0-alpha.0"
"astro": "^5.0.0-alpha.1"
}
}
4 changes: 2 additions & 2 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^4.0.0-alpha.0",
"@astrojs/mdx": "^4.0.0-alpha.1",
"@astrojs/rss": "^4.0.7",
"@astrojs/sitemap": "^3.1.6",
"astro": "^5.0.0-alpha.0"
"astro": "^5.0.0-alpha.1"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^5.0.0-alpha.0"
"astro": "^5.0.0-alpha.1"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/container-with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "vitest run"
},
"dependencies": {
"astro": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.1",
"@astrojs/react": "^3.6.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@astrojs/alpinejs": "^0.4.0",
"@types/alpinejs": "^3.13.10",
"alpinejs": "^3.14.1",
"astro": "^5.0.0-alpha.0"
"astro": "^5.0.0-alpha.1"
}
}
2 changes: 1 addition & 1 deletion examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@astrojs/vue": "^5.0.0-alpha.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.1",
"preact": "^10.23.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/preact": "^3.5.1",
"@preact/signals": "^1.3.0",
"astro": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.1",
"preact": "^10.23.2"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@astrojs/react": "^3.6.2",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^4.4.1",
"astro": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.1",
"solid-js": "^1.8.21"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/svelte": "^6.0.0-alpha.0",
"astro": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.1",
"svelte": "^4.2.18"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/vue": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.1",
"vue": "^3.4.38"
}
}
4 changes: 2 additions & 2 deletions examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/node": "^9.0.0-alpha.0",
"astro": "^5.0.0-alpha.0"
"@astrojs/node": "^9.0.0-alpha.1",
"astro": "^5.0.0-alpha.1"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^5.0.0-alpha.0"
"astro": "^5.0.0-alpha.1"
},
"peerDependencies": {
"astro": "^4.0.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
"@astrojs/node": "^9.0.0-alpha.0",
"astro": "^5.0.0-alpha.0",
"@astrojs/node": "^9.0.0-alpha.1",
"astro": "^5.0.0-alpha.1",
"html-minifier": "^4.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.0.0-alpha.0"
"astro": "^5.0.0-alpha.1"
}
}
2 changes: 1 addition & 1 deletion examples/non-html-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.0.0-alpha.0"
"astro": "^5.0.0-alpha.1"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.0.0-alpha.0"
"astro": "^5.0.0-alpha.1"
}
}
4 changes: 2 additions & 2 deletions examples/server-islands/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"astro": "astro"
},
"devDependencies": {
"@astrojs/node": "^9.0.0-alpha.0",
"@astrojs/node": "^9.0.0-alpha.1",
"@astrojs/react": "^3.6.2",
"@astrojs/tailwind": "^6.0.0-alpha.0",
"@fortawesome/fontawesome-free": "^6.6.0",
"@tailwindcss/forms": "^0.5.7",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"astro": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.1",
"postcss": "^8.4.41",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"server": "node dist/server/entry.mjs"
},
"dependencies": {
"@astrojs/node": "^9.0.0-alpha.0",
"@astrojs/node": "^9.0.0-alpha.1",
"@astrojs/svelte": "^6.0.0-alpha.0",
"astro": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.1",
"svelte": "^4.2.18"
}
}
2 changes: 1 addition & 1 deletion examples/starlog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.1",
"sass": "^1.77.8",
"sharp": "^0.33.3"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/toolbar-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"./app": "./dist/app.js"
},
"devDependencies": {
"astro": "^5.0.0-alpha.0"
"astro": "^5.0.0-alpha.1"
}
}
4 changes: 2 additions & 2 deletions examples/view-transitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"devDependencies": {
"@astrojs/tailwind": "^6.0.0-alpha.0",
"@astrojs/node": "^9.0.0-alpha.0",
"astro": "^5.0.0-alpha.0"
"@astrojs/node": "^9.0.0-alpha.1",
"astro": "^5.0.0-alpha.1"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^1.0.0-alpha.0",
"astro": "^5.0.0-alpha.0"
"astro": "^5.0.0-alpha.1"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdown-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/markdown-remark": "^6.0.0-alpha.0",
"astro": "^5.0.0-alpha.0",
"astro": "^5.0.0-alpha.1",
"hast-util-select": "^6.0.2",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
Expand Down
Loading

0 comments on commit 0bccac7

Please sign in to comment.