π Patch Changes
- #11946
b75bfc8Thanks @johannesspohr! - Fix vue islands keeping their state when using view transition persistence
b75bfc8 Thanks @johannesspohr! - Fix vue islands keeping their state when using view transition persistence#11234 4385bf7 Thanks @ematipico! - Adds a new function called addServerRenderer to the Container API. Use this function to manually store renderers inside the instance of your container.
This new function should be preferred when using the Container API in environments like on-demand pages:
import type { APIRoute } from 'astro';import { experimental_AstroContainer } from 'astro/container';import reactRenderer from '@astrojs/react/server.js';import vueRenderer from '@astrojs/vue/server.js';import ReactComponent from '../components/button.jsx';import VueComponent from '../components/button.vue';
// MDX runtime is contained inside the Astro coreimport mdxRenderer from 'astro/jsx/server.js';
// In case you need to import a custom rendererimport customRenderer from '../renderers/customRenderer.js';
export const GET: APIRoute = async (ctx) => { const container = await experimental_AstroContainer.create(); container.addServerRenderer({ renderer: reactRenderer }); container.addServerRenderer({ renderer: vueRenderer }); container.addServerRenderer({ renderer: customRenderer }); // You can pass a custom name too container.addServerRenderer({ name: 'customRenderer', renderer: customRenderer, }); const vueComponent = await container.renderToString(VueComponent); return await container.renderToResponse(Component);};#11144 803dd80 Thanks @ematipico! - The integration now exposes a function called getContainerRenderer, that can be used inside the Container APIs to load the relative renderer.
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');});#11055 b92de22 Thanks @niklas-wortmann! - Updates the devtools type to allow passing VueDevToolsOptions
For more customization, you can pass options that the Vue DevTools Vite Plugin supports. (Note: appendTo is not supported.) For example, you can set launchEditor to your preferred editor if you are not using Visual Studio Code:
import { defineConfig } from 'astro/config';import vue from '@astrojs/vue';
export default defineConfig({ // ... integrations: [ vue({ devtools: { launchEditor: 'webstorm' }, }), ],});#10929 082abb8 Thanks @florian-lefebvre! - Adds a devtools option
You can enable the official Vue DevTools while working in development mode by setting devtools:true in your vue() integration config:
import { defineConfig } from 'astro/config';import vue from '@astrojs/vue';
export default defineConfig({ integrations: [vue({ devtools: true })],});#10689 683d51a5eecafbbfbfed3910a3f1fbf0b3531b99 Thanks @ematipico! - Deprecate support for versions of Node.js older than v18.17.1 for Node.js 18, older than v20.0.3 for Node.js 20, and the complete Node.js v19 release line.
This change is in line with Astroβs Node.js support policy.
4ea042c38839783fb42e8261d89d7c7149892518 Thanks @bluwy! - Removes unused jsxTransformOptions and jsxImportSource options from the renderer configb3028caecf1a96310e2ee7a65075a81c231d87be Thanks @kalepail! - Remove the unnecessary and deprecated @vue/server-renderer package from the ssr.external vite configee07e62942eb07532bd70365c7dd3ca2e4a18064 Thanks @Princesseuh! - Fixes using images from public inside Vue components not working correctly#9620 a1bb5fea552ce65585f49ecb6701733c48d117f9 Thanks @bluwy! - Fixes class property hydration error
#9490 a1c31665cbc48bfdf4885112b427db48ecc48276 Thanks @natemoo-re! - Fixes a bug that caused styles referenced by appEntrypoint to be excluded from the build
e496b2e3b84b673b81c872dad9a6b3f9dd32396a Thanks @michaelhthomas! - Fixes support for async appEntrypoint1baf0b0d3cbd0564954c2366a7278794fad6726e Thanks @sarah11918! - Updates READMEe83b5095f Thanks @florian-lefebvre! - Upgrades vite to latestb832cd190 Thanks @natemoo-re! - Fixes issue with appEntrypoint when running astro dev1c48ed286 Thanks @bluwy! - Adds Vite 5 support. There are no breaking changes from Astro. Check the Vite migration guide for details of the breaking changes from Vite instead.#9122 1c48ed286 Thanks @bluwy! - Adds Vite 5 support. There are no breaking changes from Astro. Check the Vite migration guide for details of the breaking changes from Vite instead.
Updated dependencies [abf601233, 6201bbe96, cdabf6ef0, 1c48ed286, 37697a2c5, bd0c2e9ae, 0fe3a7ed5, 710be505c, 153a5abb9]: