@openelement/protocol 0.41.0-beta.2 → 1.0.0-alpha.11

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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -0
  3. package/package.json +90 -51
  4. package/src/app-model.d.ts +19 -0
  5. package/src/app-model.js +1 -0
  6. package/src/client-assets.d.ts +44 -0
  7. package/src/client-assets.js +24 -0
  8. package/src/data.d.ts +81 -11
  9. package/src/data.js +11 -7
  10. package/src/errors.d.ts +253 -14
  11. package/src/errors.js +275 -15
  12. package/src/forbidden-sinks.d.ts +60 -0
  13. package/src/forbidden-sinks.js +81 -0
  14. package/src/framework.d.ts +183 -99
  15. package/src/framework.js +13 -5
  16. package/src/index.d.ts +21 -19
  17. package/src/index.js +21 -20
  18. package/src/island-admission.d.ts +5 -0
  19. package/src/island-admission.js +9 -0
  20. package/src/island.d.ts +32 -19
  21. package/src/island.js +1 -4
  22. package/src/manifest.d.ts +15 -27
  23. package/src/manifest.js +1 -4
  24. package/src/module-descriptors.d.ts +40 -0
  25. package/src/module-descriptors.js +1 -0
  26. package/src/module-vocabulary.d.ts +5 -0
  27. package/src/module-vocabulary.js +21 -0
  28. package/src/part-program.d.ts +407 -0
  29. package/src/part-program.js +758 -0
  30. package/src/policy.d.ts +64 -0
  31. package/src/policy.js +65 -0
  32. package/src/registry-markers.d.ts +39 -0
  33. package/src/registry-markers.js +40 -0
  34. package/src/render.d.ts +29 -123
  35. package/src/render.js +1 -7
  36. package/src/runtime.d.ts +13 -4
  37. package/src/runtime.js +1 -8
  38. package/src/signal.d.ts +31 -7
  39. package/src/signal.js +5 -6
  40. package/src/ssg.d.ts +317 -151
  41. package/src/ssg.js +1 -7
  42. package/src/stream-frame-policy.d.ts +49 -0
  43. package/src/stream-frame-policy.js +108 -0
  44. package/src/style-sheet.d.ts +5 -1
  45. package/src/style-sheet.js +1 -8
  46. package/src/void-tags.d.ts +18 -0
  47. package/src/void-tags.js +34 -0
  48. package/src/context.d.ts +0 -25
  49. package/src/context.js +0 -7
  50. package/src/hydration-markers.d.ts +0 -25
  51. package/src/hydration-markers.js +0 -26
  52. package/src/isr.d.ts +0 -30
  53. package/src/isr.js +0 -4
  54. package/src/prop.d.ts +0 -46
  55. package/src/prop.js +0 -6
  56. package/src/vnode.d.ts +0 -19
  57. package/src/vnode.js +0 -9
