@stencil/core 5.0.0-alpha.3 → 5.0.0-alpha.31
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 +94 -0
- package/dist/app-data/index.d.ts +2 -0
- package/dist/{runtime/app-data → app-data}/index.js +17 -11
- package/dist/{client-CSm3x5ke.mjs → client-D1MsT-Rp.mjs} +2717 -2424
- package/dist/compiler/index.d.mts +170 -6
- package/dist/compiler/index.mjs +4 -3
- package/dist/compiler/utils/index.d.mts +272 -2
- package/dist/compiler/utils/index.mjs +4 -3
- package/dist/{compiler-D6iP7Bzb.mjs → compiler-Cddp97Pg.mjs} +14953 -12327
- package/dist/declarations/stencil-ext-modules.d.ts +5 -5
- package/dist/declarations/stencil-public-compiler.d.ts +728 -287
- package/dist/declarations/stencil-public-compiler.js +2 -3
- package/dist/declarations/stencil-public-docs.d.ts +19 -0
- package/dist/declarations/stencil-public-runtime.d.ts +131 -17
- package/dist/fragment-Di1hWOC8.mjs +4 -0
- package/dist/{index-tUR6pD3J.d.mts → index-BHj3EBl2.d.mts} +1052 -668
- package/dist/{index-CyrGY82h.d.ts → index-D2PAsXxx.d.ts} +215 -40
- package/dist/index-VK8okIiF.d.mts +108 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +91 -2
- package/dist/jsx-runtime.d.mts +18 -0
- package/dist/jsx-runtime.mjs +3 -0
- package/dist/{node-Bg-mO5dw.mjs → node-BQR4L-TG.mjs} +76 -73
- package/dist/reactive-controller-BdCpSAQP.d.mts +13 -0
- package/dist/{regular-expression-D5pGVpCu.mjs → regular-expression-XqU5zmPp.mjs} +141 -31
- package/dist/{chunk-CjcI7cDX.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
- package/dist/{runtime-BBCnuprF.js → runtime/client/lazy.js} +2987 -2443
- package/dist/runtime/client/{index.d.ts → runtime.d.ts} +228 -83
- package/dist/runtime/client/{index.js → runtime.js} +2852 -2432
- package/dist/runtime/index.d.ts +48 -29
- package/dist/runtime/index.js +5069 -2
- package/dist/runtime/server/index.d.mts +182 -75
- package/dist/runtime/server/index.mjs +2769 -2283
- package/dist/runtime/server/runner.d.mts +47 -32
- package/dist/runtime/server/runner.mjs +563 -687
- package/dist/signals/index.d.ts +49 -0
- package/dist/signals/index.js +199 -0
- package/dist/sys/node/index.d.mts +1 -2
- package/dist/sys/node/index.mjs +1 -1
- package/dist/sys/node/worker.d.mts +1 -1
- package/dist/sys/node/worker.mjs +6 -3
- package/dist/testing/index.d.mts +98 -9
- package/dist/testing/index.mjs +395 -70
- package/dist/util-BIa-iHnt.mjs +724 -0
- package/dist/validation-Dd3g77T5.mjs +778 -0
- package/package.json +49 -36
- package/dist/index-CXHCTQNt.d.mts +0 -190
- package/dist/index-hS-KBdAP.d.ts +0 -30
- package/dist/jsx-runtime-DlDkTqps.d.ts +0 -28
- package/dist/jsx-runtime.d.ts +0 -2
- package/dist/jsx-runtime.js +0 -2
- package/dist/runtime/app-data/index.d.ts +0 -2
- package/dist/validation-Byxie0Uk.mjs +0 -1445
- /package/{LICENSE.md → LICENSE} +0 -0
- /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
- /package/dist/{runtime/app-globals → app-globals}/index.js +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@stencil/core/app-data";
|
|
2
|
+
import "rolldown";
|
|
3
|
+
import "typescript";
|
|
2
4
|
//#region src/server/runner/create-window.d.ts
|
|
3
5
|
declare function createWindowFromHtml(templateHtml: string, uniqueId: string): any;
|
|
4
6
|
//#endregion
|
|
@@ -7,7 +9,7 @@ type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
|
|
|
7
9
|
type TagTransformer = (tag: string) => string;
|
|
8
10
|
//#endregion
|
|
9
11
|
//#region src/declarations/stencil-public-compiler.d.ts
|
|
10
|
-
interface
|
|
12
|
+
interface SsrDocumentOptions {
|
|
11
13
|
/**
|
|
12
14
|
* Build ID that will be added to `<html data-stencil-build="BUILD_ID">`. By default
|
|
13
15
|
* a random ID will be generated
|
|
@@ -24,7 +26,7 @@ interface HydrateDocumentOptions {
|
|
|
24
26
|
* JavaScript to read the structure of the HTML and rebuild each
|
|
25
27
|
* component. Defaults to `true`.
|
|
26
28
|
*/
|
|
27
|
-
|
|
29
|
+
clientSsrAnnotations?: boolean;
|
|
28
30
|
/**
|
|
29
31
|
* Constrain `setTimeout()` to 1ms, but still async. Also
|
|
30
32
|
* only allows `setInterval()` to fire once, also constrained to 1ms.
|
|
@@ -123,10 +125,14 @@ interface HydrateDocumentOptions {
|
|
|
123
125
|
default: 'declarative-shadow-dom' | 'scoped';
|
|
124
126
|
} | boolean;
|
|
125
127
|
}
|
|
126
|
-
interface SerializeDocumentOptions extends
|
|
128
|
+
interface SerializeDocumentOptions extends SsrDocumentOptions {
|
|
127
129
|
/**
|
|
128
130
|
* Runs after the `document` has been hydrated.
|
|
129
131
|
*/
|
|
132
|
+
afterSsr?(document: any): any | Promise<any>;
|
|
133
|
+
/**
|
|
134
|
+
* @deprecated Use `afterSsr` instead.
|
|
135
|
+
*/
|
|
130
136
|
afterHydrate?(document: any): any | Promise<any>;
|
|
131
137
|
/**
|
|
132
138
|
* Sets an approximate line width the HTML should attempt to stay within.
|
|
@@ -139,6 +145,10 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
|
|
|
139
145
|
/**
|
|
140
146
|
* Runs before the `document` has been hydrated.
|
|
141
147
|
*/
|
|
148
|
+
beforeSsr?(document: any): any | Promise<any>;
|
|
149
|
+
/**
|
|
150
|
+
* @deprecated Use `beforeSsr` instead.
|
|
151
|
+
*/
|
|
142
152
|
beforeHydrate?(document: any): any | Promise<any>;
|
|
143
153
|
/**
|
|
144
154
|
* Format the HTML in a nicely indented format.
|
|
@@ -176,7 +186,7 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
|
|
|
176
186
|
*/
|
|
177
187
|
modes?: ResolutionHandler[];
|
|
178
188
|
}
|
|
179
|
-
interface
|
|
189
|
+
interface SsrFactoryOptions extends SerializeDocumentOptions {
|
|
180
190
|
serializeToHtml: boolean;
|
|
181
191
|
destroyWindow: boolean;
|
|
182
192
|
destroyDocument: boolean;
|
|
@@ -204,7 +214,7 @@ interface PrintLine {
|
|
|
204
214
|
errorCharStart: number;
|
|
205
215
|
errorLength?: number;
|
|
206
216
|
}
|
|
207
|
-
interface
|
|
217
|
+
interface SsrResults {
|
|
208
218
|
buildId: string;
|
|
209
219
|
diagnostics: Diagnostic[];
|
|
210
220
|
url: string;
|
|
@@ -216,42 +226,42 @@ interface HydrateResults {
|
|
|
216
226
|
search: string | null;
|
|
217
227
|
hash: string | null;
|
|
218
228
|
html: string | null;
|
|
219
|
-
components:
|
|
220
|
-
anchors:
|
|
221
|
-
imgs:
|
|
222
|
-
scripts:
|
|
223
|
-
styles:
|
|
224
|
-
staticData:
|
|
229
|
+
components: SsrComponent[];
|
|
230
|
+
anchors: SsrAnchorElement[];
|
|
231
|
+
imgs: SsrImgElement[];
|
|
232
|
+
scripts: SsrScriptElement[];
|
|
233
|
+
styles: SsrStyleElement[];
|
|
234
|
+
staticData: SsrStaticData[];
|
|
225
235
|
title: string | null;
|
|
226
236
|
hydratedCount: number;
|
|
227
237
|
httpStatus: number | null;
|
|
228
238
|
}
|
|
229
|
-
interface
|
|
239
|
+
interface SsrComponent {
|
|
230
240
|
tag: string;
|
|
231
241
|
mode: string;
|
|
232
242
|
count: number;
|
|
233
243
|
depth: number;
|
|
234
244
|
}
|
|
235
|
-
interface
|
|
245
|
+
interface SsrElement {
|
|
236
246
|
[attrName: string]: string | undefined;
|
|
237
247
|
}
|
|
238
|
-
interface
|
|
248
|
+
interface SsrAnchorElement extends SsrElement {
|
|
239
249
|
href?: string;
|
|
240
250
|
target?: string;
|
|
241
251
|
}
|
|
242
|
-
interface
|
|
252
|
+
interface SsrImgElement extends SsrElement {
|
|
243
253
|
src?: string;
|
|
244
254
|
}
|
|
245
|
-
interface
|
|
255
|
+
interface SsrScriptElement extends SsrElement {
|
|
246
256
|
src?: string;
|
|
247
257
|
type?: string;
|
|
248
258
|
}
|
|
249
|
-
interface
|
|
259
|
+
interface SsrStyleElement extends SsrElement {
|
|
250
260
|
id?: string;
|
|
251
261
|
href?: string;
|
|
252
262
|
content?: string;
|
|
253
263
|
}
|
|
254
|
-
interface
|
|
264
|
+
interface SsrStaticData {
|
|
255
265
|
id: string;
|
|
256
266
|
type: string;
|
|
257
267
|
content: string;
|
|
@@ -265,31 +275,36 @@ interface HydrateStaticData {
|
|
|
265
275
|
* @param options - serialization options
|
|
266
276
|
* @returns the hydration results
|
|
267
277
|
*/
|
|
268
|
-
declare function renderToString(html: string | any, options?: SerializeDocumentOptions): Promise<
|
|
278
|
+
declare function renderToString(html: string | any, options?: SerializeDocumentOptions): Promise<SsrResults>;
|
|
269
279
|
/**
|
|
270
|
-
* Renders HTML and returns a
|
|
271
|
-
*
|
|
272
|
-
* Note: This function requires Node.js and cannot be used in QuickJS/WASM environments.
|
|
280
|
+
* Renders HTML and returns a web-standard ReadableStream.
|
|
281
|
+
* Works in Node 22+, Cloudflare Workers, Deno, Bun, and any WinterCG-compatible runtime.
|
|
273
282
|
* @param html - the HTML string or document to render
|
|
274
283
|
* @param options - serialization options
|
|
275
|
-
* @returns a
|
|
284
|
+
* @returns a ReadableStream
|
|
276
285
|
*/
|
|
277
|
-
declare function streamToString(html: string | any, options?: SerializeDocumentOptions):
|
|
286
|
+
declare function streamToString(html: string | any, options?: SerializeDocumentOptions): ReadableStream<string>;
|
|
278
287
|
/**
|
|
279
|
-
*
|
|
288
|
+
* Server side renders a document or HTML string, returning the full render results.
|
|
280
289
|
* This is portable (no Node.js dependencies).
|
|
281
|
-
* @param doc - the document or HTML string to
|
|
290
|
+
* @param doc - the document or HTML string to render
|
|
282
291
|
* @param options - hydration options
|
|
283
|
-
* @returns the
|
|
292
|
+
* @returns the render results
|
|
293
|
+
*/
|
|
294
|
+
declare function ssrDocument(doc: any | string, options?: SsrDocumentOptions): Promise<SsrResults>;
|
|
295
|
+
/**
|
|
296
|
+
* v4 Compat
|
|
297
|
+
* @alias
|
|
298
|
+
* @deprecated Use `ssrDocument()` instead
|
|
284
299
|
*/
|
|
285
|
-
declare
|
|
286
|
-
declare function serializeDocumentToString(doc: Document, opts:
|
|
300
|
+
declare const hydrateDocument: typeof ssrDocument;
|
|
301
|
+
declare function serializeDocumentToString(doc: Document, opts: SsrFactoryOptions): string;
|
|
287
302
|
//#endregion
|
|
288
303
|
//#region src/server/runner/window-initialize.d.ts
|
|
289
304
|
/**
|
|
290
305
|
* Reset the docData counters. Useful for testing to ensure deterministic IDs.
|
|
291
306
|
*/
|
|
292
|
-
declare function
|
|
307
|
+
declare function resetSsrDocData(): void;
|
|
293
308
|
//#endregion
|
|
294
309
|
//#region src/runtime/tag-transform.d.ts
|
|
295
310
|
/**
|
|
@@ -304,4 +319,4 @@ declare function transformTag<T extends string>(tag: T): T;
|
|
|
304
319
|
*/
|
|
305
320
|
declare function setTagTransformer(transformer: TagTransformer): void;
|
|
306
321
|
//#endregion
|
|
307
|
-
export { createWindowFromHtml, hydrateDocument, renderToString,
|
|
322
|
+
export { createWindowFromHtml, hydrateDocument, renderToString, resetSsrDocData, serializeDocumentToString, setTagTransformer, ssrDocument, streamToString, transformTag };
|