Skip to content

Commit 86b5ef9

Browse files
author
DevBot
committed
refactor(element): remove dead v0.43 renderer/hydration residue (#1273 O2, B2.13)
Dead-code proof (import graph from every deno.json exports entrypoint + CLI/bin entries, plus repo-wide symbol search incl. tests, www, tools, examples): zero consumers for each removal. All five deleted modules were shipped to npm because every package publishes src/**. Deleted: - src/types.ts (ElementDefinition render()->VNode typing of the removed runtime renderer) - src/internal/protocol/vnode.ts (VNode/ComponentFn/ComponentCtor/RenderFn) - src/internal/protocol/prop.ts (ADR-0052 static prop-decl typing, superseded by compiler __compiledProperties) - src/internal/core/dom-utils.ts (clearChildren, unused since #902-era renderer removal) - src/internal/core/dsd-shadow-root.ts (hasPopulatedShadowRoot, unused) Slimmed: - internal/protocol/render.ts: dropped the legacy DSD-pipeline interfaces (RenderPhase, RenderInput, RenderHooks, DsdOptions, RenderErrorCode, DsdComponentConstructor, DsdComponent) and the VNode import; kept the live RenderError/RenderOutput/HydrationHint/DsdRenderMetrics/ SsrAdmissionDecision contract unchanged (snapshot shapes identical). - internal/protocol/hydration-markers.ts: removed the v0.43 marker constants (DATA_SIGNAL*, DATA_EID, DATA_SSR_PROPS, BRANCH_MARKER_PREFIX, FOR_ITEM_PREFIX, FOR_END_PREFIX) and parseSignalAttrSpec. The compiled model claims through oe:pN program anchors; the marker literals are already forbidden in built artifacts by check-v044-legacy-absence.ts. DATA_OE_LIGHT stays: it is the live ADR-0142 light-mode marker, consumed via literals across the generated-code boundary by design. Public surface: DATA_SSR_PROPS re-export removed from src/index.ts and src/public-runtime.ts. The data-ssr-props channel was already documented as gone (app/preact.ts); the export was classed internal-importable, had no consumer anywhere in the repo, and is deleted rather than deprecated per the B2.13 removal authority. Interface snapshot, package-surface class map and content graph regenerated; the only snapshot delta is the DATA_SSR_PROPS symbol removal. Also fixes the stale reader list in ssr-registry-markers.ts (element's define-element.ts no longer exists; the SSR stub marker is read by app/preact.ts). Refs #1273. Stage #1288 risk #8.
1 parent 36dc582 commit 86b5ef9

8 files changed

Lines changed: 18 additions & 141 deletions

File tree

docs/current/PACKAGE_SURFACE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ classified name missing from the prose fails the gate.
183183
"createContext": "stable-candidate",
184184
"createLogger": "internal-importable",
185185
"DANGEROUS_KEYS": "experimental",
186-
"DATA_SSR_PROPS": "internal-importable",
187186
"deepGetElementById": "internal-importable",
188187
"effect": "stable-candidate",
189188
"element": "experimental",
@@ -467,7 +466,7 @@ classified name missing from the prose fails the gate.
467466
| ----------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
468467
| root | compatibility-only | `OpenElementRouteKind`, `OpenElementRouteNode` |
469468
| | experimental | `DANGEROUS_KEYS`, `element`, `injectPropsSafe`, `isDangerousKey`, `property` |
470-
| | internal-importable | `AppShellConfig`, `assertValidTagName`, `collectPublicProps`, `CompatibilityClassification`, `CompatibilityTier`, `ComponentLayer`, `createLogger`, `DATA_SSR_PROPS`, `deepGetElementById`, `ensureDeepFragmentNavigation`, `ensurePreHydrationClickCapture`, `formatError`, `FrameworkOptions`, `isValidTagName`, `renderDsd`, `RenderDsdOptions`, `RenderOutput`, `RouteEntry`, `SpecialFileType`, `SsrAdmissionDecision`, `wrapInDocument` |
469+
| | internal-importable | `AppShellConfig`, `assertValidTagName`, `collectPublicProps`, `CompatibilityClassification`, `CompatibilityTier`, `ComponentLayer`, `createLogger`, `deepGetElementById`, `ensureDeepFragmentNavigation`, `ensurePreHydrationClickCapture`, `formatError`, `FrameworkOptions`, `isValidTagName`, `renderDsd`, `RenderDsdOptions`, `RenderOutput`, `RouteEntry`, `SpecialFileType`, `SsrAdmissionDecision`, `wrapInDocument` |
471470
| | stable-candidate | `Action`, `ACTION_FETCH_HEADER`, `ActionContext`, `ActionResult`, `computed`, `consumeContext`, `Context`, `createContext`, `effect`, `ERROR_PREFIX`, `ErrorBoundary`, `ErrorTelemetryHook`, `escapeAttr`, `escapeHtml`, `HYDRATION_STRATEGIES`, `HydrationStrategy`, `IslandOptions`, `isSafeAttributeName`, `Loader`, `LoaderContext`, `LocalePath`, `Middleware`, `OpenElement`, `OpenElementAttribute`, `OpenElementCssPart`, `OpenElementDeclaration`, `OpenElementError`, `OpenElementEvent`, `OpenElementPackageManifest`, `OpenElementSlot`, `PROBLEM_JSON_MEDIA_TYPE`, `ProblemDetails`, `provideContext`, `RenderError`, `reportError`, `ServerRouteContext`, `ServerRouteMetadata`, `setErrorTelemetryHook`, `signal`, `Signal`, `SpaAction`, `SpaActionContext`, `SpaLoader`, `SpaLoaderContext`, `StyleSheet`, `StyleSheetLike`, `trustedHtml`, `TrustedHtml` |
472471
| `jsx-runtime` | stable-candidate | `Fragment`, `jsx`, `JSX`, `jsxs` |
473472
| `jsx-dev-runtime` | stable-candidate | `Fragment`, `JSX`, `jsxDEV` |

docs/release/public-interface-snapshot.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"declarations": {
1414
".": {
15-
"publicShapeSha256": "91ae10b67582b58198720342b1d5e7065af882d94215f04bac7f1adea002c671",
15+
"publicShapeSha256": "c91c79a068bef242e7dd46601efc9fdd12084c77a8e2bc14b20e26f7c5905a7b",
1616
"publicSymbols": [
1717
"ACTION_FETCH_HEADER=value:\"x-openelement-action\"",
1818
"Action=type:{call:(ctx:{env:Env;formData:FormData;params:Record<string, string>;platform:union(Platform|undefined);request:Request;responseHeaders:Headers;route:Route})=>union(Promise<T>|T)}",
@@ -24,7 +24,6 @@
2424
"ComponentLayer=type:union(\"dsd-interactive\"|\"dsd-static\"|\"light-dom\"|\"pure-island\")",
2525
"Context=type:{readonly defaultValue:T;readonly key:symbol}",
2626
"DANGEROUS_KEYS=value:ReadonlySet<string>",
27-
"DATA_SSR_PROPS=value:\"data-ssr-props\"",
2827
"ERROR_PREFIX=value:\"[openElement]\"",
2928
"ErrorBoundary=type:{_errors:{capture:{call:(error:unknown,source:unknown)=>void};catchError:{call:(error:unknown,source:unknown)=>void};dispose:{call:()=>void};error:union(null|{readonly code:string;readonly phase:union(\"build\"|\"csr\"|\"navigation\"|\"render\"|\"ssr\"|\"unknown\"|\"validation\");readonly recoverable:union(false|true);readonly severity:union(\"error\"|\"warning\");readonly statusCode?:union(number|undefined);toJSON:{call:()=>Record<string, unknown>}});hasError:union(false|true);maxRetries:number;reset:{call:()=>void};retry:{call:(recover:union(undefined|{call:()=>void}))=>union(false|true)};retryCount:number;source:unknown};_getLocale:{call:(fallback:string)=>string};_internals:union(ElementInternals|undefined);_lifecycleSignal:{call:()=>AbortSignal};_requestAnimationFrame:{call:(callback:FrameRequestCallback)=>number};_setTimeout:{call:(handler:union(Function|string),timeout:union(number|undefined))=>number};adoptedCallback:{call:()=>void};attributeChangedCallback:{call:(name:string,_oldValue:union(null|string),newValue:union(null|string))=>void};catchError:{call:(error:Error,source:unknown)=>void};clientActivate:{call:()=>void};connectedCallback:{call:()=>void};disconnectedCallback:{call:()=>void};error:union(null|{readonly code:string;readonly phase:union(\"build\"|\"csr\"|\"navigation\"|\"render\"|\"ssr\"|\"unknown\"|\"validation\");readonly recoverable:union(false|true);readonly severity:union(\"error\"|\"warning\");readonly statusCode?:union(number|undefined);toJSON:{call:()=>Record<string, unknown>}});formAssociatedCallback:{call:(_form:union(HTMLFormElement|null))=>void};formResetCallback:{call:()=>void};formStateRestoreCallback:{call:(state:union(File|FormData|null|string),mode:string)=>void};hasError:union(false|true);locale?:union(string|undefined);maxRetries:number;onCsrRendered:{call:()=>void};onDsdHydrated:{call:()=>void};params:Record<string, string>;reset:{call:()=>void};retry:{call:()=>void};retryCount:number}|value:{_resetGlobalStyles:{call:()=>void};client?:union(undefined|{hydrate?:union(\"idle\"|\"load\"|\"only\"|\"visible\"|undefined)});construct:()=>{_errors:{capture:{call:(error:unknown,source:unknown)=>void};catchError:{call:(error:unknown,source:unknown)=>void};dispose:{call:()=>void};error:union(null|{readonly code:string;readonly phase:union(\"build\"|\"csr\"|\"navigation\"|\"render\"|\"ssr\"|\"unknown\"|\"validation\");readonly recoverable:union(false|true);readonly severity:union(\"error\"|\"warning\");readonly statusCode?:union(number|undefined);toJSON:{call:()=>Record<string, unknown>}});hasError:union(false|true);maxRetries:number;reset:{call:()=>void};retry:{call:(recover:union(undefined|{call:()=>void}))=>union(false|true)};retryCount:number;source:unknown};_getLocale:{call:(fallback:string)=>string};_internals:union(ElementInternals|undefined);_lifecycleSignal:{call:()=>AbortSignal};_requestAnimationFrame:{call:(callback:FrameRequestCallback)=>number};_setTimeout:{call:(handler:union(Function|string),timeout:union(number|undefined))=>number};adoptedCallback:{call:()=>void};attributeChangedCallback:{call:(name:string,_oldValue:union(null|string),newValue:union(null|string))=>void};catchError:{call:(error:Error,source:unknown)=>void};clientActivate:{call:()=>void};connectedCallback:{call:()=>void};disconnectedCallback:{call:()=>void};error:union(null|{readonly code:string;readonly phase:union(\"build\"|\"csr\"|\"navigation\"|\"render\"|\"ssr\"|\"unknown\"|\"validation\");readonly recoverable:union(false|true);readonly severity:union(\"error\"|\"warning\");readonly statusCode?:union(number|undefined);toJSON:{call:()=>Record<string, unknown>}});formAssociatedCallback:{call:(_form:union(HTMLFormElement|null))=>void};formResetCallback:{call:()=>void};formStateRestoreCallback:{call:(state:union(File|FormData|null|string),mode:string)=>void};hasError:union(false|true);locale?:union(string|undefined);maxRetries:number;onCsrRendered:{call:()=>void};onDsdHydrated:{call:()=>void};params:Record<string, string>;reset:{call:()=>void};retry:{call:()=>void};retryCount:number};delegatesFocus?:union(false|true|undefined);formAssociated?:union(false|true|undefined);getGlobalStyles:{call:()=>array({readonly cssRules:array({cssText:string});replaceSync:{call:(text:string)=>void}})};head?:union(undefined|{description?:union(string|undefined);ogImage?:union(string|undefined);title?:union(string|undefined)});isErrorBoundary:union(false|true);registerGlobalStyles:{call:(sheets:unknown)=>void};renderMode?:union(\"light\"|\"shadow\"|undefined);styles?:union(array({readonly cssRules:array({cssText:string});replaceSync:{call:(text:string)=>void}})|undefined|{readonly cssRules:array({cssText:string});replaceSync:{call:(text:string)=>void}})}",
3029
"ErrorTelemetryHook=type:{call:(error:{readonly code:string;readonly phase:union(\"build\"|\"csr\"|\"navigation\"|\"render\"|\"ssr\"|\"unknown\"|\"validation\");readonly recoverable:union(false|true);readonly severity:union(\"error\"|\"warning\")})=>void}",

packages/element/src/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ export { DANGEROUS_KEYS, injectPropsSafe, isDangerousKey } from './public-runtim
8080

8181
export type { IslandOptions } from './public-runtime.ts';
8282

83-
// ─── Hydration markers (protocol) ───────────────────────
84-
85-
// Shared by SSR writers and client readers (app, www) so the attribute name
86-
// has a single typed source (#836).
87-
export { DATA_SSR_PROPS } from './public-runtime.ts';
88-
8983
// ─── StyleSheet (re-export from core) ────────────────────
9084

9185
export {
Lines changed: 11 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,19 @@
11
/**
2-
* hydration-markers.ts - DSD hydration marker contract.
2+
* hydration-markers.ts - light-mode SSR provenance marker contract.
33
*
4-
* These constants and helpers define the canonical shape of the markers used
5-
* to re-connect signals and events between SSR output and client-side hydration.
4+
* The v0.43 marker-based hydration channel (`data-signal*`, `data-eid`,
5+
* `data-ssr-props`, `oe-branch:`/`oe-for-item:` comments) was removed with the
6+
* compiled Part Program model: claim now binds through program anchors
7+
* (`oe:pN`, internal/compiled/program.ts), and the legacy marker strings are
8+
* forbidden in built artifacts by tools/check-v044-legacy-absence.ts.
69
*
7-
* Keep marker string values stable: they are persisted in serialized HTML and
8-
* read by hydration code in `../core/index.ts` and `@openelement/element`.
10+
* One marker survives. Its consumers (internal/compiled/server,
11+
* internal/compiled/runtime, and the adapter's SSG/dev toolchain) reference
12+
* the string literal by design — the writer/reader set crosses the
13+
* generated-code boundary, so there is no import edge; this module is the
14+
* single source for the name so a rename cannot drift silently.
915
*/
1016

11-
/** Marker that binds a named signal to an element's textContent. */
12-
export const DATA_SIGNAL = 'data-signal';
13-
14-
/** Marker that lists the HTML attributes a signal drives on an element. */
15-
export const DATA_SIGNAL_ATTR = 'data-signal-attr';
16-
17-
/** Marker that toggles a single CSS class based on a signal's truthiness. */
18-
export const DATA_SIGNAL_CLASS = 'data-signal-class';
19-
20-
/** Marker that replaces an element's children with a signal's VNode value. */
21-
export const DATA_SIGNAL_RENDER = 'data-signal-render';
22-
23-
/** Marker that identifies an element carrying serialized event bindings. */
24-
export const DATA_EID = 'data-eid';
25-
26-
/**
27-
* Marker carrying the JSON-serialized public props of an SSR-rendered host,
28-
* read back on client upgrade to restore component state (#836).
29-
*/
30-
export const DATA_SSR_PROPS = 'data-ssr-props';
31-
3217
/**
3318
* Internal SSR provenance marker on light-mode host tags (ADR-0142, #1148).
3419
*
@@ -38,34 +23,3 @@ export const DATA_SSR_PROPS = 'data-ssr-props';
3823
* subtree. Client rendering never writes it and it is never removed.
3924
*/
4025
export const DATA_OE_LIGHT = 'data-oe-light';
41-
42-
/** HTML comment prefix recording the SSR-evaluated branch state of `<Show>`/`<For>`. */
43-
export const BRANCH_MARKER_PREFIX = 'oe-branch:';
44-
45-
/**
46-
* HTML comment prefix emitted by SSR before each `<For>` item, in traversal
47-
* order (value = item ordinal). Hydration (matched path) slices the seeded
48-
* list regions between consecutive markers so keyed reconciliation can take
49-
* over the existing SSR DOM instead of re-rendering it (#917).
50-
*/
51-
export const FOR_ITEM_PREFIX = 'oe-for-item:';
52-
53-
/** HTML comment emitted by SSR after a `<For>`'s last item (region terminator). */
54-
export const FOR_END_PREFIX = 'oe-for-end';
55-
56-
/** Parsed value of a `data-signal-attr` attribute: a list of attribute names. */
57-
type SignalAttrSpec = string[];
58-
59-
/**
60-
* Parse a `data-signal-attr` marker value into individual attribute names.
61-
*
62-
* The value is a comma-separated list (e.g. `"class,disabled"`). Empty entries
63-
* and surrounding whitespace are ignored, preserving the original attribute
64-
* order.
65-
*
66-
* @param value - Raw marker value from the DOM.
67-
* @returns Non-empty attribute names.
68-
*/
69-
export function parseSignalAttrSpec(value: string): SignalAttrSpec {
70-
return value.split(',').map((part) => part.trim()).filter(Boolean);
71-
}

0 commit comments

Comments
 (0)