summaryrefslogtreecommitdiff
path: root/packages/integrations/lit
diff options
context:
space:
mode:
authorGravatar Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com> 2024-06-17 06:39:57 -0700
committerGravatar GitHub <noreply@github.com> 2024-06-17 15:39:57 +0200
commit83c565b36c7a5bf8fbc6cc37934109b74ed43ba5 (patch)
treea91a1b70869e3fc50a12108523f9499a26cac43f /packages/integrations/lit
parent7d597506615fa5a34327304e8321be7b9c4b799d (diff)
downloadastro-83c565b36c7a5bf8fbc6cc37934109b74ed43ba5.tar.gz
astro-83c565b36c7a5bf8fbc6cc37934109b74ed43ba5.tar.zst
astro-83c565b36c7a5bf8fbc6cc37934109b74ed43ba5.zip
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/lit')
-rw-r--r--packages/integrations/lit/CHANGELOG.md37
-rw-r--r--packages/integrations/lit/package.json2
2 files changed, 38 insertions, 1 deletions
diff --git a/packages/integrations/lit/CHANGELOG.md b/packages/integrations/lit/CHANGELOG.md
index e133dde5d..0aa8f4f71 100644
--- a/packages/integrations/lit/CHANGELOG.md
+++ b/packages/integrations/lit/CHANGELOG.md
@@ -1,5 +1,42 @@
# @astrojs/lit
+## 4.3.0
+
+### Minor Changes
+
+- [#11234](https://github.com/withastro/astro/pull/11234) [`4385bf7`](https://github.com/withastro/astro/commit/4385bf7a4dc9c65bff53a30c660f7a909fcabfc9) Thanks [@ematipico](https://github.com/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:
+
+ ```ts
+ 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 core
+ import mdxRenderer from 'astro/jsx/server.js';
+
+ // In case you need to import a custom renderer
+ import 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);
+ };
+ ```
+
## 4.2.0
### Minor Changes
diff --git a/packages/integrations/lit/package.json b/packages/integrations/lit/package.json
index 677cba4ea..714dbce55 100644
--- a/packages/integrations/lit/package.json
+++ b/packages/integrations/lit/package.json
@@ -1,6 +1,6 @@
{
"name": "@astrojs/lit",
- "version": "4.2.0",
+ "version": "4.3.0",
"description": "Use Lit components within Astro",
"type": "module",
"types": "./dist/index.d.ts",