@stencil/core 5.0.0-alpha.1 → 5.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 (50) hide show
  1. package/dist/app-data/index.d.ts +2 -0
  2. package/dist/{runtime/app-data → app-data}/index.js +17 -12
  3. package/dist/{client-B1nuvCd2.mjs → client-aTQ7xHxx.mjs} +2432 -2278
  4. package/dist/compiler/index.d.mts +6 -6
  5. package/dist/compiler/index.mjs +2 -2
  6. package/dist/compiler/utils/index.d.mts +2 -2
  7. package/dist/compiler/utils/index.mjs +3 -3
  8. package/dist/{compiler-LX4_RKKd.mjs → compiler-DCN7Np2A.mjs} +14854 -13500
  9. package/dist/declarations/stencil-public-compiler.d.ts +4374 -2
  10. package/dist/declarations/stencil-public-compiler.js +2 -4
  11. package/dist/declarations/stencil-public-docs.d.ts +504 -1
  12. package/dist/declarations/stencil-public-runtime.d.ts +1982 -2
  13. package/dist/{index-fIuYTL9f.d.mts → index-BvkyxSY6.d.mts} +29 -2
  14. package/dist/{index-D-LlB2nw.d.mts → index-vY35H18z.d.mts} +795 -1188
  15. package/dist/{index-BONzXKJt.d.ts → index-xAkMgLX_.d.ts} +88 -39
  16. package/dist/index.d.mts +1 -1
  17. package/dist/index.mjs +2 -2
  18. package/dist/jsx-runtime.d.mts +18 -0
  19. package/dist/jsx-runtime.mjs +2 -0
  20. package/dist/{node-SxQIOCZE.mjs → node--akYC-sG.mjs} +20 -30
  21. package/dist/regular-expression-CFVJOTUh.mjs +508 -0
  22. package/dist/{runtime-CF9DJtSu.js → runtime/client/lazy.js} +2675 -2493
  23. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +106 -78
  24. package/dist/runtime/client/{index.js → runtime.js} +2545 -2487
  25. package/dist/runtime/index.d.ts +58 -29
  26. package/dist/runtime/index.js +4795 -2
  27. package/dist/runtime/server/index.d.mts +103 -70
  28. package/dist/runtime/server/index.mjs +2545 -2350
  29. package/dist/runtime/server/runner.d.mts +44 -48
  30. package/dist/runtime/server/runner.mjs +347 -751
  31. package/dist/signals/index.d.ts +47 -0
  32. package/dist/signals/index.js +199 -0
  33. package/dist/sys/node/index.d.mts +1 -1
  34. package/dist/sys/node/index.mjs +1 -1
  35. package/dist/sys/node/worker.mjs +2 -2
  36. package/dist/testing/index.d.mts +97 -3
  37. package/dist/testing/index.mjs +367 -59
  38. package/dist/{validation-CaCgjw-f.mjs → validation-ByxKj8bC.mjs} +116 -99
  39. package/package.json +47 -38
  40. package/dist/index-CHjZtib0.d.ts +0 -30
  41. package/dist/jsx-runtime-DBzBJLKk.d.ts +0 -28
  42. package/dist/jsx-runtime.d.ts +0 -2
  43. package/dist/jsx-runtime.js +0 -2
  44. package/dist/runtime/app-data/index.d.ts +0 -2
  45. package/dist/serialize-BkYHk7Mi.mjs +0 -766
  46. package/dist/stencil-public-compiler-C_X1iolo.d.ts +0 -4455
  47. package/dist/stencil-public-runtime-DlV8o7-z.d.ts +0 -1845
  48. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
  49. /package/dist/{runtime/app-globals → app-globals}/index.js +0 -0
  50. /package/dist/{chunk-CjcI7cDX.mjs → chunk-z9aeyW2b.mjs} +0 -0
@@ -1,29 +1,12 @@
1
- import { Readable } from "node:stream";
2
1
  //#region src/server/runner/create-window.d.ts
3
2
  declare function createWindowFromHtml(templateHtml: string, uniqueId: string): any;
4
3
  //#endregion