@@ -0,0 +1,81 @@
1
+ //#region src/forbidden-sinks.ts
2
+ /**
3
+ * Forbidden sink names — the ONE canonical deny list for every Part Program
4
+ * boundary: the compiler semantic core, the protocol validator
5
+ * (internal/protocol/part-program.ts), and the compiled server/claim
6
+ * validator (internal/compiled/server/shared.ts).
7
+ *
8
+ * This module is import-free and host-free by design (same base-of-graph
9
+ * contract as void-tags.ts): all consumers import it, so a new
10
+ * forbidden sink cannot be enforced on one boundary and missed on another.
11
+ * This module owns the named-sink deny lists and the attribute-name policy
12
+ * built on them (the one shared safe-attribute-name predicate and the one
13
+ * camelCase→kebab-case casing rule); consumers delegate so the
14
+ * boundary cannot diverge.
15
+ *
16
+ * The lists are fail closed and case-insensitive (attribute and property
17
+ * names are compared lowercase, matching the HTML parser's name folding):
18
+ *
19
+ * - `FORBIDDEN_ATTRIBUTE_NAMES`: attribute names that must never be a static
20
+ * attribute or an `attr`/`bool` sink. `srcdoc` smuggles a full HTML
21
+ * document past attribute escaping; `innerHTML` is admissible only through
22
+ * the dedicated trusted-HTML `html` Part, never as a plain
23
+ * attribute name.
24
+ * - `FORBIDDEN_PROPERTY_NAMES`: `prop` sink names that would re-prototype or
25
+ * re-construct the target element (prototype-pollution primitives).
26
+ * - `RAW_TEXT_TAGS`: raw-text elements are outside the compiled grammar —
27
+ * their content cannot be escaped by the serializer.
28
+ */
29
+ const FORBIDDEN_ATTRIBUTE_NAMES = /* @__PURE__ */ new Set(["innerhtml", "srcdoc"]);
30
+ /** Property names the compiler refuses as @property declarations. */
31
+ const FORBIDDEN_PROPERTY_NAMES = /* @__PURE__ */ new Set([
32
+ "__proto__",
33
+ "constructor",
34
+ "prototype"
35
+ ]);
36
+ /** Elements whose text content must never be interpolated as markup. */
37
+ const RAW_TEXT_TAGS = /* @__PURE__ */ new Set(["script", "style"]);
38
+ /**
39
+ * Return a human-readable reason when `name` is a forbidden sink of `kind`,
40
+ * or null when the name is admissible. Unknown kinds fail closed with a
41
+ * reason instead of being waved through.
42
+ */
43
+ function forbiddenSinkReason(kind, name) {
44
+ switch (kind) {
45
+ case "attr":
46
+ case "bool":
47
+ if (FORBIDDEN_ATTRIBUTE_NAMES.has(name.toLowerCase())) return `attribute name ${JSON.stringify(name)} is a forbidden sink`;
48
+ return null;
49
+ case "prop":
50
+ if (FORBIDDEN_PROPERTY_NAMES.has(name.toLowerCase())) return `unsafe property sink name ${JSON.stringify(name)}`;
51
+ return null;
52
+ case "tag":
53
+ if (RAW_TEXT_TAGS.has(name)) return `raw-text element <${name}> is outside the compiled Part Program grammar`;
54
+ return null;
55
+ default: return `unknown sink kind ${JSON.stringify(String(kind))}`;
56
+ }
57
+ }
58
+ /**
59
+ * The one safe-attribute-name predicate (#1033, #602). Attribute *names* are
60
+ * not escaped on any render path, so a name must be valid HTML attribute-name
61
+ * grammar (blocks quote/space injection), must not be an event handler
62
+ * (`on*`, case-insensitive), and must not be a forbidden sink (`innerhtml`/
63
+ * `srcdoc` — case-insensitive). Every boundary that admits an attribute name
64
+ * — the compiler semantic core, the Part Program validator, the compiled
65
+ * server validator, and the SSR head/meta name checks — delegates here, so
66
+ * the rules cannot diverge per path.
67
+ */
68
+ function isSafeAttributeName(name) {
69
+ return /^[A-Za-z_:][A-Za-z0-9_.:-]*$/.test(name) && !/^on/i.test(name) && forbiddenSinkReason("attr", name) === null;
70
+ }
71
+ /**
72
+ * The one camelCase → kebab-case casing rule for custom-element attribute
73
+ * names, so `<x-el itemCount={5}>` round-trips as `item-count` on every
74
+ * boundary that derives an attribute name from a prop name: the compiler's
75
+ * property metadata, the SSR serializer, and the client attribute handling.
76
+ */
77
+ function camelToKebab(str) {
78
+ return str.replace(/([A-Z])/g, "-$1").toLowerCase();
79
+ }
80
+ //#endregion
81
+ export { FORBIDDEN_ATTRIBUTE_NAMES, FORBIDDEN_PROPERTY_NAMES, RAW_TEXT_TAGS, camelToKebab, forbiddenSinkReason, isSafeAttributeName };
@@ -1,27 +1,39 @@
1
+ //#region src/framework.d.ts
1
2
  /**
2
- * @openelement/protocol - Framework, build, app-shell, routing, and plugin
3
+ * framework.ts - Framework, build, app-shell, routing, and plugin
3
4
  * metadata contracts.
4
- */ import type { VNode } from "./vnode.js";
5
- /** API route context passed to simple handlers */ export interface OpenElementApiContext {
6
- request: Request;
7
- params: Record<string, string>;
8
- env: Record<string, string | undefined>;
9
- platform?: unknown;
10
- }
11
- /** Branded type: a string that has been HTML-escaped (safe for text content) */ export type SafeHtml = string & {
5
+ */
6
+ /** Branded type: a string that has been HTML-escaped (safe for text content) */
7
+ export type SafeHtml = string & {
12
8
  readonly __safeHtml: unique symbol;
13
9
  };
14
- /** Branded type: a string that is intentionally raw/untrusted HTML */ export type UnsafeHtml = string & {
10
+ /** Branded type: a string that is intentionally raw/untrusted HTML */
11
+ export type UnsafeHtml = string & {
15
12
  readonly __unsafeHtml: unique symbol;
16
13
  };
14
+ /**
15
+ * The delivery layer a component belongs to: fully static DSD markup
16
+ * ('dsd-static'), DSD markup with a client island ('dsd-interactive'), a
17
+ * client-only island with no SSR output ('pure-island'), or a light-DOM
18
+ * element ('light-dom'). Recorded per component in the build manifest and
19
+ * consumed by the hydration scheduler.
20
+ */
17
21
  export type ComponentLayer = 'dsd-static' | 'dsd-interactive' | 'pure-island' | 'light-dom';
18
- export type HydrationStrategy = 'load' | 'idle' | 'visible' | 'only';
22
+ /** Runtime list of supported hydration strategies; the single source of truth
23
+ * for the `HydrationStrategy` union. Consumed by island/registry validation and
24
+ * re-exported from the element root for app and build adapters. */
25
+ export declare const HYDRATION_STRATEGIES: readonly ["load", "idle", "visible", "only", "none"];
26
+ /** Island hydration trigger: 'load' | 'idle' | 'visible' | 'only'. */
27
+ export type HydrationStrategy = (typeof HYDRATION_STRATEGIES)[number];
28
+ /** Where an island's resolved hydration strategy came from. */
19
29
  export type StrategySource = 'default' | 'manifest' | 'component' | 'route';
20
- /** Blog options stored in the build context by @openelement/content. */ export interface OpenElementBlogOptions {
30
+ /** Blog options stored in the build context by @openelement/content. */
31
+ export interface OpenElementBlogOptions {
21
32
  contentDir?: string;
22
33
  basePath?: string;
23
34
  }
24
- /** Navigation section from @openelement/content. */ export interface OpenElementNavSection {
35
+ /** Navigation section from @openelement/content. */
36
+ export interface OpenElementNavSection {
25
37
  section: string;
26
38
  items: Array<{
27
39
  path: string;
@@ -29,16 +41,19 @@ export type StrategySource = 'default' | 'manifest' | 'component' | 'route';
29
41
  order?: number;
30
42
  }>;
31
43
  }
32
- /** Header navigation link. */ export interface OpenElementHeaderNavLink {
44
+ /** Header navigation link. */
45
+ export interface OpenElementHeaderNavLink {
33
46
  href: string;
34
47
  label: string;
35
48
  }
36
- /** i18n options stored in the build context by @openelement/i18n. */ export interface OpenElementI18nContextOptions {
49
+ /** i18n options stored in the build context by @openelement/i18n. */
50
+ export interface OpenElementI18nContextOptions {
37
51
  locales: string[];
38
52
  defaultLocale: string;
39
53
  [key: string]: unknown;
40
54
  }
41
- /** Minimal build context interface that sub-plugins can use. */ export interface OpenElementBuildContextLike {
55
+ /** Minimal build context interface that sub-plugins can use. */
56
+ export interface OpenElementBuildContextLike {
42
57
  plugins: {
43
58
  blogOptions: OpenElementBlogOptions | null;
44
59
  navSections: OpenElementNavSection[];
@@ -48,53 +63,133 @@ export type StrategySource = 'default' | 'manifest' | 'component' | 'route';
48
63
  [key: string]: unknown;
49
64
  };
50
65
  /** Register plugin data by name. Protocol level uses loose typing;
51
- * concrete implementations should tighten the generic constraint. */ registerPlugin(name: string, instance: unknown): void;
66
+ * concrete implementations should tighten the generic constraint. */
67
+ registerPlugin(name: string, instance: unknown): void;
52
68
  }
53
- export interface AppShellDefinition {
54
- tagName: string;
55
- import: string;
56
- props?: Record<string, unknown>;
57
- }
58
- export type AppShellConfig = false | 'default' | AppShellDefinition;
59
- export type LayoutsConfig = Record<string, AppShellConfig | undefined>;
69
+ /** Special file kinds the route scanner recognizes by filename: `renderer` and `middleware`. */
60
70
  export type SpecialFileType = 'renderer' | 'middleware';
61
- /** Locale-aware resolved path contract. */ export interface LocalePath {
71
+ /** Locale-aware resolved path contract. */
72
+ export interface LocalePath {
62
73
  locale: string;
63
74
  path: string;
64
75
  localizedPath: string;
65
76
  isDefaultLocalePath: boolean;
66
77
  }
78
+ /**
79
+ * Application shell declaration: `false` disables the shell entirely,
80
+ * `'default'` uses the built-in shell, and the object form names a tag with the
81
+ * module path that defines it (`import`, resolved like a
82
+ * {@link FrameworkOptions.middleware.use} entry) plus the compiled shell
83
+ * properties the router injects per route.
84
+ */
85
+ export type AppShellConfig = false | 'default' | {
86
+ tagName: string;
87
+ import: string;
88
+ props?: Record<string, unknown>;
89
+ };
90
+ type LayoutsConfig = Record<string, AppShellConfig | undefined>;
91
+ /**
92
+ * One route admitted by the scanner: URL `path`, source `filePath`, the
93
+ * route `type`, the generated variable name (`varName`) the entry binds it to,
94
+ * and the optional registration tag. {@link RouteEntry.definePage} and
95
+ * {@link RouteEntry.hasEnhancedForms} carry the two source-derived admission
96
+ * facts the generated entries branch on.
97
+ */
67
98
  export interface RouteEntry {
68
99
  path: string;
69
100
  filePath: string;
70
101
  type: 'page' | 'api' | 'island' | 'special';
71
102
  varName: string;
72
103
  tagName?: string;
73
- /** Source text captured during scanning when includeSource is enabled. */ source?: string;
104
+ /**
105
+ * True when the route module's default export is a definePage() definition
106
+ * (#960 — registration decoupling). The generated entry
107
+ * registers the page class under the path-derived fallback tag and IGNORES
108
+ * the tagName export for registration: on a definePage route the export
109
+ * only names a content element. Plain element routes keep tagName as their
110
+ * registration tag.
111
+ */
112
+ definePage?: boolean;
113
+ /** Source text captured during scanning when includeSource is enabled. */
114
+ source?: string;
115
+ /**
116
+ * True when the page route source carries data-open-enhance (#569): the
117
+ * client entry must ship the form-enhancement layer even when the
118
+ * app has zero islands.
119
+ */
120
+ hasEnhancedForms?: boolean;
74
121
  special?: SpecialFileType;
75
- revalidate?: number;
76
122
  params?: string[];
77
123
  }
124
+ /**
125
+ * Fetch middleware contract (#858): WinterCG shape,
126
+ * dialect-free — no Hono/h3 context object. Composed at the handler boundary
127
+ * in onion order (`use[0]` is outermost: it sees the request first and the
128
+ * response last), so it runs with identical semantics in the dev server, the
129
+ * `start` CLI, the e2e fixture server, and the Nitro production entry.
130
+ *
131
+ * A middleware may short-circuit by returning a Response without calling
132
+ * `next()`, or post-process the Response that `next()` returns.
133
+ *
134
+ * Module contract: a Middleware is the DEFAULT EXPORT of a module referenced
135
+ * from `middleware.use` by path (e.g. './app/middleware/auth.ts'). The
136
+ * generated server entry imports the module, so the middleware may close over
137
+ * module scope and import local helpers and third-party packages — it is a
138
+ * real module in the server module graph, never serialized source.
139
+ */
140
+ export type Middleware = (request: Request, next: () => Promise<Response>) => Promise<Response>;
141
+ /**
142
+ * The adapter-facing framework options: where routes, islands and components
143
+ * live, which renderer serializes pages, the application shell and layout
144
+ * declarations, the document `<html>`/head injection channels, and the
145
+ * request-time middleware switches.
146
+ *
147
+ * Every field is optional; the adapter applies its documented default. This is
148
+ * the type an application config file's default export is checked against, so
149
+ * the rendered option table and the actual config surface cannot drift.
150
+ */
78
151
  export interface FrameworkOptions {
152
+ /**
153
+ * Page renderer selection (Beta.2.2, #1339). EXPLICIT, never inferred:
154
+ * 'native' (default) renders pages through the compiled Part Program
155
+ * serializer (renderDsd); 'lit' renders LitElement pages through
156
+ * @lit-labs/ssr and hydrates them with @lit-labs/ssr-client. Routing,
157
+ * loaders, actions, form enhancement and morphing are shared; only page
158
+ * rendering and the client claim layer fork. 'lit' currently requires
159
+ * `appShell: false` (no compiled shell); the build fails closed otherwise.
160
+ */
161
+ renderer?: 'native' | 'lit';
162
+ /** Directory the route scanner walks, relative to the Vite root. Defaults to `app/routes`. */
79
163
  routesDir?: string;
164
+ /** Directory island modules are discovered in. Defaults to `app/islands`. */
80
165
  islandsDir?: string;
166
+ /** Directory non-route components live in. Defaults to `app/components`. */
81
167
  componentsDir?: string;
168
+ /** Extra package names whose island modules the build admits, e.g. `['@openelement/ui']`. */
82
169
  packageIslands?: string[];
170
+ /** Application shell declaration; `false` disables the shell, `'default'` uses the built-in one. */
83
171
  appShell?: AppShellConfig;
172
+ /** Per-layout shell declarations keyed by layout name. */
84
173
  layouts?: LayoutsConfig;
85
- /** Build mode. 'ssg' (default) generates static HTML. 'spa' produces a client-only bundle. */ mode?: 'ssg' | 'spa';
86
- /** @dangerous injected as-is, only use with controlled content */ headExtras?: string;
174
+ /** Build mode. 'ssg' (default) generates static HTML. */
175
+ mode?: 'ssg';
176
+ /** @dangerous injected as-is, only use with controlled content */
177
+ headExtras?: string;
178
+ /** Document `<html>` attributes: the `lang` the document declares and the default `<title>`. */
87
179
  html?: {
88
180
  lang?: string;
89
181
  title?: string;
90
182
  };
183
+ /** Document head/body injection channels: external stylesheets, scripts, and trusted raw head fragments. */
91
184
  inject?: {
185
+ /** Stylesheets linked into the document head; each entry is an href or a link record with integrity/crossorigin/attrs. */
92
186
  stylesheets?: Array<string | {
93
187
  href: string;
94
188
  integrity?: string;
95
189
  crossorigin?: 'anonymous' | 'use-credentials';
96
190
  attrs?: Record<string, string | number | boolean>;
97
191
  }>;
192
+ /** Scripts emitted into the document; each entry is a src or a script record with type/async/defer/integrity/crossorigin/attrs. */
98
193
  scripts?: Array<string | {
99
194
  src: string;
100
195
  type?: string;
@@ -104,49 +199,99 @@ export interface FrameworkOptions {
104
199
  crossorigin?: 'anonymous' | 'use-credentials';
105
200
  attrs?: Record<string, string | number | boolean>;
106
201
  }>;
107
- /** @dangerous fragments injected as-is */ headFragments?: string[];
202
+ /**
203
+ * @dangerous fragments injected as-is. Trust boundary (same level as
204
+ * `trustedHtml`): never concatenate user-controlled content into these
205
+ * fragments; sanitize untrusted data at your own system boundary first.
206
+ * The framework only enforces no-`<script>` and no-executable-`<style>`.
207
+ */
208
+ headFragments?: string[];
108
209
  };
210
+ /** SSR bundling switches; `noExternal` forces the named packages through the SSR bundle instead of an external import. */
109
211
  ssr?: {
110
212
  noExternal?: (string | RegExp)[];
111
213
  };
214
+ /** Island defaults applied to every island the build discovers. */
112
215
  island?: {
113
216
  upgradeStrategy?: HydrationStrategy;
114
217
  };
218
+ /** Build output switches: the output directory and the advisory manifest budgets. */
115
219
  build?: {
220
+ /** Output directory for the build artifacts. Defaults to `dist`. */
116
221
  outDir?: string;
222
+ /**
223
+ * Advisory only: exceeded budgets print build-manifest warnings and never
224
+ * fail the build; enforce them in your own build-output test.
225
+ */
117
226
  manifestBudget?: {
118
227
  islandKB?: number;
119
228
  totalJsKB?: number;
120
229
  pageKB?: number;
121
230
  };
122
231
  };
232
+ /** Enable the View Transitions API for client navigations. Defaults to true. */
123
233
  viewTransition?: boolean;
234
+ /** Speculation Rules emission: `true` uses framework defaults, or pass prerender/prefetch URL lists, exclusions and an eagerness. */
124
235
  speculation?: boolean | {
125
236
  prerender?: string[];
126
237
  prefetch?: string[];
127
238
  exclude?: string[];
128
239
  eagerness?: 'immediate' | 'moderate' | 'conservative';
129
240
  };
241
+ /** Request-time middleware switches, composed outside the framework handler. */
130
242
  middleware?: {
243
+ /** Enable the built-in CORS middleware. */
131
244
  cors?: boolean;
132
- corsOrigin?: string | string[] | ((origin: string) => string | undefined);
245
+ /**
246
+ * Static CORS allowlist data, serialized into the generated entry as JSON.
247
+ * Mutually exclusive with {@link FrameworkOptions.middleware.corsOriginModule}.
248
+ */
249
+ corsOrigin?: string | string[];
250
+ /**
251
+ * Path to a module that default-exports
252
+ * `(origin: string) => string | undefined`. The generated entry imports
253
+ * the module — the callback is never serialized — so it may close over
254
+ * module scope and import dependencies. Resolved with the same idiom as
255
+ * `appShell.import` (e.g. './app/cors-origin.ts'). Mutually exclusive
256
+ * with `corsOrigin`.
257
+ */
258
+ corsOriginModule?: string;
259
+ /** Emit and honor a per-request id header. */
133
260
  requestId?: boolean;
261
+ /** Log each request through the built-in logger. */
134
262
  logger?: boolean;
263
+ /** Attach the built-in security response headers. */
135
264
  securityHeaders?: boolean;
265
+ /** Content-Security-Policy emission: the policy string, nonce generation, and report-only mode. */
136
266
  csp?: {
137
267
  policy?: string;
138
268
  nonce?: boolean;
139
269
  reportOnly?: boolean;
140
270
  };
271
+ /**
272
+ * Fetch middleware chain (#858), composed around the
273
+ * framework handler in onion order (`use[0]` outermost), outside all
274
+ * built-in middleware above. Each entry is a MODULE PATH (same resolution
275
+ * idiom as `appShell.import`, e.g. './app/middleware/auth.ts') whose
276
+ * default export is a {@link Middleware}; the generated entry emits
277
+ * `import * as __mw_N from '<path>'` and composes `__mw_N.default` in
278
+ * configured order.
279
+ */
280
+ use?: string[];
141
281
  };
142
282
  }
143
- /** ISR route record written to isr-manifest.json at build time. */ export interface IsrManifestEntry {
144
- path: string;
145
- revalidate: number;
146
- cacheKey: string;
147
- params: Record<string, string>;
148
- }
283
+ /**
284
+ * How far a discovered tag may participate in the build: 'ssr-capable' renders
285
+ * and hydrates, 'client-only' ships to the browser without server output,
286
+ * 'experimental-dom' is admitted with a downgraded guarantee, and 'rejected'
287
+ * fails the build.
288
+ */
149
289
  export type CompatibilityTier = 'ssr-capable' | 'client-only' | 'rejected' | 'experimental-dom';
290
+ /**
291
+ * The per-tag verdict the compatibility scanner records: the tier a discovered
292
+ * tag was classified as, the human-readable `reason`, where the tag was found
293
+ * (`source`), and the SSR/DSD/hydration facts the verdict was derived from.
294
+ */
150
295
  export interface CompatibilityClassification {
151
296
  tagName: string;
152
297
  tier: CompatibilityTier;
@@ -157,65 +302,4 @@ export interface CompatibilityClassification {
157
302
  dsd?: boolean;
158
303
  hydrate?: string;
159
304
  }
160
- export interface ValidationResult {
161
- valid: boolean;
162
- errors: ValidationError[];
163
- warnings: ValidationWarning[];
164
- }
165
- export interface ValidationError {
166
- code: string;
167
- message: string;
168
- path?: string;
169
- }
170
- export interface ValidationWarning {
171
- code: string;
172
- message: string;
173
- path?: string;
174
- }
175
- export interface RegistryIndexEntry {
176
- tagName: string;
177
- packageName: string;
178
- version: string;
179
- module?: string;
180
- ssr?: boolean;
181
- dsd?: boolean;
182
- hydrate?: string;
183
- }
184
- export interface RegistryIndex {
185
- totalPackages: number;
186
- totalDeclarations: number;
187
- entries: RegistryIndexEntry[];
188
- }
189
- export interface OpenElementRenderer {
190
- wrap(node: VNode, ctx: {
191
- req: {
192
- path: string;
193
- };
194
- [key: string]: unknown;
195
- }): VNode | Promise<VNode>;
196
- }
197
- export interface OpenElementMiddlewareContext {
198
- req: {
199
- raw?: Request;
200
- path?: string;
201
- param(): Record<string, string>;
202
- param(name: string): string | undefined;
203
- [key: string]: unknown;
204
- };
205
- env?: unknown;
206
- executionCtx?: unknown;
207
- get?(key: string): unknown;
208
- set?(key: string, value: unknown): void;
209
- header?(name: string, value: string): void;
210
- html?(html: string, status?: number): Response;
211
- json?(value: unknown, status?: number): Response;
212
- text?(value: string, status?: number): Response;
213
- redirect?(location: string, status?: number): Response;
214
- [key: string]: unknown;
215
- }
216
- export type OpenElementMiddleware = (c: OpenElementMiddlewareContext, next: () => Promise<void>) => Promise<void> | void;
217
- export interface HydrateEventDescriptor {
218
- selector: string;
219
- event: string;
220
- method: string;
221
- }
305
+ //#endregion
package/src/framework.js CHANGED
@@ -1,5 +1,13 @@
1
- /**
2
- * @openelement/protocol - Framework, build, app-shell, routing, and plugin
3
- * metadata contracts.
4
- */
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpbGU6Ly8vVXNlcnMvemhlbmd6aGkvRG9jdW1lbnRzL3Byb2plY3RzL29wZW5lbGVtZW50L29wZW5lbGVtZW50L3BhY2thZ2VzL3Byb3RvY29sL3NyYy9mcmFtZXdvcmsudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAb3BlbmVsZW1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5rbm93bjtcbiAgfTtcbiAgZW52PzogdW5rbm93bjtcbiAgZXhlY3V0aW9uQ3R4PzogdW5rbm93bjtcbiAgZ2V0PyhrZXk6IHN0cmluZyk6IHVua25vd247XG4gIHNldD8oa2V5OiBzdHJpbmcsIHZhbHVlOiB1bmtub3duKTogdm9pZDtcbiAgaGVhZGVyPyhuYW1lOiBzdHJpbmcsIHZhbHVlOiBzdHJpbmcpOiB2b2lkO1xuICBodG1sPyhodG1sOiBzdHJpbmcsIHN0YXR1cz86IG51bWJlcik6IFJlc3BvbnNlO1xuICBqc29uPyh2YWx1ZTogdW5rbm93biwgc3RhdHVzPzogbnVtYmVyKTogUmVzcG9uc2U7XG4gIHRleHQ/KHZhbHVlOiBzdHJpbmcsIHN0YXR1cz86IG51bWJlcik6IFJlc3BvbnNlO1xuICByZWRpcmVjdD8obG9jYXRpb246IHN0cmluZywgc3RhdHVzPzogbnVtYmVyKTogUmVzcG9uc2U7XG4gIFtrZXk6IHN0cmluZ106IHVua25vd247XG59XG5cbmV4cG9ydCB0eXBlIE9wZW5FbGVtZW50TWlkZGxld2FyZSA9IChcbiAgYzogT3BlbkVsZW1lbnRNaWRkbGV3YXJlQ29udGV4dCxcbiAgbmV4dDogKCkgPT4gUHJvbWlzZTx2b2lkPixcbikgPT4gUHJvbWlzZTx2b2lkPiB8IHZvaWQ7XG5cbi8vIC0tLSBIeWRyYXRpb24gZXZlbnRzIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5leHBvcnQgaW50ZXJmYWNlIEh5ZHJhdGVFdmVudERlc2NyaXB0b3Ige1xuICBzZWxlY3Rvcjogc3RyaW5nO1xuICBldmVudDogc3RyaW5nO1xuICBtZXRob2Q6IHN0cmluZztcbn1cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0NBR0MsR0FFRCJ9
1
+ //#region src/framework.ts
2
+ /** Runtime list of supported hydration strategies; the single source of truth
3
+ * for the `HydrationStrategy` union. Consumed by island/registry validation and
4
+ * re-exported from the element root for app and build adapters. */
5
+ const HYDRATION_STRATEGIES = [
6
+ "load",
7
+ "idle",
8
+ "visible",
9
+ "only",
10
+ "none"
11
+ ];
12
+ //#endregion
13
+ export { HYDRATION_STRATEGIES };
package/src/index.d.ts CHANGED
@@ -1,19 +1,21 @@
1
- /**
2
- * @openelement/protocol - Minimal, type-only protocol package.
3
- *
4
- * Barrel re-export of all protocol subpath modules.
5
- */ export * from "./signal.js";
6
- export * from "./vnode.js";
7
- export * from "./render.js";
8
- export * from "./manifest.js";
9
- export * from "./context.js";
10
- export * from "./runtime.js";
11
- export * from "./data.js";
12
- export * from "./isr.js";
13
- export * from "./ssg.js";
14
- export * from "./errors.js";
15
- export * from "./style-sheet.js";
16
- export * from "./island.js";
17
- export * from "./prop.js";
18
- export * from "./hydration-markers.js";
19
- export * from "./framework.js";
1
+ import { OpenElementRouteKind, OpenElementRouteNode } from "./app-model.js";
2
+ import { AppShellConfig, CompatibilityClassification, CompatibilityTier, ComponentLayer, FrameworkOptions, HYDRATION_STRATEGIES, HydrationStrategy, LocalePath, Middleware, OpenElementBlogOptions, OpenElementBuildContextLike, OpenElementHeaderNavLink, OpenElementI18nContextOptions, OpenElementNavSection, RouteEntry, SafeHtml, SpecialFileType, StrategySource, UnsafeHtml } from "./framework.js";
3
+ import { DsdRenderMetrics, HydrationHint, RenderError, RenderOutput, SsrAdmissionDecision } from "./render.js";
4
+ import { VOID_TAGS } from "./void-tags.js";
5
+ import { COMPILED_MODULE_ABI_VERSION, CemPropertyMetadata, CompiledCemMetadata, CompiledElementMetadata, CompiledPropertyMetadata, ConditionOperator, DATA_OE_LIGHT, ItemEventBinding, PART_PROGRAM_VERSION, PartProgram, PartProgramV1, ProgramAttrPart, ProgramBoolPart, ProgramClassPart, ProgramCondition, ProgramDependencyRecord, ProgramEachPart, ProgramElementNode, ProgramEventAction, ProgramEventPart, ProgramHtmlPart, ProgramItemValueNode, ProgramLocation, ProgramLocationRecord, ProgramPart, ProgramPartAnchorNode, ProgramPosition, ProgramPropPart, ProgramRefPart, ProgramRegionRecord, 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";
6
+ import { ApiRouteDecl, AppShellDecl, AppShellPlan, BuildArtifacts, BuildClientAsset, BuildI18nOptions, BuildIslandInput, BuildManifestArtifact, BuildOutputOptions, BuildPackageIslandOptions, BuildPageArtifact, BuildPlan, BuildRouteInput, ClientIslandEntry, CorsOriginConfig, CspConfig, DocumentConfig, EntryDescriptor, ImportDecl, IslandDecl, IslandDeliveryStrategy, MiddlewareDecl, MiddlewareScopeDecl, PageRouteDecl, RendererDecl, ResolvedAppShell, RouteInfoEntry, SpeculationRulesOptions, SsgBehaviorOptions, SsgPageOutput, SsgRenderEvidence, SsgRenderOptions, SsgRenderSummary, SsrAdmissionPlan, SsrBundle, StaticComponentDecl, StreamRouteManifest } from "./ssg.js";
7
+ import { ClientAssetManifest, ClientIslandAsset, EMPTY_CLIENT_ASSET_MANIFEST, serializeClientAssetsModule } from "./client-assets.js";
8
+ import { ACTION_FETCH_HEADER, Action, ActionContext, ActionResult, Loader, LoaderContext, PROBLEM_JSON_MEDIA_TYPE, ProblemDetails, ServerRouteContext, ServerRouteMetadata } from "./data.js";
9
+ 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";
10
+ import { FORBIDDEN_ATTRIBUTE_NAMES, FORBIDDEN_PROPERTY_NAMES, ForbiddenSinkKind, RAW_TEXT_TAGS, camelToKebab, forbiddenSinkReason, isSafeAttributeName } from "./forbidden-sinks.js";
11
+ import { ISLAND_ADMISSION } from "./island-admission.js";
12
+ import { IslandOptions, IslandTransformOptions, IslandTransformResult } from "./island.js";
13
+ import { CemCompatibilityReport, OpenElementAttribute, OpenElementCssPart, OpenElementDeclaration, OpenElementEvent, OpenElementExtensions, OpenElementPackageManifest, OpenElementSlot } from "./manifest.js";
14
+ import { ROUTER_MODULE_VOCABULARY } from "./module-vocabulary.js";
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";
17
+ import { OpenElementRequestHandler, RuntimeAdapter, RuntimeAdapterOptions, RuntimeContext } from "./runtime.js";
18
+ import { ReadonlySignal, SIGNAL_BRAND, Signal, SignalEngine, SignalLike, Unsubscribe, WritableSignal } from "./signal.js";
19
+ import { STREAM_FRAME_FORBIDDEN_TAGS, STREAM_FRAME_UNSAFE_URL, STREAM_FRAME_URL_ATTRIBUTES, STREAM_FRAME_URL_CONTROL_MAX, unsafeStreamFrameAttribute } from "./stream-frame-policy.js";
20
+ import { StyleSheetLike, StyleSheetRule } from "./style-sheet.js";
21
+ export { ACTION_FETCH_HEADER, Action, ActionContext, ActionResult, ApiRouteDecl, AppShellConfig, AppShellDecl, AppShellPlan, AuthoringErrorCode, BuildArtifacts, BuildClientAsset, BuildI18nOptions, BuildIslandInput, BuildManifestArtifact, BuildOutputOptions, BuildPackageIslandOptions, BuildPageArtifact, BuildPlan, BuildRouteInput, COMPILED_MODULE_ABI_VERSION, CemCompatibilityReport, CemPropertyMetadata, ClaimErrorCode, ClientAssetManifest, ClientIslandAsset, ClientIslandEntry, CompatibilityClassification, CompatibilityTier, CompiledCemMetadata, CompiledElementMetadata, CompiledPropertyMetadata, CompilerErrorCode, ComponentLayer, ConditionOperator, ContextErrorCode, CorsOriginConfig, CspConfig, DATA_OE_LIGHT, DEFAULT_RENDER_ERROR_CODE, DocumentConfig, DsdRenderMetrics, 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, IslandOptions, IslandTransformOptions, IslandTransformResult, ItemEventBinding, KernelErrorCode, Loader, LoaderContext, LocalePath, MAX_ACTION_BODY_BYTES, MAX_COMPOSITION_DEPTH, Middleware, MiddlewareDecl, MiddlewareScopeDecl, OpenElementAttribute, OpenElementBlogOptions, OpenElementBuildContextLike, OpenElementCssPart, OpenElementDeclaration, OpenElementError, OpenElementErrorOptions, OpenElementEvent, OpenElementExtensions, OpenElementHeaderNavLink, OpenElementI18nContextOptions, OpenElementNavSection, OpenElementPackageManifest, OpenElementRequestHandler, OpenElementRouteKind, OpenElementRouteNode, OpenElementSlot, PART_PROGRAM_VERSION, PROBLEM_JSON_MEDIA_TYPE, PageRouteDecl, PartProgram, PartProgramV1, ProblemDetails, ProgramAttrPart, ProgramBoolPart, ProgramClassPart, ProgramCondition, ProgramDependencyRecord, ProgramEachPart, ProgramElementNode, ProgramErrorCode, ProgramEventAction, ProgramEventPart, ProgramHtmlPart, ProgramItemValueNode, ProgramLocation, ProgramLocationRecord, ProgramPart, ProgramPartAnchorNode, ProgramPosition, ProgramPropPart, ProgramRefPart, ProgramRegionRecord, ProgramRoot, ProgramSourceKind, ProgramSourceMap, ProgramSourceRange, ProgramSourceRecord, ProgramStylePart, ProgramTextNode, ProgramTextPart, ProgramTreeNode, ProgramWhenPart, PropertyValueType, RAW_TEXT_TAGS, ROUTER_MODULE_VOCABULARY, RUNTIME_MESSAGES_ENABLED, ReadonlySignal, RenderError, RenderOutput, RendererDecl, ResolvedAppShell, RootMode, RouteEntry, RouteInfoEntry, RuntimeAdapter, RuntimeAdapterOptions, RuntimeContext, RuntimeErrorCode, SIGNAL_BRAND, 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, SafeHtml, SerializableValue, ServerErrorCode, ServerRouteContext, ServerRouteMetadata, Signal, SignalEngine, SignalLike, SpecialFileType, SpeculationRulesOptions, SsgBehaviorOptions, SsgPageOutput, SsgRenderEvidence, SsgRenderOptions, SsgRenderSummary, SsrAdmissionDecision, SsrAdmissionPlan, SsrBundle, StaticComponentDecl, StrategySource, StreamRouteManifest, StyleErrorCode, StyleSheetLike, StyleSheetRule, UnsafeHtml, Unsubscribe, VOID_TAGS, WritableSignal, camelToKebab, conditionLiteralAllowed, forbiddenSinkReason, frameworkError, isAttributeName, isSafeAttributeName, partAnchorEndMarker, partAnchorMarker, raiseFrameworkError, serializeClientAssetsModule, unsafeStreamFrameAttribute, validatePartProgram };
package/src/index.js CHANGED
@@ -1,20 +1,21 @@
1
- /**
2
- * @openelement/protocol - Minimal, type-only protocol package.
3
- *
4
- * Barrel re-export of all protocol subpath modules.
5
- */ export * from './signal.js';
6
- export * from './vnode.js';
7
- export * from './render.js';
8
- export * from './manifest.js';
9
- export * from './context.js';
10
- export * from './runtime.js';
11
- export * from './data.js';
12
- export * from './isr.js';
13
- export * from './ssg.js';
14
- export * from './errors.js';
15
- export * from './style-sheet.js';
16
- export * from './island.js';
17
- export * from './prop.js';
18
- export * from './hydration-markers.js';
19
- export * from './framework.js';
20
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpbGU6Ly8vVXNlcnMvemhlbmd6aGkvRG9jdW1lbnRzL3Byb2plY3RzL29wZW5lbGVtZW50L29wZW5lbGVtZW50L3BhY2thZ2VzL3Byb3RvY29sL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBvcGVuZWxlbWVudC9wcm90b2NvbCAtIE1pbmltYWwsIHR5cGUtb25seSBwcm90b2NvbCBwYWNrYWdlLlxuICpcbiAqIEJhcnJlbCByZS1leHBvcnQgb2YgYWxsIHByb3RvY29sIHN1YnBhdGggbW9kdWxlcy5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3NpZ25hbC5qcyc7XG5leHBvcnQgKiBmcm9tICcuL3Zub2RlLmpzJztcbmV4cG9ydCAqIGZyb20gJy4vcmVuZGVyLmpzJztcbmV4cG9ydCAqIGZyb20gJy4vbWFuaWZlc3QuanMnO1xuZXhwb3J0ICogZnJvbSAnLi9jb250ZXh0LmpzJztcbmV4cG9ydCAqIGZyb20gJy4vcnVudGltZS5qcyc7XG5leHBvcnQgKiBmcm9tICcuL2RhdGEuanMnO1xuZXhwb3J0ICogZnJvbSAnLi9pc3IuanMnO1xuZXhwb3J0ICogZnJvbSAnLi9zc2cuanMnO1xuZXhwb3J0ICogZnJvbSAnLi9lcnJvcnMuanMnO1xuZXhwb3J0ICogZnJvbSAnLi9zdHlsZS1zaGVldC5qcyc7XG5leHBvcnQgKiBmcm9tICcuL2lzbGFuZC5qcyc7XG5leHBvcnQgKiBmcm9tICcuL3Byb3AuanMnO1xuZXhwb3J0ICogZnJvbSAnLi9oeWRyYXRpb24tbWFya2Vycy5qcyc7XG5leHBvcnQgKiBmcm9tICcuL2ZyYW1ld29yay5qcyc7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Q0FJQyxHQUVELGNBQWMsY0FBYztBQUM1QixjQUFjLGFBQWE7QUFDM0IsY0FBYyxjQUFjO0FBQzVCLGNBQWMsZ0JBQWdCO0FBQzlCLGNBQWMsZUFBZTtBQUM3QixjQUFjLGVBQWU7QUFDN0IsY0FBYyxZQUFZO0FBQzFCLGNBQWMsV0FBVztBQUN6QixjQUFjLFdBQVc7QUFDekIsY0FBYyxjQUFjO0FBQzVCLGNBQWMsbUJBQW1CO0FBQ2pDLGNBQWMsY0FBYztBQUM1QixjQUFjLFlBQVk7QUFDMUIsY0FBYyx5QkFBeUI7QUFDdkMsY0FBYyxpQkFBaUIifQ==
1
+ import "./app-model.js";
2
+ import { EMPTY_CLIENT_ASSET_MANIFEST, serializeClientAssetsModule } from "./client-assets.js";
3
+ import { ACTION_FETCH_HEADER, PROBLEM_JSON_MEDIA_TYPE } from "./data.js";
4
+ import { AuthoringErrorCode, ClaimErrorCode, CompilerErrorCode, ContextErrorCode, DEFAULT_RENDER_ERROR_CODE, ERROR_PREFIX, EachKeyErrorCode, ErrorCode, FacadeErrorCode, KernelErrorCode, OpenElementError, ProgramErrorCode, RUNTIME_MESSAGES_ENABLED, RuntimeErrorCode, ServerErrorCode, StyleErrorCode, frameworkError, raiseFrameworkError } from "./errors.js";
5
+ import { FORBIDDEN_ATTRIBUTE_NAMES, FORBIDDEN_PROPERTY_NAMES, RAW_TEXT_TAGS, camelToKebab, forbiddenSinkReason, isSafeAttributeName } from "./forbidden-sinks.js";
6
+ import { HYDRATION_STRATEGIES } from "./framework.js";
7
+ import { ISLAND_ADMISSION } from "./island-admission.js";
8
+ import "./island.js";
9
+ import "./manifest.js";
10
+ import { ROUTER_MODULE_VOCABULARY } from "./module-vocabulary.js";
11
+ import { VOID_TAGS } from "./void-tags.js";
12
+ import { COMPILED_MODULE_ABI_VERSION, DATA_OE_LIGHT, PART_PROGRAM_VERSION, STATIC_STYLES_MARKER, conditionLiteralAllowed, isAttributeName, partAnchorEndMarker, partAnchorMarker, validatePartProgram } from "./part-program.js";
13
+ 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";
14
+ import { ENTRY_REGISTRATION_OWNERS, SSR_REGISTRY_ORIGINAL_DEFINE, SSR_REGISTRY_STUB_MARKER } from "./registry-markers.js";
15
+ import "./render.js";
16
+ import "./runtime.js";
17
+ import { SIGNAL_BRAND } from "./signal.js";
18
+ import "./ssg.js";
19
+ import { STREAM_FRAME_FORBIDDEN_TAGS, STREAM_FRAME_UNSAFE_URL, STREAM_FRAME_URL_ATTRIBUTES, STREAM_FRAME_URL_CONTROL_MAX, unsafeStreamFrameAttribute } from "./stream-frame-policy.js";
20
+ import "./style-sheet.js";
21
+ export { ACTION_FETCH_HEADER, AuthoringErrorCode, COMPILED_MODULE_ABI_VERSION, ClaimErrorCode, CompilerErrorCode, ContextErrorCode, DATA_OE_LIGHT, DEFAULT_RENDER_ERROR_CODE, 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, OpenElementError, PART_PROGRAM_VERSION, PROBLEM_JSON_MEDIA_TYPE, ProgramErrorCode, RAW_TEXT_TAGS, ROUTER_MODULE_VOCABULARY, RUNTIME_MESSAGES_ENABLED, RuntimeErrorCode, SIGNAL_BRAND, 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, ServerErrorCode, StyleErrorCode, VOID_TAGS, camelToKebab, conditionLiteralAllowed, forbiddenSinkReason, frameworkError, isAttributeName, isSafeAttributeName, partAnchorEndMarker, partAnchorMarker, raiseFrameworkError, serializeClientAssetsModule, unsafeStreamFrameAttribute, validatePartProgram };
@@ -0,0 +1,5 @@
1
+ import { StaticSidecarDescriptor } from "./module-descriptors.js";
2
+ //#region src/island-admission.d.ts
3
+ /** The static-sidecar descriptor router injects into the element compiler. */
4
+ export declare const ISLAND_ADMISSION: StaticSidecarDescriptor;
5
+ //#endregion
@@ -0,0 +1,9 @@
1
+ //#region src/island-admission.ts
2
+ /** The static-sidecar descriptor router injects into the element compiler. */
3
+ const ISLAND_ADMISSION = {
4
+ moduleSpecifier: "@openelement/router",
5
+ exportName: "defineIslandConfig",
6
+ kind: "static-sidecar"
7
+ };
8
+ //#endregion
9
+ export { ISLAND_ADMISSION };