Skip to content

Commit da3bcec

Browse files
garamondbfanger
authored andcommitted
Switch to arrays for payload.out
1 parent 573da5d commit da3bcec

File tree

8 files changed

+99
-80
lines changed

8 files changed

+99
-80
lines changed

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type": "git",
1111
"url": "https://github.com/bfanger/svelte-preprocess-react.git"
1212
},
13-
"version": "2.1.2",
13+
"version": "2.1.3",
1414
"license": "MIT",
1515
"type": "module",
1616
"scripts": {
@@ -69,8 +69,7 @@
6969
"postcss": "^8.5.6",
7070
"prettier": "^3.6.2",
7171
"prettier-plugin-svelte": "^3.4.0",
72-
"react": "19.1.1",
73-
"react-dom": "19.1.1",
72+
"react": "^19.1.1",
7473
"react-youtube": "^10.1.0",
7574
"svelte-check": "^4.3.1",
7675
"svelte-youtube-lite": "~1.2.1",
@@ -89,7 +88,7 @@
8988
"peerDependencies": {
9089
"react": ">=16.8.0",
9190
"react-dom": ">=16.8.0",
92-
"svelte": ">=5.0.0 <=5.36.7"
91+
"svelte": ">=5.36.8"
9392
},
9493
"svelte": "./dist/index.js",
9594
"files": [

pnpm-lock.yaml

Lines changed: 57 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/reactify.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,19 @@ function single<P extends Record<string, any>>(
145145
if (server) {
146146
let html = "";
147147
if ($$payload) {
148+
if (typeof $$payload.out === "string") {
149+
throw new Error(
150+
"Invalid $$payload, check if the svelte version is 5.36.8 or higher",
151+
);
152+
}
148153
const len = $$payload.out.length;
149154
(SvelteWrapper as any)($$payload, {
150155
SvelteComponent,
151156
nodeKey,
152157
props,
153158
react$children: children,
154159
});
155-
html = $$payload.out.slice(len);
160+
html = $$payload.out.slice(len).join("");
156161
$$payload.out = $$payload.out.slice(0, len);
157162
} else {
158163
if (children && !props.children) {

0 commit comments

Comments
 (0)