@stencil/core 5.0.0-next.0 → 5.0.0-rc.0

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 (58) hide show
  1. package/README.md +94 -0
  2. package/bin/stencil.mjs +1 -1
  3. package/dist/app-data/index.d.ts +2 -0
  4. package/dist/{runtime/app-data → app-data}/index.js +23 -15
  5. package/dist/{runtime/app-globals → app-globals}/index.js +1 -2
  6. package/dist/client-ClM4H9-P.mjs +2496 -0
  7. package/dist/compiler/browser.d.ts +1573 -0
  8. package/dist/compiler/browser.js +16998 -0
  9. package/dist/compiler/index.d.mts +284 -7
  10. package/dist/compiler/index.mjs +3 -9
  11. package/dist/compiler/utils/index.d.mts +272 -3
  12. package/dist/compiler/utils/index.mjs +4 -5
  13. package/dist/{transpile-CJQcQEVa.mjs → compiler-DFanjq9z.mjs} +20984 -15554
  14. package/dist/declarations/stencil-ext-modules.d.ts +8 -8
  15. package/dist/declarations/stencil-public-compiler.d.ts +1016 -840
  16. package/dist/declarations/stencil-public-compiler.js +3 -5
  17. package/dist/declarations/stencil-public-docs.d.ts +441 -376
  18. package/dist/declarations/stencil-public-docs.js +0 -0
  19. package/dist/declarations/stencil-public-runtime.d.ts +361 -113
  20. package/dist/fragment-Di1hWOC8.mjs +4 -0
  21. package/dist/helpers-Cpp3qc3u.mjs +524 -0
  22. package/dist/{index-szczUd2l.d.mts → index-DvfFOkiJ.d.mts} +1466 -2044
  23. package/dist/{stencil-private-Cgcr414u.d.ts → index-XQHZl0MW.d.ts} +308 -114
  24. package/dist/index-aBMJC5F9.d.mts +104 -0
  25. package/dist/index.d.mts +14 -2
  26. package/dist/index.mjs +171 -4
  27. package/dist/jsx-runtime.d.mts +24 -0
  28. package/dist/jsx-runtime.mjs +3 -0
  29. package/dist/mock-doc.mjs +2 -3
  30. package/dist/{node-sys-BGURUNOZ.mjs → node-DJP8JuAS.mjs} +176 -197
  31. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  32. package/dist/{client-DR9zhmKG.mjs → runtime/client/lazy.js} +3780 -2652
  33. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +516 -227
  34. package/dist/runtime/client/{index.js → runtime.js} +3588 -2856
  35. package/dist/runtime/index.d.ts +90 -72
  36. package/dist/runtime/index.js +3461 -2837
  37. package/dist/runtime/server/index.d.mts +243 -219
  38. package/dist/runtime/server/index.mjs +3763 -3352
  39. package/dist/runtime/server/runner.d.mts +114 -47
  40. package/dist/runtime/server/runner.mjs +12710 -763
  41. package/dist/signals/index.d.ts +58 -0
  42. package/dist/signals/index.js +182 -0
  43. package/dist/sys/node/index.d.mts +1 -3
  44. package/dist/sys/node/index.mjs +2 -7
  45. package/dist/sys/node/worker.d.mts +1 -1
  46. package/dist/sys/node/worker.mjs +3 -12
  47. package/dist/testing/index.d.mts +4763 -12
  48. package/dist/testing/index.mjs +7939 -619
  49. package/dist/util-C-H1H84W.mjs +731 -0
  50. package/dist/validation-ByYYKvnS.mjs +825 -0
  51. package/package.json +91 -59
  52. package/dist/chunk-ClPoSABd.mjs +0 -21
  53. package/dist/index-Bxo2jCf6.d.mts +0 -77
  54. package/dist/runtime/app-data/index.d.ts +0 -30
  55. package/dist/serialize-BJvhE9aQ.mjs +0 -775
  56. package/dist/validation-BdcPruW_.mjs +0 -1451
  57. /package/{LICENSE.md → LICENSE} +0 -0
  58. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
@@ -1,3 +1,6 @@
1
+ import { BUILD, Env, NAMESPACE } from "@stencil/core/app-data";
2
+ import "rolldown";
3
+ import "typescript";
1
4
  //#region src/declarations/stencil-public-runtime.d.ts