5
- //#region src/utils/serialize.d.ts
6
- /**
7
- * Serialize a value to a string that can be deserialized later.
8
- * @param {unknown} value - The value to serialize.
9
- * @returns {string} A string that can be deserialized later.
10
- * @deprecated will be removed in v5. Use `@PropSerialize()` decorator instead.
11
- */
12
- declare function serializeProperty(value: unknown): string | number | boolean;
13
- /**
14
- * Deserialize a value from a string that was serialized earlier.
15
- * @param {string} value - The string to deserialize.
16
- * @returns {unknown} The deserialized value.
17
- * @deprecated will be removed in v5. Use `@AttrDeserialize()` decorator instead.
18
- */
19
- declare function deserializeProperty(value: string): any;
20
- //#endregion
21
4
  //#region src/declarations/stencil-public-runtime.d.ts
22
5
  type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
23
6
  type TagTransformer = (tag: string) => string;
24
7
  //#endregion
25
8
  //#region src/declarations/stencil-public-compiler.d.ts
26
- interface HydrateDocumentOptions {
9
+ interface SsrDocumentOptions {
27
10
  /**
28
11
  * Build ID that will be added to `<html data-stencil-build="BUILD_ID">`. By default
29
12
  * a random ID will be generated
@@ -40,7 +23,7 @@ interface HydrateDocumentOptions {
40
23
  * JavaScript to read the structure of the HTML and rebuild each
41
24
  * component. Defaults to `true`.
42
25
  */
43
- clientHydrateAnnotations?: boolean;
26
+ clientSsrAnnotations?: boolean;
44
27
  /**
45
28
  * Constrain `setTimeout()` to 1ms, but still async. Also
46
29
  * only allows `setInterval()` to fire once, also constrained to 1ms.
@@ -139,10 +122,14 @@ interface HydrateDocumentOptions {
139
122
  default: 'declarative-shadow-dom' | 'scoped';
140
123
  } | boolean;
141
124
  }
142
- interface SerializeDocumentOptions extends HydrateDocumentOptions {
125
+ interface SerializeDocumentOptions extends SsrDocumentOptions {
143
126
  /**
144
127
  * Runs after the `document` has been hydrated.
145
128
  */
129
+ afterSsr?(document: any): any | Promise<any>;
130
+ /**
131
+ * @deprecated Use `afterSsr` instead.
132
+ */
146
133
  afterHydrate?(document: any): any | Promise<any>;
147
134
  /**
148
135
  * Sets an approximate line width the HTML should attempt to stay within.
@@ -155,6 +142,10 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
155
142
  /**
156
143
  * Runs before the `document` has been hydrated.
157
144
  */
145
+ beforeSsr?(document: any): any | Promise<any>;
146
+ /**
147
+ * @deprecated Use `beforeSsr` instead.
148
+ */
158
149
  beforeHydrate?(document: any): any | Promise<any>;
159
150
  /**
160
151
  * Format the HTML in a nicely indented format.
@@ -192,7 +183,7 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
192
183
  */
193
184
  modes?: ResolutionHandler[];
194
185
  }
195
- interface HydrateFactoryOptions extends SerializeDocumentOptions {
186
+ interface SsrFactoryOptions extends SerializeDocumentOptions {
196
187
  serializeToHtml: boolean;
197
188
  destroyWindow: boolean;
198
189
  destroyDocument: boolean;
@@ -220,7 +211,7 @@ interface PrintLine {
220
211
  errorCharStart: number;
221
212
  errorLength?: number;
222
213
  }
223
- interface HydrateResults {
214
+ interface SsrResults {
224
215
  buildId: string;
225
216
  diagnostics: Diagnostic[];
226
217
  url: string;
@@ -232,42 +223,42 @@ interface HydrateResults {
232
223
  search: string | null;
233
224
  hash: string | null;
234
225
  html: string | null;
235
- components: HydrateComponent[];
236
- anchors: HydrateAnchorElement[];
237
- imgs: HydrateImgElement[];
238
- scripts: HydrateScriptElement[];
239
- styles: HydrateStyleElement[];
240
- staticData: HydrateStaticData[];
226
+ components: SsrComponent[];
227
+ anchors: SsrAnchorElement[];
228
+ imgs: SsrImgElement[];
229
+ scripts: SsrScriptElement[];
230
+ styles: SsrStyleElement[];
231
+ staticData: SsrStaticData[];
241
232
  title: string | null;
242
233
  hydratedCount: number;
243
234
  httpStatus: number | null;
244
235
  }
245
- interface HydrateComponent {
236
+ interface SsrComponent {
246
237
  tag: string;
247
238
  mode: string;
248
239
  count: number;
249
240
  depth: number;
250
241
  }
251
- interface HydrateElement {
242
+ interface SsrElement {
252
243
  [attrName: string]: string | undefined;
253
244
  }
254
- interface HydrateAnchorElement extends HydrateElement {
245
+ interface SsrAnchorElement extends SsrElement {
255
246
  href?: string;
256
247
  target?: string;
257
248
  }
258
- interface HydrateImgElement extends HydrateElement {
249
+ interface SsrImgElement extends SsrElement {
259
250
  src?: string;
260
251
  }
261
- interface HydrateScriptElement extends HydrateElement {
252
+ interface SsrScriptElement extends SsrElement {
262
253
  src?: string;
263
254
  type?: string;
264
255
  }
265
- interface HydrateStyleElement extends HydrateElement {
256
+ interface SsrStyleElement extends SsrElement {
266
257
  id?: string;
267
258
  href?: string;
268
259
  content?: string;
269
260
  }
270
- interface HydrateStaticData {
261
+ interface SsrStaticData {
271
262
  id: string;
272
263
  type: string;
273
264
  content: string;
@@ -281,31 +272,36 @@ interface HydrateStaticData {
281
272
  * @param options - serialization options
282
273
  * @returns the hydration results
283
274
  */
284
- declare function renderToString(html: string | any, options?: SerializeDocumentOptions): Promise<HydrateResults>;
275
+ declare function renderToString(html: string | any, options?: SerializeDocumentOptions): Promise<SsrResults>;
285
276
  /**
286
- * Renders HTML and returns a Node.js Readable stream.
287
- * This is a Node.js-specific convenience wrapper around renderToString.
288
- * Note: This function requires Node.js and cannot be used in QuickJS/WASM environments.
277
+ * Renders HTML and returns a web-standard ReadableStream.
278
+ * Works in Node 22+, Cloudflare Workers, Deno, Bun, and any WinterCG-compatible runtime.
289
279
  * @param html - the HTML string or document to render
290
280
  * @param options - serialization options
291
- * @returns a Node.js Readable stream
281
+ * @returns a ReadableStream
292
282
  */
293
- declare function streamToString(html: string | any, options?: SerializeDocumentOptions): Readable;
283
+ declare function streamToString(html: string | any, options?: SerializeDocumentOptions): ReadableStream<string>;
294
284
  /**
295
- * Hydrates a document or HTML string, returning the full hydration results.
285
+ * Server side renders a document or HTML string, returning the full render results.
296
286
  * This is portable (no Node.js dependencies).
297
- * @param doc - the document or HTML string to hydrate
287
+ * @param doc - the document or HTML string to render
298
288
  * @param options - hydration options
299
- * @returns the hydration results
289
+ * @returns the render results
290
+ */
291
+ declare function ssrDocument(doc: any | string, options?: SsrDocumentOptions): Promise<SsrResults>;
292
+ /**
293
+ * v4 Compat
294
+ * @alias
295
+ * @deprecated Use `ssrDocument()` instead
300
296
  */
301
- declare function hydrateDocument(doc: any | string, options?: HydrateDocumentOptions): Promise<HydrateResults>;
302
- declare function serializeDocumentToString(doc: Document, opts: HydrateFactoryOptions): string;
297
+ declare const hydrateDocument: typeof ssrDocument;
298
+ declare function serializeDocumentToString(doc: Document, opts: SsrFactoryOptions): string;
303
299
  //#endregion
304
300
  //#region src/server/runner/window-initialize.d.ts
305
301
  /**
306
302
  * Reset the docData counters. Useful for testing to ensure deterministic IDs.
307
303
  */
308
- declare function resetHydrateDocData(): void;
304
+ declare function resetSsrDocData(): void;
309
305
  //#endregion
310
306
  //#region src/runtime/tag-transform.d.ts
311
307
  /**
@@ -320,4 +316,4 @@ declare function transformTag<T extends string>(tag: T): T;
320
316
  */
321
317
  declare function setTagTransformer(transformer: TagTransformer): void;
322
318
  //#endregion
323
- export { createWindowFromHtml, deserializeProperty, hydrateDocument, renderToString, resetHydrateDocData, serializeDocumentToString, serializeProperty, setTagTransformer, streamToString, transformTag };
319
+ export { createWindowFromHtml, hydrateDocument, renderToString, resetSsrDocData, serializeDocumentToString, setTagTransformer, ssrDocument, streamToString, transformTag };