Skip to content

Commit 99bc6e5

Browse files
committed
frames: import insert from the shared @solidjs/web instance (dedup)
The reveal-boundary binding imported `insert` from the runtime source (@dom-expressions/runtime/src/client.js), which bundled a SECOND copy of `insert` and the reconcile/render machinery it drags in into frames/dist — ~4kb the app already has from compiled JSX (frame-client.js itself never used the runtime `insert`, so nothing pulled it in before). Import it from @solidjs/web instead — the same shared instance compiled output uses — and mark @solidjs/web external in the frames client (prod + dev) rollup entries. Client bundle back to baseline (119.3kb -> 115.6kb). Frame tests unchanged.
1 parent 10d963b commit 99bc6e5

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

packages/solid-web/frames/src/client.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ import {
2020
sharedConfig
2121
} from "solid-js";
2222
import type { Element as SolidElement } from "solid-js";
23-
import { insert } from "@dom-expressions/runtime/src/client.js";
23+
// `insert` MUST resolve to the shared @solidjs/web instance the compiled app
24+
// already uses — importing it from the runtime source instead bundles a second
25+
// copy of `insert` and the reconcile/render machinery it drags in (~4kb the app
26+
// already has). Kept external in rollup.config.js for the same reason the
27+
// server-functions/client import below is.
28+
import { insert } from "@solidjs/web";
2429
import {
2530
createFrame,
2631
createFrameElement,

packages/solid-web/rollup.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export default [
201201
],
202202
external: [
203203
"solid-js",
204+
"@solidjs/web",
204205
"seroval",
205206
"seroval-plugins/web",
206207
"@solidjs/web/server-functions/client"
@@ -228,6 +229,7 @@ export default [
228229
],
229230
external: [
230231
"solid-js",
232+
"@solidjs/web",
231233
"seroval",
232234
"seroval-plugins/web",
233235
"@solidjs/web/server-functions/client"

0 commit comments

Comments
 (0)