@astrojs/solid-js
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -41,3 +41,2 @@ import { getSolidPkgsConfig } from "./dependencies.js"; | ||
ssr: { | ||
target: "node", | ||
external: ["babel-preset-solid", ...solidPkgsConfig.ssr.external], | ||
@@ -44,0 +43,0 @@ noExternal: [...solidPkgsConfig.ssr.noExternal] |
@@ -12,3 +12,4 @@ import type { RendererContext } from './types'; | ||
renderToStaticMarkup: typeof renderToStaticMarkup; | ||
supportsAstroStaticSlot: boolean; | ||
}; | ||
export default _default; |
@@ -12,2 +12,4 @@ import { createComponent, renderToString, ssr } from "solid-js/web"; | ||
const renderId = (metadata == null ? void 0 : metadata.hydrate) ? incrementId(getContext(this.result)) : ""; | ||
const needsHydrate = (metadata == null ? void 0 : metadata.astroStaticSlot) ? !!metadata.hydrate : true; | ||
const tagName = needsHydrate ? "astro-slot" : "astro-static-slot"; | ||
const html = renderToString( | ||
@@ -18,3 +20,3 @@ () => { | ||
const name = slotName(key); | ||
slots[name] = ssr(`<astro-slot name="${name}">${value}</astro-slot>`); | ||
slots[name] = ssr(`<${tagName} name="${name}">${value}</${tagName}>`); | ||
} | ||
@@ -25,3 +27,3 @@ const newProps = { | ||
// In Solid SSR mode, `ssr` creates the expected structure for `children`. | ||
children: children != null ? ssr(`<astro-slot>${children}</astro-slot>`) : children | ||
children: children != null ? ssr(`<${tagName}>${children}</${tagName}>`) : children | ||
}; | ||
@@ -43,3 +45,4 @@ return createComponent(Component, newProps); | ||
check, | ||
renderToStaticMarkup | ||
renderToStaticMarkup, | ||
supportsAstroStaticSlot: true | ||
}; | ||
@@ -46,0 +49,0 @@ export { |
{ | ||
"name": "@astrojs/solid-js", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "Use Solid components within Astro", | ||
@@ -29,2 +29,5 @@ "type": "module", | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"dependencies": { | ||
@@ -36,3 +39,3 @@ "babel-preset-solid": "^1.4.2", | ||
"solid-js": "^1.5.1", | ||
"astro": "2.3.4", | ||
"astro": "2.5.0", | ||
"astro-scripts": "0.0.14" | ||
@@ -39,0 +42,0 @@ }, |
14887
15
230