@openelement/protocol 1.0.0-alpha.15 → 1.0.0-alpha.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 +2 -1
- package/package.json +6 -1
- package/src/diagnostics.js +4 -0
- package/src/errors.d.ts +11 -0
- package/src/errors.js +11 -0
- package/src/framework.d.ts +6 -11
- package/src/index.d.ts +4 -4
- package/src/index.js +4 -4
- package/src/manifest.d.ts +31 -0
- package/src/module-vocabulary.js +9 -17
- package/src/part-program.d.ts +0 -14
- package/src/part-program.js +1 -15
- package/src/registry-markers.d.ts +14 -1
- package/src/registry-markers.js +15 -2
- package/src/server-only.d.ts +1 -0
- package/src/server-only.js +1 -0
- package/src/ssg.d.ts +43 -5
- package/src/style-sheet.d.ts +15 -0
- package/src/style-sheet.js +16 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ into the others' graphs.
|
|
|
10
10
|
|
|
11
11
|
| Subpath | Import it for |
|
|
12
12
|
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| `@openelement/protocol` | The umbrella re-export of
|
|
13
|
+
| `@openelement/protocol` | The umbrella re-export of the shared contracts. |
|
|
14
14
|
| `@openelement/protocol/app-model` | Host-agnostic route and asset contracts shared by app and build drivers (the route tree node, matched-path shapes). |
|
|
15
15
|
| `@openelement/protocol/client-assets` | The client asset manifest protocol (#1471): compile-time island identity joined with build output for per-page script wiring. |
|
|
16
16
|
| `@openelement/protocol/data` | The platform-neutral data adapter protocol. |
|
|
@@ -28,6 +28,7 @@ into the others' graphs.
|
|
|
28
28
|
| `@openelement/protocol/registry-markers` | SSR customElements registry marker contract (#965). |
|
|
29
29
|
| `@openelement/protocol/render` | Render pipeline types (render errors, hydration hints, SSR admission decisions). |
|
|
30
30
|
| `@openelement/protocol/runtime` | Runtime adapter protocol. |
|
|
31
|
+
| `@openelement/protocol/server-only` | Side-effect import that marks an application module as server-only in Router browser builds and dev. |
|
|
31
32
|
| `@openelement/protocol/signal` | Signal contracts (`Signal`, `ReadonlySignal`, brands). |
|
|
32
33
|
| `@openelement/protocol/ssg` | SSG engine contracts (route manifests, island declarations, stream route manifests). |
|
|
33
34
|
| `@openelement/protocol/stream-frame-policy` | The canonical deny lists a deferred text/Block Part frame must satisfy for the browser installer to accept it. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openelement/protocol",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -95,6 +95,11 @@
|
|
|
95
95
|
"import": "./src/runtime.js",
|
|
96
96
|
"default": "./src/runtime.js"
|
|
97
97
|
},
|
|
98
|
+
"./server-only": {
|
|
99
|
+
"types": "./src/server-only.d.ts",
|
|
100
|
+
"import": "./src/server-only.js",
|
|
101
|
+
"default": "./src/server-only.js"
|
|
102
|
+
},
|
|
98
103
|
"./signal": {
|
|
99
104
|
"types": "./src/signal.d.ts",
|
|
100
105
|
"import": "./src/signal.js",
|
package/src/diagnostics.js
CHANGED
|
@@ -85,7 +85,11 @@ function parseDiagnosticReport(text) {
|
|
|
85
85
|
if (!Array.isArray(record.diagnostics)) problems.push(problem("report.diagnostics", "an array"));
|
|
86
86
|
if (problems.length > 0) throw new DiagnosticReportParseError(problems);
|
|
87
87
|
const diagnostics = record.diagnostics.map((entry, index) => parseEnvelope(entry, `report.diagnostics[${index}]`));
|
|
88
|
+
const expected = diagnosticReport(diagnostics).ok;
|
|
89
|
+
const hasUnknownSeverity = diagnostics.some(({ severity }) => severity !== "error" && severity !== "warning" && severity !== "info");
|
|
90
|
+
if (record.ok !== expected && (!expected || !hasUnknownSeverity)) throw new DiagnosticReportParseError([problem("report.ok", expected ? "true when no error is present" : "false when an error is present")]);
|
|
88
91
|
return {
|
|
92
|
+
...record,
|
|
89
93
|
format: record.format,
|
|
90
94
|
ok: record.ok,
|
|
91
95
|
diagnostics
|
package/src/errors.d.ts
CHANGED
|
@@ -139,6 +139,17 @@ export declare const RuntimeErrorCode: {
|
|
|
139
139
|
readonly ROOT_WITHOUT_DOCUMENT: "OE_RUNTIME_ROOT_WITHOUT_DOCUMENT";
|
|
140
140
|
/** Fresh-DOM creation was handed a root that is not empty. */
|
|
141
141
|
readonly FRESH_ROOT_NOT_EMPTY: "OE_RUNTIME_FRESH_ROOT_NOT_EMPTY";
|
|
142
|
+
/**
|
|
143
|
+
* `claimRecipe` was asked to claim a recipe that has no generated claim.
|
|
144
|
+
* This is a caller/recipe-shape failure, not a DOM mismatch.
|
|
145
|
+
*/
|
|
146
|
+
readonly LEAF_CLAIM_UNAVAILABLE: "OE_RUNTIME_LEAF_CLAIM_UNAVAILABLE";
|
|
147
|
+
/**
|
|
148
|
+
* A static sibling-range directory did not match its declaration, was
|
|
149
|
+
* claimed out of order, or was reclaimed after commitment. Detail lives in
|
|
150
|
+
* the message; cases do not each get a code. Not `LEAF_CLAIM_UNAVAILABLE`.
|
|
151
|
+
*/
|
|
152
|
+
readonly STATIC_RANGE_MISMATCH: "OE_RUNTIME_STATIC_RANGE_MISMATCH";
|
|
142
153
|
/** A fixed Part has no serialized anchor to bind. */
|
|
143
154
|
readonly SERIALIZED_ANCHOR_MISSING: "OE_RUNTIME_SERIALIZED_ANCHOR_MISSING";
|
|
144
155
|
/** A when/each Block Part needs the Block builders, which this entry does not install (#1548). */
|
package/src/errors.js
CHANGED
|
@@ -143,6 +143,17 @@ const RuntimeErrorCode = {
|
|
|
143
143
|
ROOT_WITHOUT_DOCUMENT: "OE_RUNTIME_ROOT_WITHOUT_DOCUMENT",
|
|
144
144
|
/** Fresh-DOM creation was handed a root that is not empty. */
|
|
145
145
|
FRESH_ROOT_NOT_EMPTY: "OE_RUNTIME_FRESH_ROOT_NOT_EMPTY",
|
|
146
|
+
/**
|
|
147
|
+
* `claimRecipe` was asked to claim a recipe that has no generated claim.
|
|
148
|
+
* This is a caller/recipe-shape failure, not a DOM mismatch.
|
|
149
|
+
*/
|
|
150
|
+
LEAF_CLAIM_UNAVAILABLE: "OE_RUNTIME_LEAF_CLAIM_UNAVAILABLE",
|
|
151
|
+
/**
|
|
152
|
+
* A static sibling-range directory did not match its declaration, was
|
|
153
|
+
* claimed out of order, or was reclaimed after commitment. Detail lives in
|
|
154
|
+
* the message; cases do not each get a code. Not `LEAF_CLAIM_UNAVAILABLE`.
|
|
155
|
+
*/
|
|
156
|
+
STATIC_RANGE_MISMATCH: "OE_RUNTIME_STATIC_RANGE_MISMATCH",
|
|
146
157
|
/** A fixed Part has no serialized anchor to bind. */
|
|
147
158
|
SERIALIZED_ANCHOR_MISSING: "OE_RUNTIME_SERIALIZED_ANCHOR_MISSING",
|
|
148
159
|
/** A when/each Block Part needs the Block builders, which this entry does not install (#1548). */
|
package/src/framework.d.ts
CHANGED
|
@@ -151,9 +151,8 @@ export interface RouteEntry {
|
|
|
151
151
|
export type Middleware = (request: Request, next: () => Promise<Response>) => Promise<Response>;
|
|
152
152
|
/**
|
|
153
153
|
* The adapter-facing framework options: where routes and islands
|
|
154
|
-
* live,
|
|
155
|
-
*
|
|
156
|
-
* request-time middleware switches.
|
|
154
|
+
* live, the default layout and named-layout declarations, the document
|
|
155
|
+
* `<html>`/head injection channels, and the request-time middleware switches.
|
|
157
156
|
*
|
|
158
157
|
* Every field is optional; the adapter applies its documented default. This is
|
|
159
158
|
* the type an application config file's default export is checked against, so
|
|
@@ -161,15 +160,11 @@ export type Middleware = (request: Request, next: () => Promise<Response>) => Pr
|
|
|
161
160
|
*/
|
|
162
161
|
export interface FrameworkOptions {
|
|
163
162
|
/**
|
|
164
|
-
* Page renderer selection
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* @lit-labs/ssr and hydrates them with @lit-labs/ssr-client. Routing,
|
|
168
|
-
* loaders, actions, form enhancement and morphing are shared; only page
|
|
169
|
-
* rendering and the client claim layer fork. 'lit' currently requires
|
|
170
|
-
* `layout: false` (no compiled layout); the build fails closed otherwise.
|
|
163
|
+
* Page renderer selection. The compiled native renderer is the only one
|
|
164
|
+
* supported; omit this key. A retired `'lit'` value is rejected with an
|
|
165
|
+
* explicit migration error at the config boundary (ADR-0152, 2026-11-08).
|
|
171
166
|
*/
|
|
172
|
-
renderer?: 'native'
|
|
167
|
+
renderer?: 'native';
|
|
173
168
|
/** Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`. */
|
|
174
169
|
routesDir?: string;
|
|
175
170
|
/** Directory island modules are discovered in. Defaults to `app/islands`. */
|
package/src/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { CompatibilityClassification, CompatibilityTier, ComponentLayer, Framewo
|
|
|
3
3
|
import { AuthoringErrorCode, ClaimErrorCode, CompilerErrorCode, ContextErrorCode, DEFAULT_RENDER_ERROR_CODE, ERROR_PREFIX, EachKeyErrorCode, ErrorCode, ErrorPhase, ErrorSeverity, ErrorTelemetryHook, FacadeErrorCode, KernelErrorCode, OpenElementError, OpenElementErrorOptions, ProgramErrorCode, RUNTIME_MESSAGES_ENABLED, RuntimeErrorCode, ServerErrorCode, StyleErrorCode, frameworkError, raiseFrameworkError } from "./errors.js";
|
|
4
4
|
import { HydrationHint, RenderError, SsrAdmissionDecision } from "./render.js";
|
|
5
5
|
import { VOID_TAGS } from "./void-tags.js";
|
|
6
|
-
import {
|
|
6
|
+
import { CemPropertyMetadata, CompiledCemMetadata, CompiledElementMetadata, CompiledPropertyMetadata, ConditionOperator, DATA_OE_LIGHT, ItemEventBinding, PART_PROGRAM_VERSION, PartProgram, PartProgramV2, ProgramAttrPart, ProgramBlockRecord, ProgramBoolPart, ProgramClassPart, ProgramCondition, ProgramDependencyRecord, ProgramEachPart, ProgramElementNode, ProgramEventAction, ProgramEventPart, ProgramHtmlPart, ProgramItemValueNode, ProgramLocation, ProgramLocationRecord, ProgramPart, ProgramPartAnchorNode, ProgramPosition, ProgramPropPart, ProgramRefPart, ProgramRoot, ProgramSourceKind, ProgramSourceMap, ProgramSourceRange, ProgramSourceRecord, ProgramStylePart, ProgramTextNode, ProgramTextPart, ProgramTreeNode, ProgramWhenPart, PropertyValueType, RootMode, STATIC_STYLES_MARKER, SerializableValue, conditionLiteralAllowed, isAttributeName, partAnchorEndMarker, partAnchorMarker, validatePartProgram } from "./part-program.js";
|
|
7
7
|
import { ApiRouteDecl, BuildArtifacts, BuildClientAsset, BuildI18nOptions, BuildIslandInput, BuildManifestArtifact, BuildOutputOptions, BuildPackageIslandOptions, BuildPageArtifact, BuildPlan, BuildRouteInput, ClientIslandEntry, CorsOriginConfig, CspConfig, DocumentConfig, EntryDescriptor, ImportDecl, IslandDecl, IslandDeliveryStrategy, IslandModuleIdentity, LayoutDecl, LayoutPlan, MiddlewareDecl, MiddlewareScopeDecl, PageRouteDecl, RendererDecl, ResolvedLayout, RouteInfoEntry, SpeculationRulesOptions, SsgBehaviorOptions, SsgPageOutput, SsgRenderEvidence, SsgRenderOptions, SsgRenderSummary, SsrAdmissionPlan, SsrBundle, StaticComponentDecl, StreamRouteManifest } from "./ssg.js";
|
|
8
8
|
import { ClientAssetManifest, ClientIslandAsset, EMPTY_CLIENT_ASSET_MANIFEST, serializeClientAssetsModule } from "./client-assets.js";
|
|
9
9
|
import { ACTION_FETCH_HEADER, Action, ActionContext, ActionResult, Loader, LoaderContext, PROBLEM_JSON_MEDIA_TYPE, ProblemDetails, ServerRouteContext, ServerRouteMetadata } from "./data.js";
|
|
@@ -15,9 +15,9 @@ import { IslandOptions, IslandTransformOptions, IslandTransformResult } from "./
|
|
|
15
15
|
import { CemCompatibilityReport, OpenElementAttribute, OpenElementCssPart, OpenElementDeclaration, OpenElementEvent, OpenElementExtensions, OpenElementPackageManifest, OpenElementSlot, OpenElementTailwindDeclaration } from "./manifest.js";
|
|
16
16
|
import { ROUTER_MODULE_VOCABULARY } from "./module-vocabulary.js";
|
|
17
17
|
import { IDLE_FALLBACK_TIMEOUT_MS, MAX_ACTION_BODY_BYTES, MAX_COMPOSITION_DEPTH, STREAM_MAX_FIELDS, STREAM_MAX_OWNERS, STREAM_MAX_PAYLOAD_LENGTH, STREAM_MAX_SEED_PROPERTIES, STREAM_TIMEOUT_MS } from "./policy.js";
|
|
18
|
-
import { ENTRY_REGISTRATION_OWNERS, SSR_REGISTRY_ORIGINAL_DEFINE, SSR_REGISTRY_STUB_MARKER } from "./registry-markers.js";
|
|
18
|
+
import { ENTRY_REGISTRATION_OWNERS, SSR_REGISTRY_GENERATED_HOSTS, SSR_REGISTRY_ORIGINAL_DEFINE, SSR_REGISTRY_STUB_MARKER } from "./registry-markers.js";
|
|
19
19
|
import { OpenElementRequestHandler, RuntimeAdapter, RuntimeAdapterOptions, RuntimeContext } from "./runtime.js";
|
|
20
20
|
import { ReadonlySignal, SIGNAL_BRAND, Signal, SignalEngine, SignalLike, Unsubscribe, WritableSignal } from "./signal.js";
|
|
21
21
|
import { STREAM_FRAME_FORBIDDEN_TAGS, STREAM_FRAME_UNSAFE_URL, STREAM_FRAME_URL_ATTRIBUTES, STREAM_FRAME_URL_CONTROL_MAX, unsafeStreamFrameAttribute } from "./stream-frame-policy.js";
|
|
22
|
-
import { STYLE_SHEET_LIVE, STYLE_SHEET_READY, STYLE_SHEET_URL, StyleSheetLike, StyleSheetRule } from "./style-sheet.js";
|
|
23
|
-
export { ACTION_FETCH_HEADER, Action, ActionContext, ActionResult, ApiRouteDecl, AuthoringErrorCode, BuildArtifacts, BuildClientAsset, BuildI18nOptions, BuildIslandInput, BuildManifestArtifact, BuildOutputOptions, BuildPackageIslandOptions, BuildPageArtifact, BuildPlan, BuildRouteInput,
|
|
22
|
+
import { NESTED_HOST_EXPANDER, STYLE_SHEET_LIVE, STYLE_SHEET_READY, STYLE_SHEET_URL, StyleSheetLike, StyleSheetRule } from "./style-sheet.js";
|
|
23
|
+
export { ACTION_FETCH_HEADER, Action, ActionContext, ActionResult, ApiRouteDecl, AuthoringErrorCode, BuildArtifacts, BuildClientAsset, BuildI18nOptions, BuildIslandInput, BuildManifestArtifact, BuildOutputOptions, BuildPackageIslandOptions, BuildPageArtifact, BuildPlan, BuildRouteInput, CemCompatibilityReport, CemPropertyMetadata, ClaimErrorCode, ClientAssetManifest, ClientIslandAsset, ClientIslandEntry, CompatibilityClassification, CompatibilityTier, CompiledCemMetadata, CompiledElementMetadata, CompiledPropertyMetadata, CompilerErrorCode, ComponentLayer, ConditionOperator, ContextErrorCode, CorsOriginConfig, CspConfig, DATA_OE_LIGHT, DEFAULT_RENDER_ERROR_CODE, DIAGNOSTIC_REPORT_FORMAT, DiagnosticEnvelope, DiagnosticPhase, DiagnosticReport, DiagnosticReportFormat, DiagnosticReportParseError, DiagnosticSeverity, DocumentConfig, EMPTY_CLIENT_ASSET_MANIFEST, ENTRY_REGISTRATION_OWNERS, ERROR_PREFIX, EachKeyErrorCode, EntryDescriptor, ErrorCode, ErrorPhase, ErrorSeverity, ErrorTelemetryHook, FORBIDDEN_ATTRIBUTE_NAMES, FORBIDDEN_PROPERTY_NAMES, FacadeErrorCode, ForbiddenSinkKind, FrameworkOptions, HYDRATION_STRATEGIES, HydrationHint, HydrationStrategy, IDLE_FALLBACK_TIMEOUT_MS, ISLAND_ADMISSION, ImportDecl, IslandDecl, IslandDeliveryStrategy, IslandModuleIdentity, IslandOptions, IslandTransformOptions, IslandTransformResult, ItemEventBinding, KernelErrorCode, LayoutConfig, LayoutDecl, LayoutPlan, Loader, LoaderContext, LocalePath, MAX_ACTION_BODY_BYTES, MAX_COMPOSITION_DEPTH, Middleware, MiddlewareDecl, MiddlewareScopeDecl, ModuleVocabularyDescriptor, NESTED_HOST_EXPANDER, OpenElementAttribute, OpenElementBlogOptions, OpenElementBuildContextLike, OpenElementCssPart, OpenElementDeclaration, OpenElementError, OpenElementErrorOptions, OpenElementEvent, OpenElementExtensions, OpenElementHeaderNavLink, OpenElementI18nContextOptions, OpenElementNavSection, OpenElementPackageManifest, OpenElementRequestHandler, OpenElementRouteKind, OpenElementRouteNode, OpenElementSlot, OpenElementTailwindDeclaration, PART_PROGRAM_VERSION, PROBLEM_JSON_MEDIA_TYPE, PageRouteDecl, PartProgram, PartProgramV2, ProblemDetails, ProgramAttrPart, ProgramBlockRecord, ProgramBoolPart, ProgramClassPart, ProgramCondition, ProgramDependencyRecord, ProgramEachPart, ProgramElementNode, ProgramErrorCode, ProgramEventAction, ProgramEventPart, ProgramHtmlPart, ProgramItemValueNode, ProgramLocation, ProgramLocationRecord, ProgramPart, ProgramPartAnchorNode, ProgramPosition, ProgramPropPart, ProgramRefPart, ProgramRoot, ProgramSourceKind, ProgramSourceMap, ProgramSourceRange, ProgramSourceRecord, ProgramStylePart, ProgramTextNode, ProgramTextPart, ProgramTreeNode, ProgramWhenPart, PropertyValueType, RAW_TEXT_TAGS, ROUTER_MODULE_VOCABULARY, RUNTIME_MESSAGES_ENABLED, ReadonlySignal, RenderError, RendererDecl, ResolvedLayout, RootMode, RouteEntry, RouteInfoEntry, RuntimeAdapter, RuntimeAdapterOptions, RuntimeContext, RuntimeErrorCode, SIGNAL_BRAND, SSR_REGISTRY_GENERATED_HOSTS, SSR_REGISTRY_ORIGINAL_DEFINE, SSR_REGISTRY_STUB_MARKER, STATIC_STYLES_MARKER, STREAM_FRAME_FORBIDDEN_TAGS, STREAM_FRAME_UNSAFE_URL, STREAM_FRAME_URL_ATTRIBUTES, STREAM_FRAME_URL_CONTROL_MAX, STREAM_MAX_FIELDS, STREAM_MAX_OWNERS, STREAM_MAX_PAYLOAD_LENGTH, STREAM_MAX_SEED_PROPERTIES, STREAM_TIMEOUT_MS, STYLE_SHEET_LIVE, STYLE_SHEET_READY, STYLE_SHEET_URL, SafeHtml, SerializableValue, ServerErrorCode, ServerRouteContext, ServerRouteMetadata, Signal, SignalEngine, SignalLike, SpecialFileType, SpeculationRulesOptions, SsgBehaviorOptions, SsgPageOutput, SsgRenderEvidence, SsgRenderOptions, SsgRenderSummary, SsrAdmissionDecision, SsrAdmissionPlan, SsrBundle, StaticComponentDecl, StaticSidecarDescriptor, StrategySource, StreamRouteManifest, StyleErrorCode, StyleSheetLike, StyleSheetRule, UnsafeHtml, Unsubscribe, VOID_TAGS, WritableSignal, camelToKebab, conditionLiteralAllowed, diagnosticReport, errorToEnvelope, forbiddenSinkReason, frameworkError, isAttributeName, isSafeAttributeName, parseDiagnosticReport, partAnchorEndMarker, partAnchorMarker, raiseFrameworkError, serializeClientAssetsModule, serializeDiagnosticReport, unsafeStreamFrameAttribute, validatePartProgram };
|
package/src/index.js
CHANGED
|
@@ -11,13 +11,13 @@ import "./manifest.js";
|
|
|
11
11
|
import "./module-descriptors.js";
|
|
12
12
|
import { ROUTER_MODULE_VOCABULARY } from "./module-vocabulary.js";
|
|
13
13
|
import { VOID_TAGS } from "./void-tags.js";
|
|
14
|
-
import {
|
|
14
|
+
import { DATA_OE_LIGHT, PART_PROGRAM_VERSION, STATIC_STYLES_MARKER, conditionLiteralAllowed, isAttributeName, partAnchorEndMarker, partAnchorMarker, validatePartProgram } from "./part-program.js";
|
|
15
15
|
import { IDLE_FALLBACK_TIMEOUT_MS, MAX_ACTION_BODY_BYTES, MAX_COMPOSITION_DEPTH, STREAM_MAX_FIELDS, STREAM_MAX_OWNERS, STREAM_MAX_PAYLOAD_LENGTH, STREAM_MAX_SEED_PROPERTIES, STREAM_TIMEOUT_MS } from "./policy.js";
|
|
16
|
-
import { ENTRY_REGISTRATION_OWNERS, SSR_REGISTRY_ORIGINAL_DEFINE, SSR_REGISTRY_STUB_MARKER } from "./registry-markers.js";
|
|
16
|
+
import { ENTRY_REGISTRATION_OWNERS, SSR_REGISTRY_GENERATED_HOSTS, SSR_REGISTRY_ORIGINAL_DEFINE, SSR_REGISTRY_STUB_MARKER } from "./registry-markers.js";
|
|
17
17
|
import "./render.js";
|
|
18
18
|
import "./runtime.js";
|
|
19
19
|
import { SIGNAL_BRAND } from "./signal.js";
|
|
20
20
|
import "./ssg.js";
|
|
21
21
|
import { STREAM_FRAME_FORBIDDEN_TAGS, STREAM_FRAME_UNSAFE_URL, STREAM_FRAME_URL_ATTRIBUTES, STREAM_FRAME_URL_CONTROL_MAX, unsafeStreamFrameAttribute } from "./stream-frame-policy.js";
|
|
22
|
-
import { STYLE_SHEET_LIVE, STYLE_SHEET_READY, STYLE_SHEET_URL } from "./style-sheet.js";
|
|
23
|
-
export { ACTION_FETCH_HEADER, AuthoringErrorCode,
|
|
22
|
+
import { NESTED_HOST_EXPANDER, STYLE_SHEET_LIVE, STYLE_SHEET_READY, STYLE_SHEET_URL } from "./style-sheet.js";
|
|
23
|
+
export { ACTION_FETCH_HEADER, AuthoringErrorCode, ClaimErrorCode, CompilerErrorCode, ContextErrorCode, DATA_OE_LIGHT, DEFAULT_RENDER_ERROR_CODE, DIAGNOSTIC_REPORT_FORMAT, DiagnosticReportParseError, EMPTY_CLIENT_ASSET_MANIFEST, ENTRY_REGISTRATION_OWNERS, ERROR_PREFIX, EachKeyErrorCode, ErrorCode, FORBIDDEN_ATTRIBUTE_NAMES, FORBIDDEN_PROPERTY_NAMES, FacadeErrorCode, HYDRATION_STRATEGIES, IDLE_FALLBACK_TIMEOUT_MS, ISLAND_ADMISSION, KernelErrorCode, MAX_ACTION_BODY_BYTES, MAX_COMPOSITION_DEPTH, NESTED_HOST_EXPANDER, OpenElementError, PART_PROGRAM_VERSION, PROBLEM_JSON_MEDIA_TYPE, ProgramErrorCode, RAW_TEXT_TAGS, ROUTER_MODULE_VOCABULARY, RUNTIME_MESSAGES_ENABLED, RuntimeErrorCode, SIGNAL_BRAND, SSR_REGISTRY_GENERATED_HOSTS, SSR_REGISTRY_ORIGINAL_DEFINE, SSR_REGISTRY_STUB_MARKER, STATIC_STYLES_MARKER, STREAM_FRAME_FORBIDDEN_TAGS, STREAM_FRAME_UNSAFE_URL, STREAM_FRAME_URL_ATTRIBUTES, STREAM_FRAME_URL_CONTROL_MAX, STREAM_MAX_FIELDS, STREAM_MAX_OWNERS, STREAM_MAX_PAYLOAD_LENGTH, STREAM_MAX_SEED_PROPERTIES, STREAM_TIMEOUT_MS, STYLE_SHEET_LIVE, STYLE_SHEET_READY, STYLE_SHEET_URL, ServerErrorCode, StyleErrorCode, VOID_TAGS, camelToKebab, conditionLiteralAllowed, diagnosticReport, errorToEnvelope, forbiddenSinkReason, frameworkError, isAttributeName, isSafeAttributeName, parseDiagnosticReport, partAnchorEndMarker, partAnchorMarker, raiseFrameworkError, serializeClientAssetsModule, serializeDiagnosticReport, unsafeStreamFrameAttribute, validatePartProgram };
|
package/src/manifest.d.ts
CHANGED
|
@@ -63,6 +63,37 @@ export interface OpenElementExtensions {
|
|
|
63
63
|
module?: string;
|
|
64
64
|
export?: string;
|
|
65
65
|
tailwind?: OpenElementTailwindDeclaration;
|
|
66
|
+
/**
|
|
67
|
+
* The host root a generated-element declaration was compiled with. Absent for
|
|
68
|
+
* a class declaration (its descriptor owns the root) and for a generated
|
|
69
|
+
* declaration whose sidecar declares none (the descriptor default is light).
|
|
70
|
+
*/
|
|
71
|
+
root?: 'light' | 'shadow' | 'closed';
|
|
72
|
+
/**
|
|
73
|
+
* The authored package-relative `.css` specifiers a generated SHADOW host
|
|
74
|
+
* declares, published so a consuming build can emit the sheet and hand its
|
|
75
|
+
* URL to the DSD style-link carrier. Absent when the component declares none;
|
|
76
|
+
* class declarations deliver their sheets through `static styles` instead.
|
|
77
|
+
*/
|
|
78
|
+
styles?: readonly string[];
|
|
79
|
+
/**
|
|
80
|
+
* The compiler-emitted SSR host producer's export name
|
|
81
|
+
* (`<Component>__ssrHost`) for a generated declaration whose root is
|
|
82
|
+
* `shadow`.
|
|
83
|
+
*
|
|
84
|
+
* A consuming build cannot otherwise learn it: the name is the compiler's
|
|
85
|
+
* return-only `ssrHostExport` metadata, and re-deriving it from a naming
|
|
86
|
+
* convention inside the router would be exactly the drift ADR-0182 forbids
|
|
87
|
+
* ("read the compiler's return value, never re-derive it"). With it, a
|
|
88
|
+
* package island can be paired through the SAME `__registerSsrIsland` channel
|
|
89
|
+
* a local island uses, so its SSR emits the DSD template and the client can
|
|
90
|
+
* claim it.
|
|
91
|
+
*
|
|
92
|
+
* Absent for a class declaration and for a LIGHT-root generated declaration
|
|
93
|
+
* (a light root serializes through the shell-attached `__ssr` static instead,
|
|
94
|
+
* which the entry resolves from the class).
|
|
95
|
+
*/
|
|
96
|
+
ssrHostExport?: string;
|
|
66
97
|
}
|
|
67
98
|
/** One custom element declaration in a package manifest: tag, members and delivery metadata. */
|
|
68
99
|
export interface OpenElementDeclaration {
|
package/src/module-vocabulary.js
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
//#region src/module-vocabulary.ts
|
|
2
2
|
/** The module vocabulary router injects into `analyzeModuleSemantics`. */
|
|
3
|
-
const ROUTER_MODULE_VOCABULARY = [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
kind: "page-definition"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
moduleSpecifier: "@openelement/router",
|
|
16
|
-
exportName: "defineElement",
|
|
17
|
-
kind: "element-registration"
|
|
18
|
-
}
|
|
19
|
-
];
|
|
3
|
+
const ROUTER_MODULE_VOCABULARY = [{
|
|
4
|
+
moduleSpecifier: "@openelement/router",
|
|
5
|
+
exportName: "definePage",
|
|
6
|
+
kind: "page-definition"
|
|
7
|
+
}, {
|
|
8
|
+
moduleSpecifier: "@openelement/router",
|
|
9
|
+
exportName: "defineElement",
|
|
10
|
+
kind: "element-registration"
|
|
11
|
+
}];
|
|
20
12
|
//#endregion
|
|
21
13
|
export { ROUTER_MODULE_VOCABULARY };
|
package/src/part-program.d.ts
CHANGED
|
@@ -2,20 +2,6 @@ import { VOID_TAGS } from "./void-tags.js";
|
|
|
2
2
|
//#region src/part-program.d.ts
|
|
3
3
|
/** The Part Program IR version this package defines (currently v2). */
|
|
4
4
|
export declare const PART_PROGRAM_VERSION: 2;
|
|
5
|
-
/**
|
|
6
|
-
* Version of the compiled-module ABI: the statics a generated module carries
|
|
7
|
-
* (`__partProgram`, `__compiledProperties`, `__elementMetadata`,
|
|
8
|
-
* `__observedAttributes`, `__computedFields`) and the runtime facade binds.
|
|
9
|
-
* Bump when the generated-module contract changes shape; generated artifacts
|
|
10
|
-
* stamp both this and PART_PROGRAM_VERSION so consumers can tell format drift
|
|
11
|
-
* from release drift.
|
|
12
|
-
*
|
|
13
|
-
* v2: platform lifecycle callback bodies are emitted inside a
|
|
14
|
-
* boundary-capture wrapper calling the base class's `_captureError` — a
|
|
15
|
-
* generated module now requires a runtime facade carrying that protected
|
|
16
|
-
* method (the v1 shape emitted the bodies verbatim).
|
|
17
|
-
*/
|
|
18
|
-
export declare const COMPILED_MODULE_ABI_VERSION: 2;
|
|
19
5
|
/** How the compiled component attaches its root: light DOM or a shadow root. */
|
|
20
6
|
export type RootMode = 'light' | 'shadow-open' | 'shadow-closed';
|
|
21
7
|
/** The root of one program tree: element, part anchor, or text. */
|
package/src/part-program.js
CHANGED
|
@@ -18,20 +18,6 @@ import { VOID_TAGS } from "./void-tags.js";
|
|
|
18
18
|
/** The Part Program IR version this package defines (currently v2). */
|
|
19
19
|
const PART_PROGRAM_VERSION = 2;
|
|
20
20
|
/**
|
|
21
|
-
* Version of the compiled-module ABI: the statics a generated module carries
|
|
22
|
-
* (`__partProgram`, `__compiledProperties`, `__elementMetadata`,
|
|
23
|
-
* `__observedAttributes`, `__computedFields`) and the runtime facade binds.
|
|
24
|
-
* Bump when the generated-module contract changes shape; generated artifacts
|
|
25
|
-
* stamp both this and PART_PROGRAM_VERSION so consumers can tell format drift
|
|
26
|
-
* from release drift.
|
|
27
|
-
*
|
|
28
|
-
* v2: platform lifecycle callback bodies are emitted inside a
|
|
29
|
-
* boundary-capture wrapper calling the base class's `_captureError` — a
|
|
30
|
-
* generated module now requires a runtime facade carrying that protected
|
|
31
|
-
* method (the v1 shape emitted the bodies verbatim).
|
|
32
|
-
*/
|
|
33
|
-
const COMPILED_MODULE_ABI_VERSION = 2;
|
|
34
|
-
/**
|
|
35
21
|
* Operator/literal compatibility for when-Block tests (issue #1372). Both
|
|
36
22
|
* wire validators (this module and the server serializer's shared validator)
|
|
37
23
|
* close the space through this one predicate:
|
|
@@ -800,4 +786,4 @@ function validatePartProgram(raw) {
|
|
|
800
786
|
}
|
|
801
787
|
}
|
|
802
788
|
//#endregion
|
|
803
|
-
export {
|
|
789
|
+
export { DATA_OE_LIGHT, PART_PROGRAM_VERSION, STATIC_STYLES_MARKER, VOID_TAGS, conditionLiteralAllowed, isAttributeName, partAnchorEndMarker, partAnchorMarker, validatePartProgram };
|
|
@@ -33,7 +33,20 @@ export declare const ENTRY_REGISTRATION_OWNERS = "__openEntryDefined";
|
|
|
33
33
|
* registry outlives vite dev SSR module re-evaluations, so without this the
|
|
34
34
|
* second evaluation would capture the already-wrapped `define` as its
|
|
35
35
|
* "original" and every forced re-registration would silently early-return
|
|
36
|
-
* through the previous wrapper (#
|
|
36
|
+
* through the previous wrapper (#952 dev re-evaluation).
|
|
37
37
|
*/
|
|
38
38
|
export declare const SSR_REGISTRY_ORIGINAL_DEFINE = "__openElementOrigDefine";
|
|
39
|
+
/**
|
|
40
|
+
* Property on the SSR registry holding the generated-entry host pairing table
|
|
41
|
+
* (tag -> the compiler-emitted generated host renderer): written atomically by
|
|
42
|
+
* the registry guard together with the class registration (M11) and read by
|
|
43
|
+
* `@openelement/element`'s server serializer nested-composition seam.
|
|
44
|
+
*
|
|
45
|
+
* It lives on the registry (not on the class and not on the module namespace)
|
|
46
|
+
* for the same reasons the ownership markers do: one writer (the generated
|
|
47
|
+
* entry's guard), one reader (Element's serializer), no class static / suffix
|
|
48
|
+
* scan / runtime module-shape read, and the pairing survives vite dev SSR
|
|
49
|
+
* module re-evaluations together with the class it belongs to.
|
|
50
|
+
*/
|
|
51
|
+
export declare const SSR_REGISTRY_GENERATED_HOSTS = "__openElementGeneratedHosts";
|
|
39
52
|
//#endregion
|
package/src/registry-markers.js
CHANGED
|
@@ -33,8 +33,21 @@ const ENTRY_REGISTRATION_OWNERS = "__openEntryDefined";
|
|
|
33
33
|
* registry outlives vite dev SSR module re-evaluations, so without this the
|
|
34
34
|
* second evaluation would capture the already-wrapped `define` as its
|
|
35
35
|
* "original" and every forced re-registration would silently early-return
|
|
36
|
-
* through the previous wrapper (#
|
|
36
|
+
* through the previous wrapper (#952 dev re-evaluation).
|
|
37
37
|
*/
|
|
38
38
|
const SSR_REGISTRY_ORIGINAL_DEFINE = "__openElementOrigDefine";
|
|
39
|
+
/**
|
|
40
|
+
* Property on the SSR registry holding the generated-entry host pairing table
|
|
41
|
+
* (tag -> the compiler-emitted generated host renderer): written atomically by
|
|
42
|
+
* the registry guard together with the class registration (M11) and read by
|
|
43
|
+
* `@openelement/element`'s server serializer nested-composition seam.
|
|
44
|
+
*
|
|
45
|
+
* It lives on the registry (not on the class and not on the module namespace)
|
|
46
|
+
* for the same reasons the ownership markers do: one writer (the generated
|
|
47
|
+
* entry's guard), one reader (Element's serializer), no class static / suffix
|
|
48
|
+
* scan / runtime module-shape read, and the pairing survives vite dev SSR
|
|
49
|
+
* module re-evaluations together with the class it belongs to.
|
|
50
|
+
*/
|
|
51
|
+
const SSR_REGISTRY_GENERATED_HOSTS = "__openElementGeneratedHosts";
|
|
39
52
|
//#endregion
|
|
40
|
-
export { ENTRY_REGISTRATION_OWNERS, SSR_REGISTRY_ORIGINAL_DEFINE, SSR_REGISTRY_STUB_MARKER };
|
|
53
|
+
export { ENTRY_REGISTRATION_OWNERS, SSR_REGISTRY_GENERATED_HOSTS, SSR_REGISTRY_ORIGINAL_DEFINE, SSR_REGISTRY_STUB_MARKER };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/src/ssg.d.ts
CHANGED
|
@@ -203,6 +203,34 @@ export interface StaticComponentDecl {
|
|
|
203
203
|
modulePath: string;
|
|
204
204
|
/** Compiler-owned interaction events; empty means no inferred browser entry. */
|
|
205
205
|
compilerInteractionEvents: string[];
|
|
206
|
+
/**
|
|
207
|
+
* The compiler-emitted SSR host producer export (`<Name>__ssrHost`) when this
|
|
208
|
+
* static component belongs to the GENERATED lane, or absent for a class.
|
|
209
|
+
*
|
|
210
|
+
* Same fact, same rule as {@linkcode LayoutDecl.generatedHostExport}: a
|
|
211
|
+
* generated component carries no Part Program, so a class-only registration
|
|
212
|
+
* fails every render with PROGRAM_MISSING. The entry therefore registers the
|
|
213
|
+
* generated host PAIR. The name is the compiler's return value, never a
|
|
214
|
+
* `${X}__ssrHost` convention (ADR-0182 forbids re-deriving it).
|
|
215
|
+
*/
|
|
216
|
+
generatedHostExport?: string;
|
|
217
|
+
/**
|
|
218
|
+
* The descriptor root a page-local GENERATED component declares (P-2,
|
|
219
|
+
* 2026-11-21). A shadow root's class candidates need the shared COMPONENT
|
|
220
|
+
* stylesheet linked inside the DSD template; a light root's belong to the
|
|
221
|
+
* document sheet. Absent for a class component (its `static styles` scope
|
|
222
|
+
* carries the same fact).
|
|
223
|
+
*/
|
|
224
|
+
root?: 'light' | 'shadow' | 'closed';
|
|
225
|
+
/**
|
|
226
|
+
* True when this record is a PAGE COMPONENT (the module a route passes to
|
|
227
|
+
* `definePage`), not a nested component. A page root is rendered by the route
|
|
228
|
+
* handler, so the entry must register its host pair even though no JSX
|
|
229
|
+
* reference to the tag exists anywhere.
|
|
230
|
+
*/
|
|
231
|
+
pageComponent?: boolean;
|
|
232
|
+
/** A generated host reached through a page component’s side-effect imports. */
|
|
233
|
+
pageComponentDependency?: boolean;
|
|
206
234
|
}
|
|
207
235
|
/** The build-time SSR admission decisions per component tag. */
|
|
208
236
|
export interface SsrAdmissionPlan {
|
|
@@ -246,6 +274,17 @@ export interface LayoutDecl {
|
|
|
246
274
|
tagName: string;
|
|
247
275
|
importPath: string;
|
|
248
276
|
props: Record<string, unknown>;
|
|
277
|
+
/**
|
|
278
|
+
* The compiler-emitted SSR host producer export (`<Name>__ssrHost`) when the
|
|
279
|
+
* layout module is a GENERATED element, or absent when it is a class.
|
|
280
|
+
*
|
|
281
|
+
* A generated layout cannot be registered class-only: a generated element
|
|
282
|
+
* carries no Part Program, so `renderToString` fails with PROGRAM_MISSING on
|
|
283
|
+
* every render. The entry therefore registers the generated host PAIR — the
|
|
284
|
+
* same channel an island uses. The name is the compiler's return value, never
|
|
285
|
+
* a `${X}__ssrHost` convention (ADR-0182 forbids re-deriving it).
|
|
286
|
+
*/
|
|
287
|
+
generatedHostExport?: string;
|
|
249
288
|
}
|
|
250
289
|
/** The resolved layout for one plan slot: disabled (false) or a full declaration. */
|
|
251
290
|
export type ResolvedLayout = false | LayoutDecl;
|
|
@@ -258,12 +297,11 @@ export interface LayoutPlan {
|
|
|
258
297
|
export interface EntryDescriptor {
|
|
259
298
|
isSSG: boolean;
|
|
260
299
|
/**
|
|
261
|
-
* Page renderer selection
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
* Loader/action/protocol codegen never forks.
|
|
300
|
+
* Page renderer selection. Only the compiled native renderer exists; absent
|
|
301
|
+
* or 'native' keeps the renderToString page path byte-identical. Loader,
|
|
302
|
+
* action and protocol codegen never fork on a renderer.
|
|
265
303
|
*/
|
|
266
|
-
renderer?: 'native'
|
|
304
|
+
renderer?: 'native';
|
|
267
305
|
imports: ImportDecl[];
|
|
268
306
|
middleware: MiddlewareDecl[];
|
|
269
307
|
/**
|
package/src/style-sheet.d.ts
CHANGED
|
@@ -58,4 +58,19 @@ export declare const STYLE_SHEET_URL = "__openElementStyleSheetUrl";
|
|
|
58
58
|
* interpolates this exact name.
|
|
59
59
|
*/
|
|
60
60
|
export declare const STYLE_SHEET_LIVE = "__openElementStyleSheetLive";
|
|
61
|
+
/**
|
|
62
|
+
* The compiler-private field a render's host record carries the nested-host
|
|
63
|
+
* expander under (P-6, 2026-11-21).
|
|
64
|
+
*
|
|
65
|
+
* A generated component's SSR producer routes every custom-element tag through
|
|
66
|
+
* the runtime's ONE `nestedHost` helper, which reads the expander off this
|
|
67
|
+
* record. The LIGHT root's producer has always supplied it; the SHADOW host
|
|
68
|
+
* producer did not, so a shadow page's inner components stayed bare tags while
|
|
69
|
+
* the class lane and the light lane both expanded theirs.
|
|
70
|
+
*
|
|
71
|
+
* It lives in the protocol for the same reason the sheet keys above do: the
|
|
72
|
+
* COMPILER emits the record and the RUNTIME reads it, and the compiler must not
|
|
73
|
+
* depend on an element-internal subpath to spell it. One literal, two ends.
|
|
74
|
+
*/
|
|
75
|
+
export declare const NESTED_HOST_EXPANDER = "__oe_nestedHost";
|
|
61
76
|
//#endregion
|
package/src/style-sheet.js
CHANGED
|
@@ -43,5 +43,20 @@ const STYLE_SHEET_URL = "__openElementStyleSheetUrl";
|
|
|
43
43
|
* interpolates this exact name.
|
|
44
44
|
*/
|
|
45
45
|
const STYLE_SHEET_LIVE = "__openElementStyleSheetLive";
|
|
46
|
+
/**
|
|
47
|
+
* The compiler-private field a render's host record carries the nested-host
|
|
48
|
+
* expander under (P-6, 2026-11-21).
|
|
49
|
+
*
|
|
50
|
+
* A generated component's SSR producer routes every custom-element tag through
|
|
51
|
+
* the runtime's ONE `nestedHost` helper, which reads the expander off this
|
|
52
|
+
* record. The LIGHT root's producer has always supplied it; the SHADOW host
|
|
53
|
+
* producer did not, so a shadow page's inner components stayed bare tags while
|
|
54
|
+
* the class lane and the light lane both expanded theirs.
|
|
55
|
+
*
|
|
56
|
+
* It lives in the protocol for the same reason the sheet keys above do: the
|
|
57
|
+
* COMPILER emits the record and the RUNTIME reads it, and the compiler must not
|
|
58
|
+
* depend on an element-internal subpath to spell it. One literal, two ends.
|
|
59
|
+
*/
|
|
60
|
+
const NESTED_HOST_EXPANDER = "__oe_nestedHost";
|
|
46
61
|
//#endregion
|
|
47
|
-
export { STYLE_SHEET_LIVE, STYLE_SHEET_READY, STYLE_SHEET_URL };
|
|
62
|
+
export { NESTED_HOST_EXPANDER, STYLE_SHEET_LIVE, STYLE_SHEET_READY, STYLE_SHEET_URL };
|