@webjsdev/core 0.7.26 → 0.7.28

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/core",
3
- "version": "0.7.26",
3
+ "version": "0.7.28",
4
4
  "type": "module",
5
5
  "description": "webjs core runtime - html/css tags, WebComponent base, isomorphic renderers",
6
6
  "types": "./index.d.ts",
package/src/html.js CHANGED
@@ -24,7 +24,13 @@ export function isTemplate(x) {
24
24
  }
25
25
 
26
26
  /**
27
- * Marker used in the DOM to find hydration points.
28
- * Same marker emitted by server and client so hydration can align.
27
+ * Marker used in the DOM to find hydration points. It is interpolated into
28
+ * BOTH comment markers (`<!--${MARKER}0-->`) and part-sentinel ATTRIBUTE names
29
+ * (`data-${MARKER}0`), so it MUST contain only characters valid in an XML
30
+ * qualified name. A `$` (the original value `'w$'`) is NOT valid in an
31
+ * attribute name: most engines tolerate it, but iOS WebKit's `setAttribute`
32
+ * enforces the spec and throws `InvalidCharacterError: Invalid qualified name`,
33
+ * which crashed `createInstance` for every slot template on iOS (#730). Keep it
34
+ * to `[a-z][a-z0-9-]*`. Enforced by `test/rendering/marker-valid-attr-name.test.js`.
29
35
  */
30
- export const MARKER = 'w$';
36
+ export const MARKER = 'wjm-';
@@ -765,6 +765,14 @@ const snapshotCache = new Map();
765
765
  */
766
766
  function snapshotCurrent(url) {
767
767
  const key = cacheKey(url);
768
+ // Let components and app code strip transient state (open overlays, toasts,
769
+ // in-progress wizard steps) from the page BEFORE it is serialized into the
770
+ // back/forward cache, so a later popstate restore shows a clean page rather
771
+ // than, say, a hover-card frozen open (#766, Turbo's `before-cache` contract).
772
+ // Fires SYNCHRONOUSLY on the live DOM right before the outerHTML read, so a
773
+ // handler's mutations are captured; the live edits are invisible because the
774
+ // page is being navigated away from.
775
+ document.dispatchEvent(new CustomEvent('webjs:before-cache', { detail: { url } }));
768
776
  // Move-to-front for LRU.
769
777
  if (snapshotCache.has(key)) snapshotCache.delete(key);
770
778
  /** @type {Snapshot} */
package/src/slot.js CHANGED
@@ -436,7 +436,7 @@ export function attachSlotObservers(host) {
436
436
  // Skip records produced by the framework's own renderer. Each
437
437
  // top-level TemplateInstance commit (`createInstance`) and each
438
438
  // child-part template swap (`applyChildPart`) inserts and removes
439
- // its content as a unit bounded by `w$s`/`w$e` comment markers
439
+ // its content as a unit bounded by `wjm-s`/`wjm-e` comment markers
440
440
  // (see render-client.js). When such a record reaches the host's
441
441
  // childList observer, treating its addedNodes as authored
442
442
  // children pollutes assignedByName with the renderer's own
@@ -145,16 +145,6 @@ export interface WebjsConfig {
145
145
  */
146
146
  seed?: boolean;
147
147
 
148
- /**
149
- * Bun zero-install dependency version-pinning switch (#685). Default `true`,
150
- * Bun only. When on, an `onLoad` transform rewrites a declared dep's bare
151
- * import specifier to its package.json / `bun.lock` version, so Bun's
152
- * auto-install fetches the pinned version instead of latest (#684). Set to
153
- * `false` to leave specifiers bare (zero-install resolves to latest). The
154
- * `WEBJS_PIN` env override wins over this. No effect on Node.
155
- */
156
- pin?: boolean;
157
-
158
148
  /**
159
149
  * Client-router switch (#629). Default `true`: the client router auto-enables
160
150
  * in the browser whenever `@webjsdev/core` loads, so any page that ships a