diff options
author | 2023-11-27 23:47:51 +0800 | |
---|---|---|
committer | 2023-11-27 23:47:51 +0800 | |
commit | 88f40846d4c322be7d9131974d5a8e6a4b5d23c4 (patch) | |
tree | 3b325ccfbe3d8e850d639b5e3f4a1165a2276a16 | |
parent | a145ac07e75927e13af62e28d13bc8217a362b8e (diff) | |
parent | 2ef75fe752b4fbd63f98ca8ee294b135f6bec804 (diff) | |
download | astro-88f40846d4c322be7d9131974d5a8e6a4b5d23c4.tar.gz astro-88f40846d4c322be7d9131974d5a8e6a4b5d23c4.tar.zst astro-88f40846d4c322be7d9131974d5a8e6a4b5d23c4.zip |
Merge branch 'main' into next
33 files changed, 75 insertions, 65 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cea4f61e2..05a07e125 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,8 +2,7 @@ We welcome contributions of any size and skill level. As an open source project, we believe in giving back to our contributors and are happy to help with guidance on PRs, technical writing, and turning any feature idea into a reality. -> **Tip for new contributors:** -> Take a look at [https://github.com/firstcontributions/first-contributions](https://github.com/firstcontributions/first-contributions) for helpful information on contributing +> [!Tip] > **For new contributors:** Take a look at [https://github.com/firstcontributions/first-contributions](https://github.com/firstcontributions/first-contributions) for helpful information on contributing ## Quick Guide @@ -46,7 +45,8 @@ To get started, create a codespace for this repository by clicking this 👇 Your new codespace will open in a web-based version of Visual Studio Code. All development dependencies will be preinstalled, and the tests will run automatically ensuring you've got a green base from which to start working. -**Note**: Dev containers is now an open spec which is supported by [GitHub Codespaces](https://github.com/codespaces) and [other supporting tools](https://containers.dev/supporting). +> [!Note] +> Dev containers is now an open spec which is supported by [GitHub Codespaces](https://github.com/codespaces) and [other supporting tools](https://containers.dev/supporting). ### Development @@ -187,7 +187,7 @@ Understanding in which environment code runs, and at which stage in the process, Active Astro development happens on the [`main`](https://github.com/withastro/astro/tree/main) branch. `main` always reflects the latest code. -> **Note:** +> [!Note] > During certain periods, we put `main` into a [**prerelease**](https://github.com/changesets/changesets/blob/main/docs/prereleases.md#prereleases) state. Read more about [Releasing Astro](#releasing-astro). ### `latest` @@ -198,7 +198,8 @@ By default, `create-astro` and [astro.new](https://astro.new) point to this bran ## Releasing Astro -_Note: Only [core maintainers (L3+)](https://github.com/withastro/.github/blob/main/GOVERNANCE.md#level-3-l3---core) can release new versions of Astro._ +> [!Note] +> Only [core maintainers (L3+)](https://github.com/withastro/.github/blob/main/GOVERNANCE.md#level-3-l3---core) can release new versions of Astro. The repo is set up with automatic releases, using the changeset GitHub action & bot. diff --git a/examples/basics/package.json b/examples/basics/package.json index df75ae3d1..6266329c8 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.6.0" + "astro": "^3.6.1" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index f52fb2940..4525c6707 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -14,6 +14,6 @@ "@astrojs/mdx": "^1.1.5", "@astrojs/rss": "^3.0.0", "@astrojs/sitemap": "^3.0.3", - "astro": "^3.6.0" + "astro": "^3.6.1" } } diff --git a/examples/component/package.json b/examples/component/package.json index b91bdea71..0bbbf990b 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^3.6.0" + "astro": "^3.6.1" }, "peerDependencies": { "astro": "^3.0.0" diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index be3bdaf24..32e2847ac 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -14,6 +14,6 @@ "@astrojs/alpinejs": "^0.3.1", "@types/alpinejs": "^3.13.5", "alpinejs": "^3.13.3", - "astro": "^3.6.0" + "astro": "^3.6.1" } } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index 91f9cfaa8..2dce29b26 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/lit": "^3.0.3", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^3.6.0", + "astro": "^3.6.1", "lit": "^2.8.0" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index b2cd71afc..76c001d53 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -16,7 +16,7 @@ "@astrojs/solid-js": "^3.0.2", "@astrojs/svelte": "^4.0.4", "@astrojs/vue": "^3.0.4", - "astro": "^3.6.0", + "astro": "^3.6.1", "preact": "^10.19.2", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index dfe5d6ee1..25b6db60e 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.0.1", "@preact/signals": "^1.2.1", - "astro": "^3.6.0", + "astro": "^3.6.1", "preact": "^10.19.2" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index 1c4bbdb4f..06b31e35a 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -14,7 +14,7 @@ "@astrojs/react": "^3.0.6", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", - "astro": "^3.6.0", + "astro": "^3.6.1", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index 94fae75ad..c196f354f 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/solid-js": "^3.0.2", - "astro": "^3.6.0", + "astro": "^3.6.1", "solid-js": "^1.8.5" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 3f1a0b61c..c5283a49d 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/svelte": "^4.0.4", - "astro": "^3.6.0", + "astro": "^3.6.1", "svelte": "^4.2.5" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index 6ac6c2b6c..69642784e 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/vue": "^3.0.4", - "astro": "^3.6.0", + "astro": "^3.6.1", "vue": "^3.3.8" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index 527678f4b..ac3b7796c 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/node": "^6.0.4", - "astro": "^3.6.0" + "astro": "^3.6.1" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index 463e0dfa6..7c6428076 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^3.6.0" + "astro": "^3.6.1" }, "peerDependencies": { "astro": "^3.0.0" diff --git a/examples/middleware/package.json b/examples/middleware/package.json index efa7572e1..d87656e98 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@astrojs/node": "^6.0.4", - "astro": "^3.6.0", + "astro": "^3.6.1", "html-minifier": "^4.0.0" } } diff --git a/examples/minimal/package.json b/examples/minimal/package.json index c2cd8766b..3343b8be2 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.6.0" + "astro": "^3.6.1" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index 80da364de..3eab4227b 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.6.0" + "astro": "^3.6.1" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index 427e47fd4..750de6f3f 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.6.0" + "astro": "^3.6.1" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index 80b315e62..19caa45b9 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -14,7 +14,7 @@ "dependencies": { "@astrojs/node": "^6.0.4", "@astrojs/svelte": "^4.0.4", - "astro": "^3.6.0", + "astro": "^3.6.1", "svelte": "^4.2.5" } } diff --git a/examples/view-transitions/package.json b/examples/view-transitions/package.json index 03790360e..6d98e9e79 100644 --- a/examples/view-transitions/package.json +++ b/examples/view-transitions/package.json @@ -12,6 +12,6 @@ "devDependencies": { "@astrojs/tailwind": "^5.0.2", "@astrojs/node": "^6.0.4", - "astro": "^3.6.0" + "astro": "^3.6.1" } } diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index 1ff0c3e23..a30398b31 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/markdoc": "^0.7.2", - "astro": "^3.6.0" + "astro": "^3.6.1" } } diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index 0efdc3381..446e0178f 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/markdown-remark": "^3.5.0", - "astro": "^3.6.0", + "astro": "^3.6.1", "hast-util-select": "^6.0.2", "rehype-autolink-headings": "^7.1.0", "rehype-slug": "^6.0.0", diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json index f69cbf555..e83c920b9 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.6.0" + "astro": "^3.6.1" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index edcdd454f..0acba9f1b 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/mdx": "^1.1.5", "@astrojs/preact": "^3.0.1", - "astro": "^3.6.0", + "astro": "^3.6.1", "preact": "^10.19.2" } } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index 7c00f6e3a..54846a3b5 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.0.1", "@nanostores/preact": "^0.5.0", - "astro": "^3.6.0", + "astro": "^3.6.1", "nanostores": "^0.9.5", "preact": "^10.19.2" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index aa4d421b3..dadd6a865 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -14,7 +14,7 @@ "@astrojs/mdx": "^1.1.5", "@astrojs/tailwind": "^5.0.2", "@types/canvas-confetti": "^1.6.3", - "astro": "^3.6.0", + "astro": "^3.6.1", "autoprefixer": "^10.4.15", "canvas-confetti": "^1.9.1", "postcss": "^8.4.28", diff --git a/examples/with-vite-plugin-pwa/package.json b/examples/with-vite-plugin-pwa/package.json index 70b172ed5..6146bfb69 100644 --- a/examples/with-vite-plugin-pwa/package.json +++ b/examples/with-vite-plugin-pwa/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.6.0", + "astro": "^3.6.1", "vite-plugin-pwa": "0.17.0", "workbox-window": "^7.0.0" } diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index 277d7eb94..7b11a1fd3 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^3.6.0", + "astro": "^3.6.1", "vitest": "^0.34.2" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 1e6a1769a..08eb25405 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,13 @@ # astro +## 3.6.1 + +### Patch Changes + +- [#9173](https://github.com/withastro/astro/pull/9173) [`04fdc1c61`](https://github.com/withastro/astro/commit/04fdc1c613171409ed1a2bd887326e26cdb8b5ef) Thanks [@lilnasy](https://github.com/lilnasy)! - Fixes an issue where having a middleware prevented the SSR app from being deployed on Netlify. + +- [#9186](https://github.com/withastro/astro/pull/9186) [`607542c7c`](https://github.com/withastro/astro/commit/607542c7cf9fe9813c06f1d96615d6c793262d22) Thanks [@martrapp](https://github.com/martrapp)! - Fixes a view transition issue on webKit browsers that prevented scrolling to #fragments + ## 3.6.0 ### Minor Changes @@ -9,9 +17,9 @@ Three new events now complement the existing `astro:after-swap` and `astro:page-load` events: ```javascript - astro: before - preparation; // Control how the DOM and other resources of the target page are loaded - astro: after - preparation; // Last changes before taking off? Remove that loading indicator? Here you go! - astro: before - swap; // Control how the DOM is updated to match the new page + 'astro:before-preparation'; // Control how the DOM and other resources of the target page are loaded + 'astro:after-preparation'; // Last changes before taking off? Remove that loading indicator? Here you go! + 'astro:before-swap'; // Control how the DOM is updated to match the new page ``` The `astro:before-*` events allow you to change properties and strategies of the view transition implementation. diff --git a/packages/astro/package.json b/packages/astro/package.json index a12c58c98..87558862d 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "3.6.0", + "version": "3.6.1", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "type": "module", "author": "withastro", diff --git a/packages/astro/src/core/middleware/vite-plugin.ts b/packages/astro/src/core/middleware/vite-plugin.ts index 044713491..918c7c952 100644 --- a/packages/astro/src/core/middleware/vite-plugin.ts +++ b/packages/astro/src/core/middleware/vite-plugin.ts @@ -7,7 +7,7 @@ import type { BuildInternals } from '../build/internal.js'; import type { StaticBuildOptions } from '../build/types.js'; import { MIDDLEWARE_PATH_SEGMENT_NAME } from '../constants.js'; -export const MIDDLEWARE_MODULE_ID = '@astro-middleware'; +export const MIDDLEWARE_MODULE_ID = '\0astro-internal:middleware'; const EMPTY_MIDDLEWARE = '\0empty-middleware'; export function vitePluginMiddleware({ settings }: { settings: AstroSettings }): VitePlugin { diff --git a/packages/astro/src/transitions/router.ts b/packages/astro/src/transitions/router.ts index a97abfcf7..6ff0efc01 100644 --- a/packages/astro/src/transitions/router.ts +++ b/packages/astro/src/transitions/router.ts @@ -194,7 +194,6 @@ const moveToLocation = (to: URL, from: URL, options: Options, historyState?: Sta to.href ); } - history.scrollRestoration = 'manual'; } // now we are on the new page for non-history navigations! // (with history navigation page change happens before popstate is fired) @@ -213,12 +212,14 @@ const moveToLocation = (to: URL, from: URL, options: Options, historyState?: Sta // because we are already on the target page ... // ... what comes next is a intra-page navigation // that won't reload the page but instead scroll to the fragment + history.scrollRestoration = 'auto'; location.href = to.href; } else { if (!scrolledToTop) { scrollTo({ left: 0, top: 0, behavior: 'instant' }); } } + history.scrollRestoration = 'manual'; } }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8321619a2..e6e9fbd2c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -125,7 +125,7 @@ importers: examples/basics: dependencies: astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/blog: @@ -140,13 +140,13 @@ importers: specifier: ^3.0.3 version: link:../../packages/integrations/sitemap astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/component: devDependencies: astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/framework-alpine: @@ -161,7 +161,7 @@ importers: specifier: ^3.13.3 version: 3.13.3 astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/framework-lit: @@ -173,7 +173,7 @@ importers: specifier: ^0.2.1 version: 0.2.1 astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro lit: specifier: ^2.8.0 @@ -197,7 +197,7 @@ importers: specifier: ^3.0.4 version: link:../../packages/integrations/vue astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -227,7 +227,7 @@ importers: specifier: ^1.2.1 version: 1.2.1(preact@10.19.2) astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -245,7 +245,7 @@ importers: specifier: ^18.2.15 version: 18.2.15 astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro react: specifier: ^18.2.0 @@ -260,7 +260,7 @@ importers: specifier: ^3.0.2 version: link:../../packages/integrations/solid astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro solid-js: specifier: ^1.8.5 @@ -272,7 +272,7 @@ importers: specifier: ^4.0.4 version: link:../../packages/integrations/svelte astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro svelte: specifier: ^4.2.5 @@ -284,7 +284,7 @@ importers: specifier: ^3.0.4 version: link:../../packages/integrations/vue astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro vue: specifier: ^3.3.8 @@ -296,13 +296,13 @@ importers: specifier: ^6.0.4 version: link:../../packages/integrations/node astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/integration: devDependencies: astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/middleware: @@ -311,7 +311,7 @@ importers: specifier: ^6.0.4 version: link:../../packages/integrations/node astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro html-minifier: specifier: ^4.0.0 @@ -320,19 +320,19 @@ importers: examples/minimal: dependencies: astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/non-html-pages: dependencies: astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/portfolio: dependencies: astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/ssr: @@ -344,7 +344,7 @@ importers: specifier: ^4.0.4 version: link:../../packages/integrations/svelte astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro svelte: specifier: ^4.2.5 @@ -359,7 +359,7 @@ importers: specifier: ^5.0.2 version: link:../../packages/integrations/tailwind astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/with-markdoc: @@ -368,7 +368,7 @@ importers: specifier: ^0.7.2 version: link:../../packages/integrations/markdoc astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/with-markdown-plugins: @@ -377,7 +377,7 @@ importers: specifier: ^3.5.0 version: link:../../packages/markdown/remark astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro hast-util-select: specifier: ^6.0.2 @@ -398,7 +398,7 @@ importers: examples/with-markdown-shiki: dependencies: astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro examples/with-mdx: @@ -410,7 +410,7 @@ importers: specifier: ^3.0.1 version: link:../../packages/integrations/preact astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -425,7 +425,7 @@ importers: specifier: ^0.5.0 version: 0.5.0(nanostores@0.9.5)(preact@10.19.2) astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro nanostores: specifier: ^0.9.5 @@ -446,7 +446,7 @@ importers: specifier: ^1.6.3 version: 1.6.3 astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro autoprefixer: specifier: ^10.4.15 @@ -464,7 +464,7 @@ importers: examples/with-vite-plugin-pwa: dependencies: astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro vite-plugin-pwa: specifier: 0.17.0 @@ -476,7 +476,7 @@ importers: examples/with-vitest: dependencies: astro: - specifier: ^3.6.0 + specifier: ^3.6.1 version: link:../../packages/astro vitest: specifier: ^0.34.2 |