@solidjs/web 2.0.0-rc.15 → 2.0.0-rc.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/server.dev.js +358 -479
- package/dist/server.js +343 -387
- package/dist/server.observe.js +343 -387
- package/dist/web.dev.js +57 -54
- package/dist/web.js +47 -49
- package/dist/web.observe.js +57 -54
- package/frames/dist/client.dev.js +610 -621
- package/frames/dist/client.js +540 -566
- package/frames/dist/client.observe.js +571 -573
- package/frames/dist/regions.js +43 -2
- package/frames/dist/server.dev.js +514 -423
- package/frames/dist/server.js +514 -370
- package/frames/dist/server.observe.js +514 -370
- package/frames/dist/wire.js +371 -6
- package/package.json +11 -11
- package/serialization/dist/decode.js +9 -7
- package/serialization/dist/serialization.js +9 -7
- package/serialization/types/serializer-decode.d.ts +2 -2
- package/server-functions/dist/client.dev.js +3 -1
- package/server-functions/dist/client.js +1 -1
- package/server-functions/dist/client.observe.js +3 -1
- package/server-functions/dist/rich-args.js +33 -1
- package/server-functions/dist/server.dev.js +127 -18
- package/server-functions/dist/server.js +127 -18
- package/server-functions/dist/server.observe.js +127 -18
- package/skills/server-components/SKILL.md +74 -185
- package/types/client.d.ts +15 -5
- package/types/frames/assets-tier.d.ts +2 -2
- package/types/frames/client.d.ts +8 -3
- package/types/frames/frame-client.d.ts +121 -157
- package/types/frames/frame-morph.d.ts +28 -0
- package/types/frames/frame-sink.d.ts +13 -9
- package/types/frames/frame-transport.d.ts +30 -1
- package/types/frames/regions-tier.d.ts +15 -0
- package/types/frames/serializer-decode.d.ts +2 -2
- package/types/frames/server.d.ts +0 -52
- package/types/frames/wire-tier.d.ts +54 -1
- package/types/index.d.ts +2 -2
- package/types/jsx.d.ts +11 -5
- package/types/observe.d.ts +14 -7
- package/types/render.d.ts +3 -1
- package/types/response.d.ts +5 -4
- package/types/serializer-decode.d.ts +2 -2
- package/types/server-functions/argument-codec.d.ts +21 -0
- package/types/server-functions/client.d.ts +14 -5
- package/types/server-functions/server.d.ts +6 -2
- package/types/server-functions/shared.d.ts +19 -0
- package/types/server-observe.d.ts +3 -2
- package/types/server.d.ts +57 -76
- package/frames/dist/bind.dev.js +0 -326
- package/frames/dist/bind.js +0 -295
- package/types/frames/bind-tier.d.ts +0 -60
package/frames/dist/regions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createFrame } from '@solidjs/web/frames';
|
|
2
|
-
import 'solid-js';
|
|
2
|
+
import { getOwner, onCleanup, runWithOwner } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
const ELEMENT_NODE = 1;
|
|
5
5
|
const COMMENT_NODE = 8;
|
|
@@ -71,6 +71,10 @@ function resolve(frame, occurrence, regions, props, start) {
|
|
|
71
71
|
element: makeFrameElement(childId),
|
|
72
72
|
frame: undefined
|
|
73
73
|
});else if (entry.childId !== childId) rename(entry, childId);
|
|
74
|
+
placements.has(entry.element) || placements.set(entry.element, {
|
|
75
|
+
o: null,
|
|
76
|
+
m: new Map()
|
|
77
|
+
});
|
|
74
78
|
props[key] = entry.element;
|
|
75
79
|
}
|
|
76
80
|
}
|
|
@@ -91,6 +95,43 @@ function bind(frame, occurrence) {
|
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
97
|
}
|
|
98
|
+
const placements = new WeakMap();
|
|
99
|
+
function place(el) {
|
|
100
|
+
const o = getOwner();
|
|
101
|
+
const p = placements.get(el);
|
|
102
|
+
if (!o || !p || p.o === o) return;
|
|
103
|
+
p.o = o;
|
|
104
|
+
onCleanup(() => {
|
|
105
|
+
if (p.o === o) p.o = null;
|
|
106
|
+
for (const entry of p.m.values()) if (entry.o === o) entry.o = null;
|
|
107
|
+
});
|
|
108
|
+
for (const entry of p.m.values()) entry.o || entry.run();
|
|
109
|
+
}
|
|
110
|
+
function nest(mount, props, ctx) {
|
|
111
|
+
const start = ctx && ctx.range && ctx.range.start;
|
|
112
|
+
const p = start && placements.get(start.parentNode.closest?.(FRAME_TAG));
|
|
113
|
+
if (!p) return mount(props, ctx);
|
|
114
|
+
const key = ctx.key;
|
|
115
|
+
let at = ctx;
|
|
116
|
+
const entry = {
|
|
117
|
+
o: null,
|
|
118
|
+
run() {
|
|
119
|
+
if (!at) {
|
|
120
|
+
at = {
|
|
121
|
+
...ctx,
|
|
122
|
+
adopted: false,
|
|
123
|
+
existing: []
|
|
124
|
+
};
|
|
125
|
+
for (let n = start.nextSibling; n && n !== ctx.range.end; n = n.nextSibling) at.existing.push(n);
|
|
126
|
+
}
|
|
127
|
+
runWithOwner(entry.o = p.o, () => mount(props, at));
|
|
128
|
+
at = null;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
p.m.set(key, entry);
|
|
132
|
+
ctx.onCleanup(() => p.m.get(key) === entry && p.m.delete(key));
|
|
133
|
+
if (p.o) entry.run();
|
|
134
|
+
}
|
|
94
135
|
function unmount(frame, occurrence) {
|
|
95
136
|
const slots = byFrame.get(frame);
|
|
96
137
|
if (!slots) return;
|
|
@@ -127,4 +168,4 @@ function frames(frame) {
|
|
|
127
168
|
return out;
|
|
128
169
|
}
|
|
129
170
|
|
|
130
|
-
export { bind, changed, frames, resolve, unmount };
|
|
171
|
+
export { bind, changed, frames, nest, place, resolve, unmount };
|