diff --git a/.changeset/heavy-countries-wonder.md b/.changeset/heavy-countries-wonder.md new file mode 100644 index 000000000..599f0d8bb --- /dev/null +++ b/.changeset/heavy-countries-wonder.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Add a type param to AstroGlobal to type params. This will eventually be used automatically by our tooling to provide typing and completions for `Astro.params` diff --git a/.changeset/many-impalas-sit.md b/.changeset/many-impalas-sit.md new file mode 100644 index 000000000..ad48de4f3 --- /dev/null +++ b/.changeset/many-impalas-sit.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix `image.service` requiring to be set manually when `image.domains` or `image.remotePatterns` was assigned a value diff --git a/.changeset/ninety-boats-brake.md b/.changeset/ninety-boats-brake.md new file mode 100644 index 000000000..30c13a820 --- /dev/null +++ b/.changeset/ninety-boats-brake.md @@ -0,0 +1,9 @@ +--- +'@astrojs/react': patch +'@astrojs/preact': patch +'@astrojs/vue': patch +'@astrojs/solid-js': patch +'@astrojs/svelte': patch +--- + +Automatically unmount islands when `astro:unmount` is fired diff --git a/.changeset/perfect-socks-hammer.md b/.changeset/perfect-socks-hammer.md new file mode 100644 index 000000000..baae63ffe --- /dev/null +++ b/.changeset/perfect-socks-hammer.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fire `astro:unmount` event when island is disconnected diff --git a/.changeset/pre.json b/.changeset/pre.json index dc80fe9f3..65f614f2a 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -34,6 +34,7 @@ "angry-dogs-shake", "big-tips-whisper", "brave-cheetahs-float", + "breezy-books-notice", "chatty-ways-hunt", "chilled-ducks-grin", "clever-bats-breathe", @@ -55,6 +56,7 @@ "grumpy-pens-melt", "grumpy-years-remember", "happy-penguins-hug", + "heavy-countries-wonder", "heavy-walls-arrive", "honest-houses-deny", "large-countries-share", @@ -62,15 +64,18 @@ "long-chefs-jump", "loud-candles-admire", "lovely-walls-call", + "many-impalas-sit", "many-pears-explode", "mighty-dancers-lay", "nasty-garlics-listen", "neat-mugs-end", "neat-owls-run", "neat-suns-search", + "ninety-boats-brake", "odd-books-live", "olive-moles-tan", "perfect-horses-tell", + "perfect-socks-hammer", "plenty-keys-add", "popular-carrots-sneeze", "proud-fans-type", @@ -89,8 +94,11 @@ "spicy-icons-live", "spicy-stingrays-cheer", "strange-peas-agree", + "strong-needles-accept", "strong-papayas-chew", + "swift-taxis-sing", "tame-files-glow", + "tame-knives-shake", "tasty-camels-speak", "tasty-dragons-smash", "thin-ants-repeat", diff --git a/.changeset/swift-taxis-sing.md b/.changeset/swift-taxis-sing.md new file mode 100644 index 000000000..9b8bdebb4 --- /dev/null +++ b/.changeset/swift-taxis-sing.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Prevent ViewTransition script from being added by mistake diff --git a/.changeset/tame-knives-shake.md b/.changeset/tame-knives-shake.md new file mode 100644 index 000000000..3801de2b3 --- /dev/null +++ b/.changeset/tame-knives-shake.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix video persistence regression diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f952f6c6b..7161a0d0f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,7 @@ on: branches: - main - "1-legacy" + - "2-legacy" - next defaults: diff --git a/examples/basics/package.json b/examples/basics/package.json index a84e518a4..f96ee7261 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index ed47d2987..93ad8f6c4 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -14,6 +14,6 @@ "@astrojs/mdx": "^1.0.0-rc.2", "@astrojs/rss": "^3.0.0-rc.2", "@astrojs/sitemap": "^3.0.0-rc.1", - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" } } diff --git a/examples/component/package.json b/examples/component/package.json index 04153af27..dfae4c53a 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" }, "peerDependencies": { "astro": "^2.0.0-beta.0" diff --git a/examples/deno/package.json b/examples/deno/package.json index 985033960..42d889388 100644 --- a/examples/deno/package.json +++ b/examples/deno/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" }, "devDependencies": { "@astrojs/deno": "^5.0.0-rc.2" diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index af6cf3a9a..99533a50a 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -14,6 +14,6 @@ "@astrojs/alpinejs": "^0.3.0-rc.1", "@types/alpinejs": "^3.7.2", "alpinejs": "^3.12.3", - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" } } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index bad47f0b2..bfddba6cb 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/lit": "^3.0.0-rc.1", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^3.0.0-rc.8", + "astro": "^3.0.0-rc.11", "lit": "^2.8.0" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index 33a5c46b6..36a8a7aab 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -11,12 +11,12 @@ "astro": "astro" }, "dependencies": { - "@astrojs/preact": "^3.0.0-rc.2", - "@astrojs/react": "^3.0.0-rc.5", - "@astrojs/solid-js": "^3.0.0-rc.3", - "@astrojs/svelte": "^4.0.0-rc.2", - "@astrojs/vue": "^3.0.0-rc.1", - "astro": "^3.0.0-rc.8", + "@astrojs/preact": "^3.0.0-rc.3", + "@astrojs/react": "^3.0.0-rc.6", + "@astrojs/solid-js": "^3.0.0-rc.4", + "@astrojs/svelte": "^4.0.0-rc.3", + "@astrojs/vue": "^3.0.0-rc.2", + "astro": "^3.0.0-rc.11", "preact": "^10.17.1", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index c219bf7cc..ae1a83097 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/preact": "^3.0.0-rc.2", + "@astrojs/preact": "^3.0.0-rc.3", "@preact/signals": "^1.2.1", - "astro": "^3.0.0-rc.8", + "astro": "^3.0.0-rc.11", "preact": "^10.17.1" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index fb5994100..7ff5b0f26 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -11,10 +11,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/react": "^3.0.0-rc.5", + "@astrojs/react": "^3.0.0-rc.6", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", - "astro": "^3.0.0-rc.8", + "astro": "^3.0.0-rc.11", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index ca9f62ee1..99ceafe52 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/solid-js": "^3.0.0-rc.3", - "astro": "^3.0.0-rc.8", + "@astrojs/solid-js": "^3.0.0-rc.4", + "astro": "^3.0.0-rc.11", "solid-js": "^1.7.11" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index d5fbfeaf0..728581947 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/svelte": "^4.0.0-rc.2", - "astro": "^3.0.0-rc.8", + "@astrojs/svelte": "^4.0.0-rc.3", + "astro": "^3.0.0-rc.11", "svelte": "^4.2.0" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index f9c898a0c..25d61e425 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/vue": "^3.0.0-rc.1", - "astro": "^3.0.0-rc.8", + "@astrojs/vue": "^3.0.0-rc.2", + "astro": "^3.0.0-rc.11", "vue": "^3.3.4" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index ff243bc21..222f73dc7 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/node": "^6.0.0-rc.1", - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index ede5da738..daa57c962 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" }, "peerDependencies": { "astro": "^2.0.0-beta.0" diff --git a/examples/middleware/package.json b/examples/middleware/package.json index 40fd9b7d0..ef91712aa 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@astrojs/node": "^6.0.0-rc.1", - "astro": "^3.0.0-rc.8", + "astro": "^3.0.0-rc.11", "html-minifier": "^4.0.0" } } diff --git a/examples/minimal/package.json b/examples/minimal/package.json index 9847530df..482848c3e 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index 60c8161f5..71d44eb61 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index fe4e920e6..ec947a408 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index f1323487f..93ac83021 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -13,8 +13,8 @@ }, "dependencies": { "@astrojs/node": "^6.0.0-rc.1", - "@astrojs/svelte": "^4.0.0-rc.2", - "astro": "^3.0.0-rc.8", + "@astrojs/svelte": "^4.0.0-rc.3", + "astro": "^3.0.0-rc.11", "svelte": "^4.2.0" } } diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index ec2f05f19..4eb616623 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/markdoc": "^0.5.0-rc.1", - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" } } diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index 9b5755a76..3410dc718 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/markdown-remark": "^3.0.0-rc.1", - "astro": "^3.0.0-rc.8", + "astro": "^3.0.0-rc.11", "hast-util-select": "^5.0.5", "rehype-autolink-headings": "^6.1.1", "rehype-slug": "^5.1.0", diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json index 0b8a2fdd9..fdc2d302e 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^3.0.0-rc.8" + "astro": "^3.0.0-rc.11" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index 1bd17a990..fe82cdbfb 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -12,8 +12,8 @@ }, "dependencies": { "@astrojs/mdx": "^1.0.0-rc.2", - "@astrojs/preact": "^3.0.0-rc.2", - "astro": "^3.0.0-rc.8", + "@astrojs/preact": "^3.0.0-rc.3", + "astro": "^3.0.0-rc.11", "preact": "^10.17.1" } } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index bb834f862..0ff05ec4f 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/preact": "^3.0.0-rc.2", + "@astrojs/preact": "^3.0.0-rc.3", "@nanostores/preact": "^0.5.0", - "astro": "^3.0.0-rc.8", + "astro": "^3.0.0-rc.11", "nanostores": "^0.9.3", "preact": "^10.17.1" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index 7060689ec..6ceab3626 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -14,7 +14,7 @@ "@astrojs/mdx": "^1.0.0-rc.2", "@astrojs/tailwind": "^5.0.0-rc.1", "@types/canvas-confetti": "^1.6.0", - "astro": "^3.0.0-rc.8", + "astro": "^3.0.0-rc.11", "autoprefixer": "^10.4.15", "canvas-confetti": "^1.6.0", "postcss": "^8.4.28", diff --git a/examples/with-vite-plugin-pwa/package.json b/examples/with-vite-plugin-pwa/package.json index d35f6d0ea..fe61b5f20 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.0.0-rc.8", + "astro": "^3.0.0-rc.11", "vite-plugin-pwa": "0.16.4", "workbox-window": "^7.0.0" } diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index e9bdc37fa..b0d1b2b87 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^3.0.0-rc.8", + "astro": "^3.0.0-rc.11", "vitest": "^0.34.2" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 31fc6ba53..d8811762b 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,34 @@ # astro +## 3.0.0-rc.11 + +### Patch Changes + +- [#8271](https://github.com/withastro/astro/pull/8271) [`16f09dfff`](https://github.com/withastro/astro/commit/16f09dfff7722fda99dd0412e3006a7a39c80829) Thanks [@matthewp](https://github.com/matthewp)! - Fix video persistence regression + +## 3.0.0-rc.10 + +### Patch Changes + +- [#8266](https://github.com/withastro/astro/pull/8266) [`8450379db`](https://github.com/withastro/astro/commit/8450379db854fb1eaa9f38f21d65db240bc616cd) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fix `image.service` requiring to be set manually when `image.domains` or `image.remotePatterns` was assigned a value + +- [#8270](https://github.com/withastro/astro/pull/8270) [`e7f872e91`](https://github.com/withastro/astro/commit/e7f872e91e852b901cf221a5151077dec64305bf) Thanks [@matthewp](https://github.com/matthewp)! - Prevent ViewTransition script from being added by mistake + +## 3.0.0-rc.9 + +### Patch Changes + +- [#8234](https://github.com/withastro/astro/pull/8234) [`0c7b42dc6`](https://github.com/withastro/astro/commit/0c7b42dc6780e687e416137539f55a3a427d1d10) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Update telemetry notice + +- [#8263](https://github.com/withastro/astro/pull/8263) [`9e021a91c`](https://github.com/withastro/astro/commit/9e021a91c57d10809f588dd47968fc0e7f8b4d5c) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Add a type param to AstroGlobal to type params. This will eventually be used automatically by our tooling to provide typing and completions for `Astro.params` + +- [#8264](https://github.com/withastro/astro/pull/8264) [`1f58a7a1b`](https://github.com/withastro/astro/commit/1f58a7a1bea6888868b689dac94801d554319b02) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Fire `astro:unmount` event when island is disconnected + +- [#8258](https://github.com/withastro/astro/pull/8258) [`1db4e92c1`](https://github.com/withastro/astro/commit/1db4e92c12ed73681217f5cefd39f2f47542f961) Thanks [@matthewp](https://github.com/matthewp)! - Allow fallback animations on html element + +- Updated dependencies [[`0c7b42dc6`](https://github.com/withastro/astro/commit/0c7b42dc6780e687e416137539f55a3a427d1d10)]: + - @astrojs/telemetry@3.0.0-rc.4 + ## 3.0.0-rc.8 ### Patch Changes diff --git a/packages/astro/components/ViewTransitions.astro b/packages/astro/components/ViewTransitions.astro index 33741d535..0800b0033 100644 --- a/packages/astro/components/ViewTransitions.astro +++ b/packages/astro/components/ViewTransitions.astro @@ -163,7 +163,7 @@ const { fallback = 'animate' } = Astro.props as Props; // Everything left in the new head is new, append it all. document.head.append(...doc.head.children); - // Move over persist stuff in the body + // Persist elements in the existing body const oldBody = document.body; document.body.replaceWith(doc.body); for (const el of oldBody.querySelectorAll(`[${PERSIST_ATTR}]`)) { diff --git a/packages/astro/components/index.ts b/packages/astro/components/index.ts index 6bd537087..864c7cc3b 100644 --- a/packages/astro/components/index.ts +++ b/packages/astro/components/index.ts @@ -1,3 +1,2 @@ export { default as Code } from './Code.astro'; export { default as Debug } from './Debug.astro'; -export { default as ViewTransitions } from './ViewTransitions.astro'; diff --git a/packages/astro/e2e/fixtures/view-transitions/src/pages/long-page.astro b/packages/astro/e2e/fixtures/view-transitions/src/pages/long-page.astro index 79193a331..8cd1d9de2 100644 --- a/packages/astro/e2e/fixtures/view-transitions/src/pages/long-page.astro +++ b/packages/astro/e2e/fixtures/view-transitions/src/pages/long-page.astro @@ -4,6 +4,7 @@ import Layout from '../components/Layout.astro';
go to 1
+
go further down
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Dictum varius duis at consectetur lorem donec massa sapien faucibus. Amet mauris commodo quis imperdiet massa. Sed pulvinar proin gravida hendrerit lectus a. Magna ac placerat vestibulum lectus. Blandit cursus risus at ultrices mi tempus. Luctus venenatis lectus magna fringilla urna porttitor. Auctor eu augue ut lectus arcu bibendum at varius vel. Tristique senectus et netus et. In fermentum et sollicitudin ac orci phasellus egestas tellus rutrum. Eget lorem dolor sed viverra ipsum nunc aliquet. Amet consectetur adipiscing elit ut aliquam purus. Accumsan lacus vel facilisis volutpat est velit egestas. Felis imperdiet proin fermentum leo vel. Ut tellus elementum sagittis vitae et leo duis ut diam. Nisl pretium fusce id velit. Lorem donec massa sapien faucibus et. Nibh sed pulvinar proin gravida hendrerit lectus a. In est ante in nibh mauris cursus mattis molestie. @@ -30,7 +31,7 @@ import Layout from '../components/Layout.astro'; Viverra aliquet eget sit amet. Dui vivamus arcu felis bibendum. Pharetra convallis posuere morbi leo urna molestie at elementum eu. Parturient montes nascetur ridiculus mus mauris vitae. Mus mauris vitae ultricies leo integer malesuada nunc vel. Consequat semper viverra nam libero. Amet venenatis urna cursus eget nunc scelerisque. Amet risus nullam eget felis eget nunc lobortis. Venenatis urna cursus eget nunc. Sagittis id consectetur purus ut faucibus pulvinar. Posuere sollicitudin aliquam ultrices sagittis orci a scelerisque purus semper.
go to 1
- +
go back up
Morbi tristique senectus et netus et. Neque aliquam vestibulum morbi blandit cursus risus. Pharetra pharetra massa massa ultricies mi quis. Sit amet aliquam id diam maecenas ultricies mi eget mauris. Ultrices mi tempus imperdiet nulla malesuada. At consectetur lorem donec massa sapien faucibus et molestie. Non sodales neque sodales ut etiam. Eget nunc lobortis mattis aliquam faucibus purus in massa tempor. Viverra suspendisse potenti nullam ac tortor vitae purus faucibus. Pellentesque eu tincidunt tortor aliquam nulla facilisi cras fermentum. Diam vulputate ut pharetra sit. Felis donec et odio pellentesque diam. Mollis aliquam ut porttitor leo. Vitae nunc sed velit dignissim sodales. Facilisis mauris sit amet massa vitae tortor condimentum lacinia quis. Aliquet enim tortor at auctor urna nunc id cursus. Bibendum at varius vel pharetra vel turpis nunc eget. Mattis molestie a iaculis at erat. Vel turpis nunc eget lorem dolor sed viverra ipsum nunc. Aliquam malesuada bibendum arcu vitae elementum curabitur vitae nunc sed. Nunc congue nisi vitae suscipit. Donec massa sapien faucibus et molestie ac. Nec feugiat nisl pretium fusce. At imperdiet dui accumsan sit amet nulla facilisi. Sed viverra tellus in hac. diff --git a/packages/astro/e2e/view-transitions.test.js b/packages/astro/e2e/view-transitions.test.js index 12fc63e48..11ff97e40 100644 --- a/packages/astro/e2e/view-transitions.test.js +++ b/packages/astro/e2e/view-transitions.test.js @@ -264,6 +264,28 @@ test.describe('View Transitions', () => { expect(oldScrollY).toEqual(newScrollY); }); + test('Fragment scroll position restored on back button', async ({ page, astro }) => { + // Go to the long page + await page.goto(astro.resolveUrl('/long-page')); + let locator = page.locator('#longpage'); + await expect(locator).toBeInViewport(); + + // Scroll down to middle fragment + await page.click('#click-scroll-down'); + locator = page.locator('#click-one-again'); + await expect(locator).toBeInViewport(); + + // Scroll up to top fragment + await page.click('#click-scroll-up'); + locator = page.locator('#longpage'); + await expect(locator).toBeInViewport(); + + // Back to middle of the page + await page.goBack(); + locator = page.locator('#click-one-again'); + await expect(locator).toBeInViewport(); + }); + test('Scroll position restored on forward button', async ({ page, astro }) => { // Go to page 1 await page.goto(astro.resolveUrl('/one')); @@ -290,6 +312,28 @@ test.describe('View Transitions', () => { expect(oldScrollY).toEqual(newScrollY); }); + test('Fragment scroll position restored on forward button', async ({ page, astro }) => { + // Go to the long page + await page.goto(astro.resolveUrl('/long-page')); + let locator = page.locator('#longpage'); + await expect(locator).toBeInViewport(); + + // Scroll down to middle fragment + await page.click('#click-scroll-down'); + locator = page.locator('#click-one-again'); + await expect(locator).toBeInViewport(); + + // Scroll back to top + await page.goBack(); + locator = page.locator('#longpage'); + await expect(locator).toBeInViewport(); + + // Forward to middle of page + await page.goForward(); + locator = page.locator('#click-one-again'); + await expect(locator).toBeInViewport(); + }); + test(' component forwards transitions to the ', async ({ page, astro }) => { // Go to page 1 await page.goto(astro.resolveUrl('/image-one')); @@ -402,7 +446,6 @@ test.describe('View Transitions', () => { }); test('Navigation also swaps the attributes of the document root', async ({ page, astro }) => { - page.on('console', (msg) => console.log(msg.text())); await page.goto(astro.resolveUrl('/some-attributes')); let p = page.locator('#heading'); await expect(p, 'should have content').toHaveText('Page with some attributes'); diff --git a/packages/astro/package.json b/packages/astro/package.json index 61788e4c5..5347ca0a4 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "3.0.0-rc.8", + "version": "3.0.0-rc.11", "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/@types/astro.ts b/packages/astro/src/@types/astro.ts index 86d7bc984..acf11f3b0 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -147,8 +147,9 @@ export interface CLIFlags { export interface AstroGlobal< Props extends Record = Record, Self = AstroComponentFactory, + Params extends Record = Record, > extends AstroGlobalPartial, - AstroSharedContext { + AstroSharedContext { /** * A full URL object of the request URL. * Equivalent to: `new URL(Astro.request.url)` @@ -174,7 +175,7 @@ export interface AstroGlobal< * * [Astro reference](https://docs.astro.build/en/reference/api-reference/#astroparams) */ - params: AstroSharedContext['params']; + params: AstroSharedContext['params']; /** List of props passed to this component * * A common way to get specific props is through [destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment), ex: @@ -184,7 +185,7 @@ export interface AstroGlobal< * * [Astro reference](https://docs.astro.build/en/core-concepts/astro-components/#component-props) */ - props: AstroSharedContext['props']; + props: AstroSharedContext['props']; /** Information about the current request. This is a standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object * * For example, to get a URL object of the current URL, you can use: @@ -622,7 +623,7 @@ export interface AstroUserConfig { * * Using `'class'` is helpful when you want to ensure that element selectors within an Astro component override global style defaults (e.g. from a global stylesheet). * Using `'where'` gives you more control over specifity, but requires that you use higher-specifity selectors, layers, and other tools to control which selectors are applied. - * Using 'attribute' is useful when you are manipulating the `class` attribute of elements and need to avoid conflicts between your own styling logic and Astro's application of styles. + * Using `'attribute'` is useful when you are manipulating the `class` attribute of elements and need to avoid conflicts between your own styling logic and Astro's application of styles. */ scopedStyleStrategy?: 'where' | 'class' | 'attribute'; @@ -1807,7 +1808,10 @@ type Body = string; export type ValidRedirectStatus = 300 | 301 | 302 | 303 | 304 | 307 | 308; // Shared types between `Astro` global and API context object -interface AstroSharedContext = Record> { +interface AstroSharedContext< + Props extends Record = Record, + RouteParams extends Record = Record, +> { /** * The address (usually IP address) of the user. Used with SSR only. */ @@ -1827,7 +1831,7 @@ interface AstroSharedContext = Record = Record = Record> - extends AstroSharedContext { +export interface APIContext< + Props extends Record = Record, + APIParams extends Record = Record, +> extends AstroSharedContext { site: URL | undefined; generator: string; /** @@ -1876,7 +1882,7 @@ export interface APIContext = Record['params']; /** * List of props passed from `getStaticPaths`. Only available to static builds. * @@ -1899,7 +1905,7 @@ export interface APIContext = Record['props']; + props: AstroSharedContext['props']; /** * Redirect to another page. Only available in SSR builds. * diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts index 21d153143..46ed2a01f 100644 --- a/packages/astro/src/core/config/schema.ts +++ b/packages/astro/src/core/config/schema.ts @@ -29,6 +29,9 @@ const ASTRO_CONFIG_DEFAULTS = { split: false, excludeMiddleware: false, }, + image: { + service: { entrypoint: 'astro/assets/services/sharp', config: {} }, + }, compressHTML: true, server: { host: false, @@ -180,14 +183,18 @@ export const AstroConfigSchema = z.object({ .default(ASTRO_CONFIG_DEFAULTS.redirects), image: z .object({ - service: z.object({ - entrypoint: z.union([ - z.literal('astro/assets/services/sharp'), - z.literal('astro/assets/services/squoosh'), - z.string(), - ]), - config: z.record(z.any()).default({}), - }), + service: z + .object({ + entrypoint: z + .union([ + z.literal('astro/assets/services/sharp'), + z.literal('astro/assets/services/squoosh'), + z.string(), + ]) + .default(ASTRO_CONFIG_DEFAULTS.image.service.entrypoint), + config: z.record(z.any()).default({}), + }) + .default(ASTRO_CONFIG_DEFAULTS.image.service), domains: z.array(z.string()).default([]), remotePatterns: z .array( @@ -213,9 +220,7 @@ export const AstroConfigSchema = z.object({ ) .default([]), }) - .default({ - service: { entrypoint: 'astro/assets/services/sharp', config: {} }, - }), + .default(ASTRO_CONFIG_DEFAULTS.image), markdown: z .object({ drafts: z.boolean().default(false), diff --git a/packages/astro/src/runtime/server/astro-island.ts b/packages/astro/src/runtime/server/astro-island.ts index 7be630d06..710319aac 100644 --- a/packages/astro/src/runtime/server/astro-island.ts +++ b/packages/astro/src/runtime/server/astro-island.ts @@ -51,6 +51,10 @@ declare const Astro: { public Component: any; public hydrator: any; static observedAttributes = ['props']; + disconnectedCallback() { + document.removeEventListener('astro:after-swap', this.unmount); + document.addEventListener('astro:after-swap', this.unmount, { once: true }); + } connectedCallback() { if (!this.hasAttribute('await-children') || this.firstChild) { this.childrenConnectedCallback(); @@ -166,6 +170,10 @@ declare const Astro: { attributeChangedCallback() { this.hydrate(); } + unmount = () => { + // If element wasn't persisted, fire unmount event + if (!this.isConnected) this.dispatchEvent(new CustomEvent('astro:unmount')); + }; } ); } diff --git a/packages/astro/test/code-component.test.js b/packages/astro/test/code-component.test.js index c80107681..8481e95d8 100644 --- a/packages/astro/test/code-component.test.js +++ b/packages/astro/test/code-component.test.js @@ -23,4 +23,11 @@ describe('Code component', () => { let $ = cheerio.load(html); expect($('pre').attr('is:raw')).to.equal(undefined); }); + + // ViewTransitions bug + it('No script should be added to the page', async () => { + let html = await fixture.readFile('/index.html'); + let $ = cheerio.load(html); + expect($('script')).to.have.a.lengthOf(0); + }); }); diff --git a/packages/integrations/cloudflare/package.json b/packages/integrations/cloudflare/package.json index ff4afbf31..7828448d2 100644 --- a/packages/integrations/cloudflare/package.json +++ b/packages/integrations/cloudflare/package.json @@ -45,7 +45,7 @@ "tiny-glob": "^0.2.9" }, "peerDependencies": { - "astro": "workspace:^3.0.0-rc.8" + "astro": "workspace:^3.0.0-rc.11" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/deno/package.json b/packages/integrations/deno/package.json index 04bdd4c1c..bf61415f7 100644 --- a/packages/integrations/deno/package.json +++ b/packages/integrations/deno/package.json @@ -36,7 +36,7 @@ "esbuild": "^0.19.2" }, "peerDependencies": { - "astro": "workspace:^3.0.0-rc.8" + "astro": "workspace:^3.0.0-rc.11" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/markdoc/package.json b/packages/integrations/markdoc/package.json index e1a743b1d..1f25f7cc5 100644 --- a/packages/integrations/markdoc/package.json +++ b/packages/integrations/markdoc/package.json @@ -75,7 +75,7 @@ "zod": "3.21.1" }, "peerDependencies": { - "astro": "workspace:^3.0.0-rc.8" + "astro": "workspace:^3.0.0-rc.11" }, "devDependencies": { "@astrojs/markdown-remark": "workspace:*", diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index d6b10b8ac..4ce1c85c7 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -54,7 +54,7 @@ "vfile": "^5.3.7" }, "peerDependencies": { - "astro": "workspace:^3.0.0-rc.8" + "astro": "workspace:^3.0.0-rc.11" }, "devDependencies": { "@types/chai": "^4.3.5", diff --git a/packages/integrations/netlify/package.json b/packages/integrations/netlify/package.json index 94a5d6728..6c6bf49e1 100644 --- a/packages/integrations/netlify/package.json +++ b/packages/integrations/netlify/package.json @@ -43,7 +43,7 @@ "esbuild": "^0.19.2" }, "peerDependencies": { - "astro": "workspace:^3.0.0-rc.8" + "astro": "workspace:^3.0.0-rc.11" }, "devDependencies": { "@netlify/edge-functions": "^2.0.0", diff --git a/packages/integrations/node/package.json b/packages/integrations/node/package.json index 4b9c0e64c..fa4069ded 100644 --- a/packages/integrations/node/package.json +++ b/packages/integrations/node/package.json @@ -37,7 +37,7 @@ "server-destroy": "^1.0.1" }, "peerDependencies": { - "astro": "workspace:^3.0.0-rc.8" + "astro": "workspace:^3.0.0-rc.11" }, "devDependencies": { "@types/node": "^18.17.8", diff --git a/packages/integrations/preact/CHANGELOG.md b/packages/integrations/preact/CHANGELOG.md index f813b8666..449f2dc0c 100644 --- a/packages/integrations/preact/CHANGELOG.md +++ b/packages/integrations/preact/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/preact +## 3.0.0-rc.3 + +### Patch Changes + +- [#8264](https://github.com/withastro/astro/pull/8264) [`1f58a7a1b`](https://github.com/withastro/astro/commit/1f58a7a1bea6888868b689dac94801d554319b02) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Automatically unmount islands when `astro:unmount` is fired + ## 3.0.0-rc.2 ### Major Changes diff --git a/packages/integrations/preact/package.json b/packages/integrations/preact/package.json index bb9ea440f..7841a5326 100644 --- a/packages/integrations/preact/package.json +++ b/packages/integrations/preact/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/preact", "description": "Use Preact components within Astro", - "version": "3.0.0-rc.2", + "version": "3.0.0-rc.3", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/preact/src/client.ts b/packages/integrations/preact/src/client.ts index f90614398..b64431130 100644 --- a/packages/integrations/preact/src/client.ts +++ b/packages/integrations/preact/src/client.ts @@ -1,4 +1,4 @@ -import { h, render, type JSX } from 'preact'; +import { h, hydrate, render } from 'preact'; import StaticHtml from './static-html.js'; import type { SignalLike } from './types'; @@ -8,7 +8,8 @@ export default (element: HTMLElement) => async ( Component: any, props: Record, - { default: children, ...slotted }: Record + { default: children, ...slotted }: Record, + { client }: Record ) => { if (!element.hasAttribute('ssr')) return; for (const [key, value] of Object.entries(slotted)) { @@ -27,23 +28,13 @@ export default (element: HTMLElement) => } } - // eslint-disable-next-line @typescript-eslint/no-shadow - function Wrapper({ children }: { children: JSX.Element }) { - let attrs = Object.fromEntries( - Array.from(element.attributes).map((attr) => [attr.name, attr.value]) - ); - return h(element.localName, attrs, children); - } + const bootstrap = client !== 'only' ? hydrate : render; - let parent = element.parentNode as Element; - - render( - h( - Wrapper, - null, - h(Component, props, children != null ? h(StaticHtml, { value: children }) : children) - ), - parent, + bootstrap( + h(Component, props, children != null ? h(StaticHtml, { value: children }) : children), element ); + + // Preact has no "unmount" option, but you can use `render(null, element)` + element.addEventListener('astro:unmount', () => render(null, element), { once: true }); }; diff --git a/packages/integrations/react/CHANGELOG.md b/packages/integrations/react/CHANGELOG.md index d13699931..f0e3dcc46 100644 --- a/packages/integrations/react/CHANGELOG.md +++ b/packages/integrations/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/react +## 3.0.0-rc.6 + +### Patch Changes + +- [#8264](https://github.com/withastro/astro/pull/8264) [`1f58a7a1b`](https://github.com/withastro/astro/commit/1f58a7a1bea6888868b689dac94801d554319b02) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Automatically unmount islands when `astro:unmount` is fired + ## 3.0.0-rc.5 ### Patch Changes diff --git a/packages/integrations/react/client-v17.js b/packages/integrations/react/client-v17.js index 443109603..625dba6bf 100644 --- a/packages/integrations/react/client-v17.js +++ b/packages/integrations/react/client-v17.js @@ -1,5 +1,5 @@ import { createElement } from 'react'; -import { render, hydrate } from 'react-dom'; +import { render, hydrate, unmountComponentAtNode } from 'react-dom'; import StaticHtml from './static-html.js'; export default (element) => @@ -12,8 +12,11 @@ export default (element) => props, children != null ? createElement(StaticHtml, { value: children }) : children ); - if (client === 'only') { - return render(componentEl, element); - } - return hydrate(componentEl, element); + + const isHydrate = client !== 'only'; + const bootstrap = isHydrate ? hydrate : render; + bootstrap(componentEl, element); + element.addEventListener('astro:unmount', () => unmountComponentAtNode(element), { + once: true, + }); }; diff --git a/packages/integrations/react/client.js b/packages/integrations/react/client.js index d8948e7bb..dbd32c0c5 100644 --- a/packages/integrations/react/client.js +++ b/packages/integrations/react/client.js @@ -31,10 +31,14 @@ export default (element) => } if (client === 'only') { return startTransition(() => { - createRoot(element).render(componentEl); + const root = createRoot(element); + root.render(componentEl); + element.addEventListener('astro:unmount', () => root.unmount(), { once: true }); }); } - return startTransition(() => { - hydrateRoot(element, componentEl, renderOptions); + startTransition(() => { + const root = hydrateRoot(element, componentEl, renderOptions); + root.render(componentEl); + element.addEventListener('astro:unmount', () => root.unmount(), { once: true }); }); }; diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json index 35dd39d78..8eea984a8 100644 --- a/packages/integrations/react/package.json +++ b/packages/integrations/react/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/react", "description": "Use React components within Astro", - "version": "3.0.0-rc.5", + "version": "3.0.0-rc.6", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/solid/CHANGELOG.md b/packages/integrations/solid/CHANGELOG.md index af7a3547a..4230c9447 100644 --- a/packages/integrations/solid/CHANGELOG.md +++ b/packages/integrations/solid/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/solid-js +## 3.0.0-rc.4 + +### Patch Changes + +- [#8264](https://github.com/withastro/astro/pull/8264) [`1f58a7a1b`](https://github.com/withastro/astro/commit/1f58a7a1bea6888868b689dac94801d554319b02) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Automatically unmount islands when `astro:unmount` is fired + ## 3.0.0-rc.3 ### Major Changes diff --git a/packages/integrations/solid/package.json b/packages/integrations/solid/package.json index c5dac3b45..c813091cf 100644 --- a/packages/integrations/solid/package.json +++ b/packages/integrations/solid/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/solid-js", - "version": "3.0.0-rc.3", + "version": "3.0.0-rc.4", "description": "Use Solid components within Astro", "type": "module", "types": "./dist/index.d.ts", diff --git a/packages/integrations/solid/src/client.ts b/packages/integrations/solid/src/client.ts index 730db0f51..71a7db5e2 100644 --- a/packages/integrations/solid/src/client.ts +++ b/packages/integrations/solid/src/client.ts @@ -9,7 +9,7 @@ export default (element: HTMLElement) => } if (!element.hasAttribute('ssr')) return; - const fn = client === 'only' ? render : hydrate; + const boostrap = client === 'only' ? render : hydrate; let _slots: Record = {}; if (Object.keys(slotted).length > 0) { @@ -30,7 +30,7 @@ export default (element: HTMLElement) => const { default: children, ...slots } = _slots; const renderId = element.dataset.solidRenderId; - fn( + const dispose = boostrap( () => createComponent(Component, { ...props, @@ -42,4 +42,6 @@ export default (element: HTMLElement) => renderId, } ); + + element.addEventListener('astro:unmount', () => dispose(), { once: true }); }; diff --git a/packages/integrations/svelte/CHANGELOG.md b/packages/integrations/svelte/CHANGELOG.md index 4bb4ab434..220bafe32 100644 --- a/packages/integrations/svelte/CHANGELOG.md +++ b/packages/integrations/svelte/CHANGELOG.md @@ -1,5 +1,14 @@ # @astrojs/svelte +## 4.0.0-rc.3 + +### Patch Changes + +- [#8264](https://github.com/withastro/astro/pull/8264) [`1f58a7a1b`](https://github.com/withastro/astro/commit/1f58a7a1bea6888868b689dac94801d554319b02) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Automatically unmount islands when `astro:unmount` is fired + +- Updated dependencies [[`0c7b42dc6`](https://github.com/withastro/astro/commit/0c7b42dc6780e687e416137539f55a3a427d1d10), [`9e021a91c`](https://github.com/withastro/astro/commit/9e021a91c57d10809f588dd47968fc0e7f8b4d5c), [`1f58a7a1b`](https://github.com/withastro/astro/commit/1f58a7a1bea6888868b689dac94801d554319b02), [`1db4e92c1`](https://github.com/withastro/astro/commit/1db4e92c12ed73681217f5cefd39f2f47542f961)]: + - astro@3.0.0-rc.9 + ## 4.0.0-rc.2 ### Major Changes diff --git a/packages/integrations/svelte/client.js b/packages/integrations/svelte/client.js index 0d07ff2ba..73cc305c1 100644 --- a/packages/integrations/svelte/client.js +++ b/packages/integrations/svelte/client.js @@ -14,7 +14,7 @@ export default (target) => { try { if (import.meta.env.DEV) useConsoleFilter(); - new Component({ + const component = new Component({ target, props: { ...props, @@ -24,6 +24,8 @@ export default (target) => { hydrate: client !== 'only', $$inline: true, }); + + element.addEventListener('astro:unmount', () => component.$destroy(), { once: true }); } catch (e) { } finally { if (import.meta.env.DEV) finishUsingConsoleFilter(); diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index 82269986f..06b304b8b 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/svelte", - "version": "4.0.0-rc.2", + "version": "4.0.0-rc.3", "description": "Use Svelte components within Astro", "type": "module", "types": "./dist/index.d.ts", @@ -48,7 +48,7 @@ "vite": "^4.4.9" }, "peerDependencies": { - "astro": "workspace:^3.0.0-rc.8", + "astro": "workspace:^3.0.0-rc.11", "svelte": "^3.55.0 || ^4.0.0" }, "engines": { diff --git a/packages/integrations/tailwind/package.json b/packages/integrations/tailwind/package.json index 371fd51c6..aaf9ddcd6 100644 --- a/packages/integrations/tailwind/package.json +++ b/packages/integrations/tailwind/package.json @@ -43,7 +43,7 @@ "vite": "^4.4.9" }, "peerDependencies": { - "astro": "workspace:^3.0.0-rc.8", + "astro": "workspace:^3.0.0-rc.11", "tailwindcss": "^3.0.24" } } diff --git a/packages/integrations/vercel/package.json b/packages/integrations/vercel/package.json index 6de75d78d..872abc95e 100644 --- a/packages/integrations/vercel/package.json +++ b/packages/integrations/vercel/package.json @@ -60,7 +60,7 @@ "web-vitals": "^3.4.0" }, "peerDependencies": { - "astro": "workspace:^3.0.0-rc.8" + "astro": "workspace:^3.0.0-rc.11" }, "devDependencies": { "@types/set-cookie-parser": "^2.4.3", diff --git a/packages/integrations/vue/CHANGELOG.md b/packages/integrations/vue/CHANGELOG.md index 2c87b6d67..988ad2f11 100644 --- a/packages/integrations/vue/CHANGELOG.md +++ b/packages/integrations/vue/CHANGELOG.md @@ -1,5 +1,14 @@ # @astrojs/vue +## 3.0.0-rc.2 + +### Patch Changes + +- [#8264](https://github.com/withastro/astro/pull/8264) [`1f58a7a1b`](https://github.com/withastro/astro/commit/1f58a7a1bea6888868b689dac94801d554319b02) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Automatically unmount islands when `astro:unmount` is fired + +- Updated dependencies [[`0c7b42dc6`](https://github.com/withastro/astro/commit/0c7b42dc6780e687e416137539f55a3a427d1d10), [`9e021a91c`](https://github.com/withastro/astro/commit/9e021a91c57d10809f588dd47968fc0e7f8b4d5c), [`1f58a7a1b`](https://github.com/withastro/astro/commit/1f58a7a1bea6888868b689dac94801d554319b02), [`1db4e92c1`](https://github.com/withastro/astro/commit/1db4e92c12ed73681217f5cefd39f2f47542f961)]: + - astro@3.0.0-rc.9 + ## 3.0.0-rc.1 ### Major Changes diff --git a/packages/integrations/vue/client.js b/packages/integrations/vue/client.js index ca61116b2..8b2a5eede 100644 --- a/packages/integrations/vue/client.js +++ b/packages/integrations/vue/client.js @@ -21,15 +21,13 @@ export default (element) => content = h(Suspense, null, content); } - if (client === 'only') { - const app = createApp({ name, render: () => content }); - await setup(app); - app.mount(element, false); - } else { - const app = createSSRApp({ name, render: () => content }); - await setup(app); - app.mount(element, true); - } + const isHydrate = client !== 'only'; + const boostrap = isHydrate ? createSSRApp : createApp; + const app = boostrap({ name, render: () => content }); + await setup(app); + app.mount(element, isHydrate); + + element.addEventListener('astro:unmount', () => app.unmount(), { once: true }); }; function isAsync(fn) { diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json index 4edafd274..bd57a3b6d 100644 --- a/packages/integrations/vue/package.json +++ b/packages/integrations/vue/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/vue", - "version": "3.0.0-rc.1", + "version": "3.0.0-rc.2", "description": "Use Vue components within Astro", "type": "module", "types": "./dist/index.d.ts", @@ -56,7 +56,7 @@ "vue": "^3.3.4" }, "peerDependencies": { - "astro": "workspace:^3.0.0-rc.8", + "astro": "workspace:^3.0.0-rc.11", "vue": "^3.2.30" }, "engines": { diff --git a/packages/telemetry/CHANGELOG.md b/packages/telemetry/CHANGELOG.md index 5237b053b..8069cc6c2 100644 --- a/packages/telemetry/CHANGELOG.md +++ b/packages/telemetry/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/telemetry +## 3.0.0-rc.4 + +### Patch Changes + +- [#8234](https://github.com/withastro/astro/pull/8234) [`0c7b42dc6`](https://github.com/withastro/astro/commit/0c7b42dc6780e687e416137539f55a3a427d1d10) Thanks [@natemoo-re](https://github.com/natemoo-re)! - Update telemetry notice + ## 3.0.0-rc.3 ### Major Changes diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index 40eb01489..6af19ba3b 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/telemetry", - "version": "3.0.0-rc.3", + "version": "3.0.0-rc.4", "type": "module", "types": "./dist/types/index.d.ts", "author": "withastro", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c25dd31a7..933e6f26c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -125,7 +125,7 @@ importers: examples/basics: dependencies: astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro examples/blog: @@ -140,19 +140,19 @@ importers: specifier: ^3.0.0-rc.1 version: link:../../packages/integrations/sitemap astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro examples/component: devDependencies: astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro examples/deno: dependencies: astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro devDependencies: '@astrojs/deno': @@ -171,7 +171,7 @@ importers: specifier: ^3.12.3 version: 3.12.3 astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro examples/framework-lit: @@ -183,7 +183,7 @@ importers: specifier: ^0.2.1 version: 0.2.1 astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro lit: specifier: ^2.8.0 @@ -192,22 +192,22 @@ importers: examples/framework-multiple: dependencies: '@astrojs/preact': - specifier: ^3.0.0-rc.2 + specifier: ^3.0.0-rc.3 version: link:../../packages/integrations/preact '@astrojs/react': - specifier: ^3.0.0-rc.5 + specifier: ^3.0.0-rc.6 version: link:../../packages/integrations/react '@astrojs/solid-js': - specifier: ^3.0.0-rc.3 + specifier: ^3.0.0-rc.4 version: link:../../packages/integrations/solid '@astrojs/svelte': - specifier: ^4.0.0-rc.2 + specifier: ^4.0.0-rc.3 version: link:../../packages/integrations/svelte '@astrojs/vue': - specifier: ^3.0.0-rc.1 + specifier: ^3.0.0-rc.2 version: link:../../packages/integrations/vue astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro preact: specifier: ^10.17.1 @@ -231,13 +231,13 @@ importers: examples/framework-preact: dependencies: '@astrojs/preact': - specifier: ^3.0.0-rc.2 + specifier: ^3.0.0-rc.3 version: link:../../packages/integrations/preact '@preact/signals': specifier: ^1.2.1 version: 1.2.1(preact@10.17.1) astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro preact: specifier: ^10.17.1 @@ -246,7 +246,7 @@ importers: examples/framework-react: dependencies: '@astrojs/react': - specifier: ^3.0.0-rc.5 + specifier: ^3.0.0-rc.6 version: link:../../packages/integrations/react '@types/react': specifier: ^18.2.21 @@ -255,7 +255,7 @@ importers: specifier: ^18.2.7 version: 18.2.7 astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro react: specifier: ^18.2.0 @@ -267,10 +267,10 @@ importers: examples/framework-solid: dependencies: '@astrojs/solid-js': - specifier: ^3.0.0-rc.3 + specifier: ^3.0.0-rc.4 version: link:../../packages/integrations/solid astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro solid-js: specifier: ^1.7.11 @@ -279,10 +279,10 @@ importers: examples/framework-svelte: dependencies: '@astrojs/svelte': - specifier: ^4.0.0-rc.2 + specifier: ^4.0.0-rc.3 version: link:../../packages/integrations/svelte astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro svelte: specifier: ^4.2.0 @@ -291,10 +291,10 @@ importers: examples/framework-vue: dependencies: '@astrojs/vue': - specifier: ^3.0.0-rc.1 + specifier: ^3.0.0-rc.2 version: link:../../packages/integrations/vue astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro vue: specifier: ^3.3.4 @@ -306,13 +306,13 @@ importers: specifier: ^6.0.0-rc.1 version: link:../../packages/integrations/node astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro examples/integration: devDependencies: astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro examples/middleware: @@ -321,7 +321,7 @@ importers: specifier: ^6.0.0-rc.1 version: link:../../packages/integrations/node astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro html-minifier: specifier: ^4.0.0 @@ -330,19 +330,19 @@ importers: examples/minimal: dependencies: astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro examples/non-html-pages: dependencies: astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro examples/portfolio: dependencies: astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro examples/ssr: @@ -351,10 +351,10 @@ importers: specifier: ^6.0.0-rc.1 version: link:../../packages/integrations/node '@astrojs/svelte': - specifier: ^4.0.0-rc.2 + specifier: ^4.0.0-rc.3 version: link:../../packages/integrations/svelte astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro svelte: specifier: ^4.2.0 @@ -366,7 +366,7 @@ importers: specifier: ^0.5.0-rc.1 version: link:../../packages/integrations/markdoc astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro examples/with-markdown-plugins: @@ -375,7 +375,7 @@ importers: specifier: ^3.0.0-rc.1 version: link:../../packages/markdown/remark astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro hast-util-select: specifier: ^5.0.5 @@ -396,7 +396,7 @@ importers: examples/with-markdown-shiki: dependencies: astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro examples/with-mdx: @@ -405,10 +405,10 @@ importers: specifier: ^1.0.0-rc.2 version: link:../../packages/integrations/mdx '@astrojs/preact': - specifier: ^3.0.0-rc.2 + specifier: ^3.0.0-rc.3 version: link:../../packages/integrations/preact astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro preact: specifier: ^10.17.1 @@ -417,13 +417,13 @@ importers: examples/with-nanostores: dependencies: '@astrojs/preact': - specifier: ^3.0.0-rc.2 + specifier: ^3.0.0-rc.3 version: link:../../packages/integrations/preact '@nanostores/preact': specifier: ^0.5.0 version: 0.5.0(nanostores@0.9.3)(preact@10.17.1) astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro nanostores: specifier: ^0.9.3 @@ -444,7 +444,7 @@ importers: specifier: ^1.6.0 version: 1.6.0 astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro autoprefixer: specifier: ^10.4.15 @@ -462,7 +462,7 @@ importers: examples/with-vite-plugin-pwa: dependencies: astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro vite-plugin-pwa: specifier: 0.16.4 @@ -474,7 +474,7 @@ importers: examples/with-vitest: dependencies: astro: - specifier: ^3.0.0-rc.8 + specifier: ^3.0.0-rc.11 version: link:../../packages/astro vitest: specifier: ^0.34.2