mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
refactor(preact): Drop preact-ssr-prepass
in favor of renderToStringAsync
(#11464)
This commit is contained in:
parent
3f4735ee9b
commit
2cdb685ce7
4 changed files with 13 additions and 38 deletions
5
.changeset/few-candles-warn.md
Normal file
5
.changeset/few-candles-warn.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/preact': patch
|
||||
---
|
||||
|
||||
Swap out `preact-ssr-prepass` for `renderToStringAsync` from `preact-render-to-string`
|
|
@ -40,8 +40,7 @@
|
|||
"@preact/preset-vite": "2.8.2",
|
||||
"@preact/signals": "^1.3.0",
|
||||
"babel-plugin-transform-hook-names": "^1.0.2",
|
||||
"preact-render-to-string": "~6.3.1",
|
||||
"preact-ssr-prepass": "^1.2.2"
|
||||
"preact-render-to-string": "^6.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "workspace:*",
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import type { AstroComponentMetadata, NamedSSRLoadedRendererValue } from 'astro';
|
||||
import { Component as BaseComponent, type VNode, h } from 'preact';
|
||||
import { render } from 'preact-render-to-string';
|
||||
import prepass from 'preact-ssr-prepass';
|
||||
import { renderToStringAsync } from 'preact-render-to-string';
|
||||
import { getContext } from './context.js';
|
||||
import { restoreSignalsOnProps, serializeSignals } from './signals.js';
|
||||
import StaticHtml from './static-html.js';
|
||||
|
@ -89,8 +88,7 @@ async function renderToStaticMarkup(
|
|||
: children
|
||||
);
|
||||
|
||||
await prepass(vNode);
|
||||
const html = render(vNode);
|
||||
const html = await renderToStringAsync(vNode);
|
||||
return { attrs, html };
|
||||
}
|
||||
|
||||
|
|
|
@ -5100,11 +5100,8 @@ importers:
|
|||
specifier: ^1.0.2
|
||||
version: 1.0.2(@babel/core@7.24.9)
|
||||
preact-render-to-string:
|
||||
specifier: ~6.3.1
|
||||
version: 6.3.1(preact@10.22.1)
|
||||
preact-ssr-prepass:
|
||||
specifier: ^1.2.2
|
||||
version: 1.2.2(preact@10.22.1)
|
||||
specifier: ^6.5.5
|
||||
version: 6.5.5(preact@10.22.1)
|
||||
devDependencies:
|
||||
astro:
|
||||
specifier: workspace:*
|
||||
|
@ -9309,7 +9306,6 @@ packages:
|
|||
|
||||
libsql@0.3.12:
|
||||
resolution: {integrity: sha512-to30hj8O3DjS97wpbKN6ERZ8k66MN1IaOfFLR6oHqd25GMiPJ/ZX0VaZ7w+TsPmxcFS3p71qArj/hiedCyvXCg==}
|
||||
cpu: [x64, arm64, wasm32]
|
||||
os: [darwin, linux, win32]
|
||||
|
||||
lilconfig@2.1.0:
|
||||
|
@ -9925,10 +9921,6 @@ packages:
|
|||
resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
p-limit@5.0.0:
|
||||
resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
p-limit@6.1.0:
|
||||
resolution: {integrity: sha512-H0jc0q1vOzlEk0TqAKXKZxdl7kX3OFUzCnNVUnq5Pc3DGo0kpeaMuPqxQn235HibwBEb0/pm9dgKTjXy66fBkg==}
|
||||
engines: {node: '>=18'}
|
||||
|
@ -10279,16 +10271,11 @@ packages:
|
|||
resolution: {integrity: sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
preact-render-to-string@6.3.1:
|
||||
resolution: {integrity: sha512-NQ28WrjLtWY6lKDlTxnFpKHZdpjfF+oE6V4tZ0rTrunHrtZp6Dm0oFrcJalt/5PNeqJz4j1DuZDS0Y6rCBoqDA==}
|
||||
preact-render-to-string@6.5.5:
|
||||
resolution: {integrity: sha512-KiMFTKNTmT/ccE79BURR/r6XRc2I2TCTZ0MpeWqHW2XnllbeghXvwGsdAfF/MzMilUcTfODtSmMxgoRFL9TM5g==}
|
||||
peerDependencies:
|
||||
preact: '>=10'
|
||||
|
||||
preact-ssr-prepass@1.2.2:
|
||||
resolution: {integrity: sha512-XizQsmckrjbtjAvEDy40Fuxd4/doeKWOvYg9Gv1vh7crn5ptdcAMah3CRartq1aw+diQhIM2XKvG9j6RxPT32A==}
|
||||
peerDependencies:
|
||||
preact: '>=10 || ^10.0.0-beta.0 || ^10.0.0-alpha.0'
|
||||
|
||||
preact@10.22.1:
|
||||
resolution: {integrity: sha512-jRYbDDgMpIb5LHq3hkI0bbl+l/TQ9UnkdQ0ww+lp+4MMOdqaUYdFc5qeyP+IV8FAd/2Em7drVPeKdQxsiWCf/A==}
|
||||
|
||||
|
@ -10326,9 +10313,6 @@ packages:
|
|||
resolution: {integrity: sha512-mQUvGU6aUFQ+rNvTIAcZuWGRT9a6f6Yrg9bHs4ImKF+HZCEK+plBvnAZYSIQztknZF2qnzNtr6F8s0+IuptdlQ==}
|
||||
engines: {node: ^14.13.1 || >=16.0.0}
|
||||
|
||||
pretty-format@3.8.0:
|
||||
resolution: {integrity: sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==}
|
||||
|
||||
prismjs@1.29.0:
|
||||
resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==}
|
||||
engines: {node: '>=6'}
|
||||
|
@ -16386,10 +16370,6 @@ snapshots:
|
|||
dependencies:
|
||||
yocto-queue: 0.1.0
|
||||
|
||||
p-limit@5.0.0:
|
||||
dependencies:
|
||||
yocto-queue: 1.1.1
|
||||
|
||||
p-limit@6.1.0:
|
||||
dependencies:
|
||||
yocto-queue: 1.1.1
|
||||
|
@ -16775,12 +16755,7 @@ snapshots:
|
|||
picocolors: 1.0.1
|
||||
source-map-js: 1.2.0
|
||||
|
||||
preact-render-to-string@6.3.1(preact@10.22.1):
|
||||
dependencies:
|
||||
preact: 10.22.1
|
||||
pretty-format: 3.8.0
|
||||
|
||||
preact-ssr-prepass@1.2.2(preact@10.22.1):
|
||||
preact-render-to-string@6.5.5(preact@10.22.1):
|
||||
dependencies:
|
||||
preact: 10.22.1
|
||||
|
||||
|
@ -16815,8 +16790,6 @@ snapshots:
|
|||
|
||||
pretty-bytes@6.1.1: {}
|
||||
|
||||
pretty-format@3.8.0: {}
|
||||
|
||||
prismjs@1.29.0: {}
|
||||
|
||||
progress@2.0.3: {}
|
||||
|
|
Loading…
Reference in a new issue