@webjsdev/server 0.8.54 → 0.8.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webjsdev/server",
3
- "version": "0.8.54",
3
+ "version": "0.8.55",
4
4
  "type": "module",
5
5
  "description": "webjs dev/prod server: SSR, router, API, server actions, live reload",
6
6
  "main": "index.js",
@@ -118,16 +118,14 @@ export const CLIENT_LIFECYCLE_HOOKS = [
118
118
  ];
119
119
 
120
120
  /**
121
- * Method calls that only make sense on the client. `addController`
122
- * registers a ReactiveController (client lifecycle). `requestUpdate`
123
- * schedules a re-render. `setSlotContent` pushes dynamic slot values
124
- * (#1015) and `hasSlot` conditions a render on the slot record, both of
125
- * which need the client slot runtime to apply. Any of these implies the
126
- * component is not inert.
121
+ * Method calls that only make sense on the client. `addController` registers a
122
+ * ReactiveController (client lifecycle); `requestUpdate` schedules a re-render.
123
+ * Any of these implies the component is not inert. (The dynamic slot read
124
+ * surface lives in `SLOT_DYNAMIC_RE`, not here.)
127
125
  *
128
126
  * @type {readonly string[]}
129
127
  */
130
- export const CLIENT_METHOD_CALLS = ['addController', 'removeController', 'requestUpdate', 'setSlotContent', 'hasSlot'];
128
+ export const CLIENT_METHOD_CALLS = ['addController', 'removeController', 'requestUpdate'];
131
129
 
132
130
  /**
133
131
  * Static class fields whose declaration (to a non-`false` value) marks a
@@ -215,17 +213,21 @@ const EVENT_BINDING_RE = new RegExp(
215
213
  const EVENT_PROP_RE = /\.on[a-z]+\s*=\s*\$\{/;
216
214
 
217
215
  /**
218
- * Narrow dynamic-slot signals (#1015). The old blanket rule shipped ANY
219
- * component that merely RENDERS a `<slot>`, but under children-as-values the
220
- * SSR output already carries the placed children, so a display-only slotted
221
- * wrapper is byte-identical with or without its JS and is elidable. What
222
- * genuinely needs the client slot runtime is the DYNAMIC surface: a
223
- * `slotchange` listener, the assignedNodes/assignedElements/assignedSlot
224
- * reads, a `this.slots` record read, or the setSlotContent/hasSlot calls
225
- * (those two are also covered as CLIENT_METHOD_CALLS inside class bodies;
226
- * this regex catches external callers too).
216
+ * Narrow dynamic-slot signals (#1015, retained under #1021's native-parity
217
+ * record model). The old blanket rule shipped ANY component that merely
218
+ * RENDERS a `<slot>`, but the SSR output already carries the placed children,
219
+ * so a display-only slotted wrapper is byte-identical with or without its JS
220
+ * and is elidable. What genuinely needs the client slot runtime is the
221
+ * DYNAMIC READ surface: a `slotchange` listener or an `assignedNodes` /
222
+ * `assignedElements` / `assignedSlot` read. Native WRITE liveness
223
+ * (appendChild, slot= flips) is consumer-driven and usually forces the ship
224
+ * through the consumer's own signals (a shipping component that renders the
225
+ * tag, or an observation form); the remaining carve-out, a shipped script
226
+ * reaching an elided host only via document.querySelector, is inert by
227
+ * design with the `static interactive = true` escape hatch (see the
228
+ * slot.js banner).
227
229
  */
228
- const SLOT_DYNAMIC_RE = /\bslotchange\b|\bassignedNodes\s*\(|\bassignedElements\s*\(|\bassignedSlot\b|\.slots\b|\bsetSlotContent\s*\(|\bhasSlot\s*\(/;
230
+ const SLOT_DYNAMIC_RE = /\bslotchange\b|\bassignedNodes\s*\(|\bassignedElements\s*\(|\bassignedSlot\b/;
229
231
 
230
232
  /** A `.server.{js,ts,mjs,mts}` file: a stub on the client, inert there. */
231
233
  const SERVER_FILE_RE = /\.server\.m?[jt]s$/;
@@ -544,10 +546,9 @@ export function analyzeComponentSource(src) {
544
546
  // ships: the SSR output carries the placed children, and with no
545
547
  // observers in the runtime a display-only slotted wrapper is
546
548
  // byte-identical with or without its JS. Only the dynamic slot surface
547
- // (slotchange, the assigned* reads, the slots record, setSlotContent /
548
- // hasSlot) needs the client runtime.
549
+ // (slotchange, the assigned* reads) needs the client runtime.
549
550
  if (SLOT_DYNAMIC_RE.test(src)) {
550
- return { interactive: true, reason: 'uses the dynamic slot API (slotchange / assignedNodes / slots record)' };
551
+ return { interactive: true, reason: 'reads the dynamic slot surface (slotchange / assignedNodes / assignedElements / assignedSlot)' };
551
552
  }
552
553
 
553
554
  // Top-level client work the render/lifecycle checks would miss: a