2
5
  interface UserBuildConditionals {
3
6
  isDev: boolean;
@@ -8,6 +11,17 @@ interface UserBuildConditionals {
8
11
  type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
9
12
  type ErrorHandler = (err: any, element?: HTMLElement) => void;
10
13
  type TagTransformer = (tag: string) => string;
14
+ /**
15
+ * A map of `@Prop`/`@State` property names to their new and previous
16
+ * values, passed to `componentShouldUpdate` once per render cycle.
17
+ *
18
+ * Pass `this` as `T` to type `changes` against your component's own
19
+ * members, e.g. `componentShouldUpdate(changes: ComponentShouldUpdateChanges<this>)`.
20
+ */
21
+ type ComponentShouldUpdateChanges<T = any> = { [K in Extract<keyof T, string>]?: {
22
+ newVal: T[K];
23
+ oldVal: T[K];
24
+ }; };
11
25
  interface ComponentInterface {
12
26
  connectedCallback?(): void;
13
27
  disconnectedCallback?(): void;
@@ -33,14 +47,18 @@ interface ComponentInterface {
33
47
  */
34
48
  componentDidLoad?(): void;
35
49
  /**
36
- * A `@Prop` or `@State` property changed and a rerender is about to be requested.
50
+ * One or more `@Prop` or `@State` properties changed and a rerender is
51
+ * about to be requested. `changes` contains every property that changed
52
+ * since the last render, keyed by property name.
37
53
  *
38
- * Called multiple times throughout the life of
39
- * the component as its properties change.
54
+ * Called once per render cycle, batching all properties that changed
55
+ * synchronously since the last render.
56
+ *
57
+ * Return `false` to prevent the pending render.
40
58
  *
41
59
  * componentShouldUpdate is not called on the first render.
42
60
  */
43
- componentShouldUpdate?(newVal: any, oldVal: any, propName: string): boolean | void;
61
+ componentShouldUpdate?(changes: ComponentShouldUpdateChanges<this>): boolean | void;
44
62
  /**
45
63
  * The component is about to update and re-render.
46
64
  *
@@ -104,7 +122,7 @@ interface FunctionalUtilities {
104
122
  map: (children: VNode[], cb: (vnode: ChildNode$1, index: number, array: ChildNode$1[]) => ChildNode$1) => VNode[];
105
123
  }
106
124
  interface FunctionalComponent<T = {}> {
107
- (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[] | null;
125
+ (props: T, children: VNode[], utils: FunctionalUtilities): VNode | null;
108
126
  }
109
127
  /**
110
128
  * A Child VDOM node
@@ -115,7 +133,7 @@ interface FunctionalComponent<T = {}> {
115
133
  * {@link FunctionalUtilities}).
116
134
  */
117
135
  interface ChildNode$1 {
118
- vtag?: string | number | Function;
136
+ vtag?: string | number | Function | symbol | null;
119
137
  vkey?: string | number;
120
138
  vtext?: string;
121
139
  vchildren?: VNode[];
@@ -127,19 +145,21 @@ interface ChildNode$1 {
127
145
  */
128
146
  interface VNode {
129
147
  $flags$: number;
130
- $tag$: string | number | Function;
148
+ $tag$: string | number | Function | symbol | null;
131
149
  $elm$: any;
132
150
  $text$: string;
133
151
  $children$: VNode[];
134
152
  $attrs$?: any;
135
153
  $name$?: string;
136
154
  $key$?: string | number;
155
+ /** Signal reference for vdom bypass: signal text nodes store the signal here. */
156
+ $signal$?: any;
137
157
  }
138
158
  interface CustomElementsDefineOptions {
139
159
  exclude?: string[];
140
160
  syncQueue?: boolean;
141
- /** @deprecated in-favour of `setTagTransformer` and `transformTag` */
142
- transformTagName?: (tagName: string) => string;
161
+ /** Scoped custom element registry to define components in. Defaults to the global registry. */
162
+ registry?: CustomElementRegistry;
143
163
  jmp?: (c: Function) => any;
144
164
  raf?: (c: FrameRequestCallback) => number;
145
165
  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
@@ -148,7 +168,7 @@ interface CustomElementsDefineOptions {
148
168
  }
149
169
  //#endregion
150
170
  //#region src/declarations/stencil-public-compiler.d.ts
151
- interface HydrateDocumentOptions {
171
+ interface SsrDocumentOptions {
152
172
  /**
153
173
  * Build ID that will be added to `<html data-stencil-build="BUILD_ID">`. By default
154
174
  * a random ID will be generated
@@ -165,7 +185,7 @@ interface HydrateDocumentOptions {
165
185
  * JavaScript to read the structure of the HTML and rebuild each
166
186
  * component. Defaults to `true`.
167
187
  */
168
- clientHydrateAnnotations?: boolean;
188
+ clientSsrAnnotations?: boolean;
169
189
  /**
170
190
  * Constrain `setTimeout()` to 1ms, but still async. Also
171
191
  * only allows `setInterval()` to fire once, also constrained to 1ms.
@@ -198,6 +218,16 @@ interface HydrateDocumentOptions {
198
218
  * Sets `document.referrer`
199
219
  */
200
220
  referrer?: string;
221
+ /**
222
+ * Render into one long-lived mock window, reset between renders, instead of creating a new one
223
+ * for every call. Skips evaluating the whole SSR platform (runtime and every component)
224
+ * on each render: most of the cost of rendering a small fragment, and a good part of a whole page.
225
+ *
226
+ * Applies to HTML string input (not a `Document`). One window per distinct `serializeShadowRoot` value,
227
+ * and renders sharing a window run one at a time.
228
+ * Defaults to `false`, except in the `ssr-wasm` output target, where it defaults to `true`.
229
+ */
230
+ reuseWindow?: boolean;
201
231
  /**
202
232
  * Removes every `<script>` element found in the `document`. Defaults to `false`.
203
233
  */
@@ -264,22 +294,30 @@ interface HydrateDocumentOptions {
264
294
  default: 'declarative-shadow-dom' | 'scoped';
265
295
  } | boolean;
266
296
  }
267
- interface SerializeDocumentOptions extends HydrateDocumentOptions {
297
+ interface SerializeDocumentOptions extends SsrDocumentOptions {
268
298
  /**
269
299
  * Runs after the `document` has been hydrated.
270
300
  */
301
+ afterSsr?(document: any): any | Promise<any>;
302
+ /**
303
+ * @deprecated Use `afterSsr` instead.
304
+ */
271
305
  afterHydrate?(document: any): any | Promise<any>;
272
306
  /**
273
307
  * Sets an approximate line width the HTML should attempt to stay within.
274
308
  * Note that this is "approximate", in that HTML may often not be able
275
309
  * to be split at an exact line width. Additionally, new lines created
276
310
  * is where HTML naturally already has whitespace, such as before an
277
- * attribute or spaces between words. Defaults to `100`.
311
+ * attribute or spaces between words. Defaults to no wrapping (`100` when prerendering).
278
312
  */
279
313
  approximateLineWidth?: number;
280
314
  /**
281
315
  * Runs before the `document` has been hydrated.
282
316
  */
317
+ beforeSsr?(document: any): any | Promise<any>;
318
+ /**
319
+ * @deprecated Use `beforeSsr` instead.
320
+ */
283
321
  beforeHydrate?(document: any): any | Promise<any>;
284
322
  /**
285
323
  * Format the HTML in a nicely indented format.
@@ -288,12 +326,12 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
288
326
  prettyHtml?: boolean;
289
327
  /**
290
328
  * Remove quotes from attribute values when possible.
291
- * Defaults to `true`.
329
+ * Defaults to `false` (`true` when prerendering).
292
330
  */
293
331
  removeAttributeQuotes?: boolean;
294
332
  /**
295
333
  * Remove the `=""` from standardized `boolean` attributes,
296
- * such as `hidden` or `checked`. Defaults to `true`.
334
+ * such as `hidden` or `checked`. Defaults to `false` (`true` when prerendering).
297
335
  */
298
336
  removeBooleanAttributeQuotes?: boolean;
299
337
  /**
@@ -302,7 +340,7 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
302
340
  */
303
341
  removeEmptyAttributes?: boolean;
304
342
  /**
305
- * Remove HTML comments. Defaults to `true`.
343
+ * Remove HTML comments. Defaults to `false` (`true` when prerendering).
306
344
  */
307
345
  removeHtmlComments?: boolean;
308
346
  /**
@@ -317,10 +355,16 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
317
355
  */
318
356
  modes?: ResolutionHandler[];
319
357
  }
320
- interface HydrateFactoryOptions extends SerializeDocumentOptions {
358
+ interface SsrFactoryOptions extends SerializeDocumentOptions {
321
359
  serializeToHtml: boolean;
322
360
  destroyWindow: boolean;
323
361
  destroyDocument: boolean;
362
+ /**
363
+ * A canonical key for `serializeShadowRoot`, set by the renderer. Renders with the same key
364
+ * render every component the same way, so they can share an SSR platform.
365
+ * @internal
366
+ */
367
+ serializeShadowRootKey?: string;
324
368
  }
325
369
  interface Diagnostic {
326
370
  absFilePath?: string | undefined;
@@ -345,96 +389,6 @@ interface PrintLine {
345
389
  errorCharStart: number;
346
390
  errorLength?: number;
347
391
  }
348
- interface BuildFeatures {
349
- style: boolean;
350
- mode: boolean;
351
- formAssociated: boolean;
352
- shadowDom: boolean;
353
- shadowDelegatesFocus: boolean;
354
- shadowSlotAssignmentManual: boolean;
355
- scoped: boolean;
356
- /**
357
- * Every component has a render function
358
- */
359
- allRenderFn: boolean;
360
- /**
361
- * At least one component has a render function
362
- */
363
- hasRenderFn: boolean;
364
- vdomRender: boolean;
365
- vdomAttribute: boolean;
366
- vdomClass: boolean;
367
- vdomFunctional: boolean;
368
- vdomKey: boolean;
369
- vdomListener: boolean;
370
- vdomPropOrAttr: boolean;
371
- vdomRef: boolean;
372
- vdomStyle: boolean;
373
- vdomText: boolean;
374
- vdomXlink: boolean;
375
- slotRelocation: boolean;
376
- slot: boolean;
377
- svg: boolean;
378
- element: boolean;
379
- event: boolean;
380
- hostListener: boolean;
381
- hostListenerTargetWindow: boolean;
382
- hostListenerTargetDocument: boolean;
383
- hostListenerTargetBody: boolean;
384
- /**
385
- * @deprecated Prevented from new apps, but left in for older collections
386
- */
387
- hostListenerTargetParent: boolean;
388
- hostListenerTarget: boolean;
389
- method: boolean;
390
- prop: boolean;
391
- propChangeCallback: boolean;
392
- propMutable: boolean;
393
- state: boolean;
394
- member: boolean;
395
- updatable: boolean;
396
- propBoolean: boolean;
397
- propNumber: boolean;
398
- propString: boolean;
399
- serializer: boolean;
400
- deserializer: boolean;
401
- lifecycle: boolean;
402
- asyncLoading: boolean;
403
- observeAttribute: boolean;
404
- reflect: boolean;
405
- taskQueue: boolean;
406
- }
407
- interface BuildConditionals extends Partial<BuildFeatures> {
408
- hotModuleReplacement?: boolean;
409
- isDebug?: boolean;
410
- isTesting?: boolean;
411
- isDev?: boolean;
412
- devTools?: boolean;
413
- invisiblePrehydration?: boolean;
414
- hydrateServerSide?: boolean;
415
- hydrateClientSide?: boolean;
416
- lifecycleDOMEvents?: boolean;
417
- cssAnnotations?: boolean;
418
- lazyLoad?: boolean;
419
- profile?: boolean;
420
- constructableCSS?: boolean;
421
- appendChildSlotFix?: boolean;
422
- slotChildNodesFix?: boolean;
423
- scopedSlotTextContentFix?: boolean;
424
- cloneNodeFix?: boolean;
425
- hydratedAttribute?: boolean;
426
- hydratedClass?: boolean;
427
- hydratedSelectorName?: string;
428
- initializeNextTick?: boolean;
429
- shadowDomShim?: boolean;
430
- asyncQueue?: boolean;
431
- transformTagName?: boolean;
432
- additionalTagTransformers?: boolean | 'prod';
433
- attachStyles?: boolean;
434
- experimentalSlotFixes?: boolean;
435
- experimentalScopedSlotChanges?: boolean;
436
- addGlobalStyleToComponents?: boolean;
437
- }
438
392
  interface ComponentConstructor {
439
393
  is?: string;
440
394
  properties?: ComponentConstructorProperties;
@@ -501,7 +455,9 @@ interface HostElement extends HTMLElement {
501
455
  disconnectedCallback?: () => void;
502
456
  host?: Element;
503
457
  forceUpdate?: () => void;
504
- __stencil__getHostRef?: () => HostRef;
458
+ __s_ghr?: () => HostRef;
459
+ /** attaches the component's shadow root if it needs one and doesn't have one yet */
460
+ __attachShadow?: () => void;
505
461
  /**
506
462
  * Unique stencil id for this element
507
463
  */
@@ -555,9 +511,18 @@ interface HostElement extends HTMLElement {
555
511
  * must be resolved for the top, ancestor component to be fully hydrated
556
512
  */
557
513
  ['s-p']?: Promise<void>[];
514
+ /**
515
+ * Pending Connects:
516
+ * A list of {@link HostRef.$onFirstConnectPromise$} promises for descendants that
517
+ * were already registered with this component (their nearest Stencil ancestor) by
518
+ * the time this component's own initial `componentWillLoad` was scheduled. Awaited
519
+ * so this component's `componentWillLoad` can't fire before those descendants'
520
+ * real `connectedCallback`s have.
521
+ */
522
+ ['s-pc']?: Promise<void>[];
558
523
  componentOnReady?: () => Promise<this>;
559
524
  }
560
- interface HydrateResults {
525
+ interface SsrResults {
561
526
  buildId: string;
562
527
  diagnostics: Diagnostic[];
563
528
  url: string;
@@ -569,42 +534,42 @@ interface HydrateResults {
569
534
  search: string | null;
570
535
  hash: string | null;
571
536
  html: string | null;
572
- components: HydrateComponent[];
573
- anchors: HydrateAnchorElement[];
574
- imgs: HydrateImgElement[];
575
- scripts: HydrateScriptElement[];
576
- styles: HydrateStyleElement[];
577
- staticData: HydrateStaticData[];
537
+ components: SsrComponent[];
538
+ anchors: SsrAnchorElement[];
539
+ imgs: SsrImgElement[];
540
+ scripts: SsrScriptElement[];
541
+ styles: SsrStyleElement[];
542
+ staticData: SsrStaticData[];
578
543
  title: string | null;
579
544
  hydratedCount: number;
580
545
  httpStatus: number | null;
581
546
  }
582
- interface HydrateComponent {
547
+ interface SsrComponent {
583
548
  tag: string;
584
549
  mode: string;
585
550
  count: number;
586
551
  depth: number;
587
552
  }
588
- interface HydrateElement {
553
+ interface SsrElement {
589
554
  [attrName: string]: string | undefined;
590
555
  }
591
- interface HydrateAnchorElement extends HydrateElement {
556
+ interface SsrAnchorElement extends SsrElement {
592
557
  href?: string;
593
558
  target?: string;
594
559
  }
595
- interface HydrateImgElement extends HydrateElement {
560
+ interface SsrImgElement extends SsrElement {
596
561
  src?: string;
597
562
  }
598
- interface HydrateScriptElement extends HydrateElement {
563
+ interface SsrScriptElement extends SsrElement {
599
564
  src?: string;
600
565
  type?: string;
601
566
  }
602
- interface HydrateStyleElement extends HydrateElement {
567
+ interface SsrStyleElement extends SsrElement {
603
568
  id?: string;
604
569
  href?: string;
605
570
  content?: string;
606
571
  }
607
- interface HydrateStaticData {
572
+ interface SsrStaticData {
608
573
  id: string;
609
574
  type: string;
610
575
  content: string;
@@ -646,6 +611,11 @@ interface RenderNode extends HostElement {
646
611
  * Slot name of either the slot itself or the slotted node
647
612
  */
648
613
  ['s-sn']?: string;
614
+ /**
615
+ * `slot` attribute of a `<slot>` reference rendered as a text node (no fallback content),
616
+ * since text nodes can't carry real DOM attributes.
617
+ */
618
+ ['s-sa']?: string;
649
619
  /**
650
620
  * Host element tag name:
651
621
  * The tag name of the host element that this
@@ -698,64 +668,64 @@ interface RenderNode extends HostElement {
698
668
  * Used to know the components encapsulation.
699
669
  * empty "" for shadow, "c" from scoped
700
670
  */
701
- ['s-en']?: '' | /*shadow*/'c';
671
+ ['s-en']?: '' | /*shadow*/ 'c';
702
672
  /**
703
673
  * On a `scoped: true` component
704
- * with `experimentalSlotFixes` flag enabled,
674
+ * with `lightDomPatches` flag enabled,
705
675
  * returns the internal `childNodes` of the component
706
676
  */
707
677
  readonly __childNodes?: NodeListOf<ChildNode>;
708
678
  /**
709
679
  * On a `scoped: true` component
710
- * with `experimentalSlotFixes` flag enabled,
680
+ * with `lightDomPatches` flag enabled,
711
681
  * returns the internal `children` of the component
712
682
  */
713
683
  readonly __children?: HTMLCollectionOf<Element>;
714
684
  /**
715
685
  * On a `scoped: true` component
716
- * with `experimentalSlotFixes` flag enabled,
686
+ * with `lightDomPatches` flag enabled,
717
687
  * returns the internal `firstChild` of the component
718
688
  */
719
689
  readonly __firstChild?: ChildNode;
720
690
  /**
721
691
  * On a `scoped: true` component
722
- * with `experimentalSlotFixes` flag enabled,
692
+ * with `lightDomPatches` flag enabled,
723
693
  * returns the internal `lastChild` of the component
724
694
  */
725
695
  readonly __lastChild?: ChildNode;
726
696
  /**
727
697
  * On a `scoped: true` component
728
- * with `experimentalSlotFixes` flag enabled,
698
+ * with `lightDomPatches` flag enabled,
729
699
  * returns the internal `textContent` of the component
730
700
  */
731
701
  __textContent?: string;
732
702
  /**
733
703
  * On a `scoped: true` component
734
- * with `experimentalSlotFixes` flag enabled,
704
+ * with `lightDomPatches` flag enabled,
735
705
  * gives access to the original `append` method
736
706
  */
737
707
  __append?: (...nodes: (Node | string)[]) => void;
738
708
  /**
739
709
  * On a `scoped: true` component
740
- * with `experimentalSlotFixes` flag enabled,
710
+ * with `lightDomPatches` flag enabled,
741
711
  * gives access to the original `prepend` method
742
712
  */
743
713
  __prepend?: (...nodes: (Node | string)[]) => void;
744
714
  /**
745
715
  * On a `scoped: true` component
746
- * with `experimentalSlotFixes` flag enabled,
716
+ * with `lightDomPatches` flag enabled,
747
717
  * gives access to the original `appendChild` method
748
718
  */
749
719
  __appendChild?: <T extends Node>(newChild: T) => T;
750
720
  /**
751
721
  * On a `scoped: true` component
752
- * with `experimentalSlotFixes` flag enabled,
722
+ * with `lightDomPatches` flag enabled,
753
723
  * gives access to the original `insertBefore` method
754
724
  */
755
725
  __insertBefore?: <T extends Node>(node: T, child: Node | null) => T;
756
726
  /**
757
727
  * On a `scoped: true` component
758
- * with `experimentalSlotFixes` flag enabled,
728
+ * with `lightDomPatches` flag enabled,
759
729
  * gives access to the original `removeChild` method
760
730
  */
761
731
  __removeChild?: <T extends Node>(child: T) => T;
@@ -793,40 +763,58 @@ interface PatchedSlotNode extends Node {
793
763
  ['s-sr']?: boolean;
794
764
  /**
795
765
  * On a `scoped: true` component
796
- * with `experimentalSlotFixes` flag enabled,
766
+ * with `lightDomPatches` flag enabled,
797
767
  * returns the actual `parentNode` of the component
798
768
  */
799
769
  __parentNode?: RenderNode;
800
770
  /**
801
771
  * On a `scoped: true` component
802
- * with `experimentalSlotFixes` flag enabled,
772
+ * with `lightDomPatches` flag enabled,
803
773
  * returns the actual `nextSibling` of the component
804
774
  */
805
775
  __nextSibling?: RenderNode;
806
776
  /**
807
777
  * On a `scoped: true` component
808
- * with `experimentalSlotFixes` flag enabled,
778
+ * with `lightDomPatches` flag enabled,
809
779
  * returns the actual `previousSibling` of the component
810
780
  */
811
781
  __previousSibling?: RenderNode;
812
782
  /**
813
783
  * On a `scoped: true` component
814
- * with `experimentalSlotFixes` flag enabled,
784
+ * with `lightDomPatches` flag enabled,
815
785
  * returns the actual `nextElementSibling` of the component
816
786
  */
817
787
  __nextElementSibling?: RenderNode;
818
788
  /**
819
789
  * On a `scoped: true` component
820
- * with `experimentalSlotFixes` flag enabled,
790
+ * with `lightDomPatches` flag enabled,
821
791
  * returns the actual `nextElementSibling` of the component
822
792
  */
823
793
  __previousElementSibling?: RenderNode;
824
794
  }
825
795
  type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
826
- type LazyBundleRuntimeData = [/** bundleIds */string, ComponentRuntimeMetaCompact[]];
827
- type ComponentRuntimeMetaCompact = [/** flags */number, /** tagname */string, /** members */{
796
+ type LazyBundleRuntimeData = [
797
+ /** bundleIds */
798
+ string, ComponentRuntimeMetaCompact[]];
799
+ type ComponentRuntimeMetaCompact = [
800
+ /** flags */
801
+ number,
802
+ /** tagname */
803
+ string,
804
+ /** members */
805
+ {
828
806
  [memberName: string]: ComponentRuntimeMember;
829
- }?, /** listeners */ComponentRuntimeHostListener[]?, /** watchers */ComponentConstructorChangeHandlers?, /** serializers */ComponentConstructorChangeHandlers?, /** deserializers */ComponentConstructorChangeHandlers?];
807
+ }?,
808
+ /** listeners */
809
+ ComponentRuntimeHostListener[]?,
810
+ /** watchers */
811
+ ComponentConstructorChangeHandlers?,
812
+ /** serializers */
813
+ ComponentConstructorChangeHandlers?,
814
+ /** deserializers */
815
+ ComponentConstructorChangeHandlers?,
816
+ /** shadow root reference target */
817
+ string?];
830
818
  /**
831
819
  * Runtime metadata for a Stencil component
832
820
  */
@@ -873,6 +861,10 @@ interface ComponentRuntimeMeta {
873
861
  * Information about which class members have attribute > prop deserializers attached on the component.
874
862
  */
875
863
  $deserializers$?: ComponentConstructorChangeHandlers;
864
+ /**
865
+ * `id` of the element within the shadow root that IDREFs targeting the host resolve to.
866
+ */
867
+ $referenceTarget$?: string;
876
868
  }
877
869
  /**
878
870
  * A mapping of the names of members on the component to some runtime-specific
@@ -918,7 +910,7 @@ type ComponentRuntimeReflectingAttr = [string, string | undefined];
918
910
  * associated {@link HostRef} instance.
919
911
  */
920
912
  type RuntimeRef = HostElement | {
921
- __stencil__getHostRef?: () => HostRef;
913
+ __s_ghr?: () => HostRef;
922
914
  };
923
915
  /**
924
916
  * Interface used to track an Element, it's virtual Node (`VNode`), and other data
@@ -929,6 +921,14 @@ interface HostRef {
929
921
  $cmpMeta$: ComponentRuntimeMeta;
930
922
  $hostElement$: HostElement;
931
923
  $instanceValues$?: Map<string, any>;
924
+ /**
925
+ * Prop/state changes accumulated since the last render, flushed to
926
+ * `componentShouldUpdate` once per render cycle.
927
+ */
928
+ $queuedPropChanges$?: ComponentShouldUpdateChanges;
929
+ $signalValues$?: Map<string, import('@preact/signals-core').Signal<any>>;
930
+ /** Dispose function that tears down all signal effects for this component. */
931
+ $signalCleanup$?: () => void;
932
932
  $serializerValues$?: Map<string, string>;
933
933
  $lazyInstance$?: ComponentInterface;
934
934
  /**
@@ -961,6 +961,21 @@ interface HostRef {
961
961
  * It is called after {@link HostRef.$onInstancePromise$} resolves.
962
962
  */
963
963
  $onRenderResolve$?: () => void;
964
+ /**
965
+ * A promise that resolves once this component's real `connectedCallback` has fired
966
+ * for the first time. Created lazily - either by a descendant that needs to wait for
967
+ * this component's connection before firing its own real `connectedCallback`
968
+ * ({@link HOST_FLAGS.hasFiredConnected}), or by this component registering itself
969
+ * with its nearest Stencil ancestor's `s-pc` list. This is what lets a component's
970
+ * real `connectedCallback` (and, transitively, a pending ancestor's initial
971
+ * `componentWillLoad`) stay ordered correctly regardless of which of an
972
+ * ancestor/descendant pair's lazy module happens to resolve first.
973
+ */
974
+ $onFirstConnectPromise$?: Promise<void>;
975
+ /**
976
+ * A callback which resolves {@link HostRef.$onFirstConnectPromise$}
977
+ */
978
+ $onFirstConnectResolve$?: () => void;
964
979
  $vnode$?: VNode;
965
980
  $queuedListeners$?: [string, any][];
966
981
  $rmListeners$?: (() => void)[];
@@ -970,6 +985,11 @@ interface HostRef {
970
985
  * Defer connectedCallback until after first render for components with slot relocation.
971
986
  */
972
987
  $deferredConnectedCallback$?: boolean;
988
+ /**
989
+ * The number of times this host's lazy component load has failed and been retried.
990
+ * Used to give up retrying after {@link MAX_LAZY_LOAD_RETRIES} failed attempts.
991
+ */
992
+ $loadRetryCount$?: number;
973
993
  }
974
994
  interface PlatformRuntime {
975
995
  /**
@@ -1019,46 +1039,27 @@ type ChildType = VNode | number | string;
1019
1039
  //#region src/server/platform/h-async.d.ts
1020
1040
  declare const hAsync: (nodeName: any, vnodeData: any, ...children: ChildType[]) => VNode | Promise<VNode>;
1021
1041
  //#endregion
1022
- //#region src/server/platform/hydrate-app.d.ts
1023
- declare function hydrateApp(win: Window & typeof globalThis, opts: HydrateFactoryOptions, results: HydrateResults, afterHydrate: (win: Window, opts: HydrateFactoryOptions, results: HydrateResults, resolve: (results: HydrateResults) => void) => void, resolve: (results: HydrateResults) => void): void;
1024
- //#endregion
1025
- //#region src/app-data/index.d.ts
1042
+ //#region src/server/platform/ssr-app.d.ts
1026
1043
  /**
1027
- * A collection of default build flags for a Stencil project.
1028
- *
1029
- * This collection can be found throughout the Stencil codebase, often imported from the `virtual:app-data` module like so:
1030
- * ```ts
1031
- * import { BUILD } from 'virtual:app-data';
1032
- * ```
1033
- * and is used to determine if a portion of the output of a Stencil _project_'s compilation step can be eliminated.
1034
- *
1035
- * e.g. When `BUILD.allRenderFn` evaluates to `false`, the compiler will eliminate conditional statements like:
1036
- * ```ts
1037
- * if (BUILD.allRenderFn) {
1038
- * // some code that will be eliminated if BUILD.allRenderFn is false
1039
- * }
1040
- * ```
1041
- *
1042
- * `virtual:app-data`, the module that `BUILD` is imported from, is an alias for the `@stencil/core/runtime/app-data`, and is
1043
- * partially referenced by {@link STENCIL_APP_DATA_ID}. The `src/compiler/bundle/app-data-plugin.ts` references
1044
- * `STENCIL_APP_DATA_ID` uses it to replace these defaults with {@link BuildConditionals} that are derived from a
1045
- * Stencil project's contents (i.e. metadata from the components). This replacement happens at a Stencil project's
1046
- * compile time. Such code can be found at `src/compiler/app-core/app-data.ts`.
1044
+ * SSR a Document by patching the DOM APIs to wait for components to be connected and hydrated
1045
+ * before allowing them to be added to the document.
1046
+ * Once all components are hydrated, the `afterSsr` callback is called so that the caller can serialize
1047
+ * the document to HTML and send it back to the client.
1048
+ * @param win The window to use for SSR. This should be a patched window created by `patchDomImplementation`.
1049
+ * @param opts The options to use for SSR. This is used to configure which components should be hydrated, how long to wait for hydration, etc.
1050
+ * @param results The results object to store the hydration results.
1051
+ * @param afterSsr The callback to be called after SSR is complete.
1052
+ * @param resolve The resolve function to be called when SSR is complete.
1053
+ * @param abortController The AbortController to use for aborting in-flight fetch() calls and other cancellable work when SSR times out.
1047
1054
  */
1048
- declare const BUILD: BuildConditionals;
1049
- declare const Env: {};
1050
- declare const NAMESPACE: string;
1055
+ declare function ssrApp(win: Window & typeof globalThis, opts: SsrFactoryOptions, results: SsrResults, afterSsr: (win: Window, opts: SsrFactoryOptions, results: SsrResults, resolve: (results: SsrResults) => void) => void, resolve: (results: SsrResults) => void, abortController: AbortController): void;
1051
1056
  //#endregion
1052
- //#region src/runtime/asset-path.d.ts
1053
- declare const getAssetPath: (path: string) => string;
1054
- declare const setAssetPath: (path: string) => string;
1055
- //#endregion
1056
- //#region src/runtime/bootstrap-custom-element.d.ts
1057
+ //#region src/runtime/bootstrap-standalone.d.ts
1057
1058
  declare const defineCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => void;
1058
1059
  declare const proxyCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => any;
1059
1060
  declare const forceModeUpdate: (elm: RenderNode) => void;
1060
1061
  //#endregion
1061
- //#region src/runtime/bootstrap-lazy.d.ts
1062
+ //#region src/runtime/bootstrap-loader.d.ts
1062
1063
  declare const bootstrapLazy: (lazyBundles: LazyBundlesRuntimeData, options?: CustomElementsDefineOptions) => void;
1063
1064
  //#endregion
1064
1065
  //#region src/runtime/connected-callback.d.ts
@@ -1069,6 +1070,18 @@ declare const disconnectedCallback: (elm: HostElement) => Promise<void>;
1069
1070
  //#endregion
1070
1071
  //#region src/runtime/element.d.ts
1071
1072
  declare const getElement: (ref: any) => HostElement;
1073
+ /**
1074
+ * Get the shadow root for a Stencil component's host element.
1075
+ * This works for both open and closed shadow DOM modes.
1076
+ *
1077
+ * For closed shadow DOM, `element.shadowRoot` returns `null` by design,
1078
+ * but Stencil stores the reference internally so components can still
1079
+ * access their own shadow root.
1080
+ *
1081
+ * @param element The host element (from @Element() decorator)
1082
+ * @returns The shadow root, or null if no shadow root exists
1083
+ */
1084
+ declare const getShadowRoot: (element: HTMLElement) => ShadowRoot | null;
1072
1085
  //#endregion
1073
1086
  //#region src/runtime/event-emitter.d.ts
1074
1087
  declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
@@ -1079,20 +1092,46 @@ declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
1079
1092
  declare const Fragment: FunctionalComponent;
1080
1093
  //#endregion
1081
1094
  //#region src/runtime/host-listener.d.ts
1082
- declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[], attachParentListeners?: boolean) => void;
1095
+ declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]) => void;
1096
+ //#endregion
1097
+ //#region src/runtime/inject-side-effect-style.d.ts
1098
+ /**
1099
+ * Registers a root (a shadow root, or `document`) to receive every side-effect CSS import
1100
+ * (a plain, non-component `import './foo.css'`), now and in future. Call in `connectedCallback`,
1101
+ * paired with `unregisterSideEffectStyleTarget` in `disconnectedCallback` so the registry doesn't
1102
+ * hold disconnected roots forever.
1103
+ * @param root the root to register
1104
+ */
1105
+ declare function registerSideEffectStyleTarget(root: DocumentOrShadowRoot): void;
1106
+ /**
1107
+ * Removes a root registered via `registerSideEffectStyleTarget` - call in `disconnectedCallback`.
1108
+ * @param root the root to unregister
1109
+ */
1110
+ declare function unregisterSideEffectStyleTarget(root: DocumentOrShadowRoot): void;
1111
+ /**
1112
+ * Applies plain (non-component) CSS text to every registered root - respects shadow DOM
1113
+ * encapsulation instead of always reaching for the top-level document. Not meant to be called
1114
+ * directly: this is what the compiler's CSS-to-ESM output calls for CSS with no Stencil `tag`
1115
+ * (i.e. not a component's own `styleUrl`), typically a third-party dependency's CSS import.
1116
+ *
1117
+ * `@font-face` rules are pulled out and adopted onto top-level `document` not per-root
1118
+ * (Chromium (https://issues.chromium.org/issues/41085401) per-root never loads).
1119
+ * @param cssText the CSS text to apply
1120
+ */
1121
+ declare function injectSideEffectStyle(cssText: string): void;
1083
1122
  //#endregion
1084
1123
  //#region src/runtime/mixin.d.ts
1085
1124
  type Ctor<T = {}> = new (...args: any[]) => T;
1086
1125
  declare function Mixin(...mixins: ((base: Ctor) => Ctor)[]): Ctor<{}>;
1087
1126
  //#endregion
1088
1127
  //#region src/runtime/mode.d.ts
1089
- declare const setMode: (handler: ResolutionHandler) => number;
1128
+ declare const setMode: (handler: ResolutionHandler) => void;
1090
1129
  declare const getMode: (ref: RuntimeRef) => string;
1091
1130
  //#endregion
1092
1131
  //#region src/runtime/nonce.d.ts
1093
1132
  /**
1094
1133
  * Assigns the given value to the nonce property on the runtime platform object.
1095
- * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
1134
+ * During runtime, this value is used to set the nonce attribute on all dynamically created style tags.
1096
1135
  * @param nonce The value to be assigned to the platform nonce property.
1097
1136
  * @returns void
1098
1137
  */
@@ -1120,10 +1159,9 @@ declare const setNonce: (nonce: string) => string;
1120
1159
  *
1121
1160
  * @param propValue the new value to coerce to some type
1122
1161
  * @param propType the type of the prop, expressed as a binary number
1123
- * @param isFormAssociated whether the component is form-associated (optional)
1124
1162
  * @returns the parsed/coerced value
1125
1163
  */
1126
- declare const parsePropertyValue: (propValue: unknown, propType: number, isFormAssociated?: boolean) => any;
1164
+ declare const parsePropertyValue: (propValue: unknown, propType: number) => any;
1127
1165
  //#endregion
1128
1166
  //#region src/runtime/proxy-component.d.ts
1129
1167
  /**
@@ -1136,9 +1174,9 @@ declare const parsePropertyValue: (propValue: unknown, propType: number, isFormA
1136
1174
  *
1137
1175
  * On a traditional component, this is wired up to the element only.
1138
1176
  *
1139
- * @param Cstr the constructor for a component that we need to process
1140
- * @param cmpMeta metadata collected previously about the component
1141
- * @param flags a number used to store a series of bit flags
1177
+ * @param Cstr - the constructor for a component that we need to process
1178
+ * @param cmpMeta - metadata collected previously about the component
1179
+ * @param flags - a number used to store a series of bit flags
1142
1180
  * @returns a reference to the same constructor passed in (but now mutated)
1143
1181
  */
1144
1182
  declare const proxyComponent: (Cstr: ComponentConstructor, cmpMeta: ComponentRuntimeMeta, flags: number) => ComponentConstructor;
@@ -1168,42 +1206,12 @@ declare const forceUpdate: (ref: any) => boolean;
1168
1206
  //#region src/runtime/vdom/h.d.ts
1169
1207
  declare const Host: {};
1170
1208
  //#endregion
1171
- //#region src/runtime/vdom/jsx-dev-runtime.d.ts
1172
- /**
1173
- * JSX development runtime function for creating elements with debug info.
1174
- * Called by TypeScript's jsx transform in development mode.
1175
- *
1176
- * @param type - The element type (string tag name or functional component)
1177
- * @param props - The element props (includes children, key, etc.)
1178
- * @param key - The element's key (passed separately in dev mode)
1179
- * @param isStaticChildren - Whether children are static (optimization hint)
1180
- * @param source - Source location information for debugging
1181
- * @param self - The component instance (for debugging)
1182
- * @returns A virtual DOM node
1183
- */
1184
- declare function jsxDEV(type: any, props: any, key?: string | number, _isStaticChildren?: boolean, _source?: any, _self?: any): VNode;
1185
- //#endregion
1186
1209
  //#region src/runtime/vdom/jsx-runtime.d.ts
1187
- /**
1188
- * JSX runtime function for creating elements in production mode.
1189
- * Called by TypeScript's jsx transform for elements without static children.
1190
- *
1191
- * @param type - The element type (string tag name or functional component)
1192
- * @param props - The element props (includes children)
1193
- * @param key - Optional key for the element
1194
- * @returns A virtual DOM node
1195
- */
1196
1210
  declare function jsx(type: any, props: any, key?: string): VNode;
1197
1211
  /**
1198
- * JSX runtime function for creating elements with static children.
1199
- * Called by TypeScript's jsx transform as an optimization when children are static.
1200
- *
1201
- * @param type - The element type (string tag name or functional component)
1202
- * @param props - The element props (includes children)
1203
- * @param key - Optional key for the element
1204
- * @returns A virtual DOM node
1212
+ * @alias
1205
1213
  */
1206
- declare function jsxs(type: any, props: any, key?: string): VNode;
1214
+ declare const jsxs: typeof jsx;
1207
1215
  //#endregion
1208
1216
  //#region src/runtime/vdom/vdom-annotations.d.ts
1209
1217
  /**
@@ -1257,7 +1265,6 @@ declare const setPlatformHelpers: (helpers: {
1257
1265
  rel?: (el: any, eventName: string, listener: any, options: any) => void;
1258
1266
  ce?: (eventName: string, opts?: any) => any;
1259
1267
  }) => void;
1260
- declare const supportsShadow: boolean;
1261
1268
  declare const supportsListenerOptions = false;
1262
1269
  declare const supportsConstructableStylesheets = false;
1263
1270
  declare const supportsMutableAdoptedStyleSheets = false;
@@ -1266,12 +1273,29 @@ declare const registerInstance: (lazyInstance: any, hostRef: HostRef) => HostRef
1266
1273
  declare const registerHost: (elm: HostElement, cmpMeta: ComponentRuntimeMeta) => HostRef;
1267
1274
  declare const Build: UserBuildConditionals;
1268
1275
  declare const styles: StyleMap;
1269
- declare const modeResolutionChain: ResolutionHandler[];
1276
+ declare const modeResolver: ResolutionHandler[];
1277
+ /**
1278
+ * Server-side implementation of getAssetPath.
1279
+ *
1280
+ * Unlike the client-side version, this doesn't use import.meta.url as a fallback
1281
+ * because it doesn't make sense in the bundled hydrate factory context.
1282
+ * The base URL must come from plt.$resourcesUrl$ (set via hydration options).
1283
+ * @param path - The relative path to the asset
1284
+ * @returns The resolved asset path, which may be an absolute URL if resourcesUrl is set to an external URL, or a relative path if resourcesUrl is a relative path or not set at all
1285
+ */
1286
+ declare const getAssetPath: (path: string) => string;
1287
+ /**
1288
+ * Sets the base URL for resolving asset paths in the server/hydrate context.
1289
+ * @param path - The base URL to use for resolving asset paths. This should typically be set to the same value as the `resourcesUrl` option passed to `ssrDocument` to ensure that asset paths are resolved correctly in the server/hydrate context.
1290
+ * If not set, it defaults to './', which is a reasonable default for server-side rendering.
1291
+ * @returns void
1292
+ */
1293
+ declare const setAssetPath: (path: string) => string;
1270
1294
  /**
1271
1295
  * Checks to see any components are rendered with `scoped`
1272
1296
  * @param opts - SSR options
1273
1297
  */
1274
- declare const setScopedSSR: (opts: HydrateFactoryOptions) => void;
1298
+ declare const setScopedSsr: (opts: SsrFactoryOptions) => void;
1275
1299
  declare const needsScopedSSR: () => boolean;
1276
1300
  //#endregion
1277
- export { BUILD, Build, Env, Fragment, Host, Mixin, NAMESPACE, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getValue, hAsync as h, hydrateApp, insertVdomAnnotations, isMemberInElement, jsx, jsxDEV, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, renderVdom, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setScopedSSR, setTagTransformer, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, supportsShadow, transformTag, win, writeTask };
1301
+ export { BUILD, Build, Env, Fragment, Host, Mixin, NAMESPACE, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getShadowRoot, getValue, hAsync as h, injectSideEffectStyle, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolver, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, registerSideEffectStyleTarget, renderVdom, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setScopedSsr, setTagTransformer, setValue, ssrApp, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, transformTag, unregisterSideEffectStyleTarget, win, writeTask };