@stencil/core 5.0.0-alpha.27 → 5.0.0-alpha.29

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 (44) hide show
  1. package/dist/app-data/index.d.ts +1 -1
  2. package/dist/{client-CvcvHKz4.mjs → client-D1MsT-Rp.mjs} +373 -238
  3. package/dist/compiler/index.d.mts +2 -3
  4. package/dist/compiler/index.mjs +3 -3
  5. package/dist/compiler/utils/index.d.mts +272 -2
  6. package/dist/compiler/utils/index.mjs +4 -3
  7. package/dist/{compiler-D43Ied7R.mjs → compiler-BbS9TDF_.mjs} +1845 -1118
  8. package/dist/declarations/stencil-ext-modules.d.ts +5 -5
  9. package/dist/declarations/stencil-public-compiler.d.ts +108 -40
  10. package/dist/declarations/stencil-public-docs.d.ts +9 -0
  11. package/dist/declarations/stencil-public-runtime.d.ts +81 -6
  12. package/dist/fragment-Di1hWOC8.mjs +4 -0
  13. package/dist/{index-F3IidHM1.d.mts → index-BHj3EBl2.d.mts} +395 -312
  14. package/dist/{index-xAkMgLX_.d.ts → index-D2PAsXxx.d.ts} +133 -9
  15. package/dist/index-VK8okIiF.d.mts +108 -0
  16. package/dist/index.d.mts +4 -0
  17. package/dist/index.mjs +91 -2
  18. package/dist/jsx-runtime.mjs +2 -1
  19. package/dist/{node-DKVq_Ud0.mjs → node-BQR4L-TG.mjs} +60 -58
  20. package/dist/reactive-controller-BdCpSAQP.d.mts +13 -0
  21. package/dist/{regular-expression-CFVJOTUh.mjs → regular-expression-XqU5zmPp.mjs} +20 -3
  22. package/dist/{chunk-z9aeyW2b.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
  23. package/dist/runtime/client/lazy.js +411 -165
  24. package/dist/runtime/client/runtime.d.ts +136 -9
  25. package/dist/runtime/client/runtime.js +411 -165
  26. package/dist/runtime/index.d.ts +5 -3
  27. package/dist/runtime/index.js +410 -163
  28. package/dist/runtime/server/index.d.mts +80 -8
  29. package/dist/runtime/server/index.mjs +333 -158
  30. package/dist/runtime/server/runner.d.mts +3 -0
  31. package/dist/runtime/server/runner.mjs +232 -308
  32. package/dist/signals/index.d.ts +2 -0
  33. package/dist/sys/node/index.d.mts +1 -2
  34. package/dist/sys/node/index.mjs +1 -1
  35. package/dist/sys/node/worker.d.mts +1 -1
  36. package/dist/sys/node/worker.mjs +6 -3
  37. package/dist/testing/index.d.mts +4 -9
  38. package/dist/testing/index.mjs +74 -56
  39. package/dist/util-BIa-iHnt.mjs +724 -0
  40. package/dist/validation-Dd3g77T5.mjs +778 -0
  41. package/package.json +27 -27
  42. package/dist/index-3fu7WQs4.d.mts +0 -205
  43. package/dist/validation-ByxKj8bC.mjs +0 -1458
  44. /package/{LICENSE.md → LICENSE} +0 -0
@@ -1,4 +1,6 @@
1
1
  import { BUILD, Env, NAMESPACE } from "@stencil/core/app-data";
2
+ import "rolldown";
3
+ import "typescript";
2
4
  //#region src/declarations/stencil-public-runtime.d.ts
3
5
  interface UserBuildConditionals {
4
6
  isDev: boolean;
@@ -9,6 +11,17 @@ interface UserBuildConditionals {
9
11
  type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
10
12
  type ErrorHandler = (err: any, element?: HTMLElement) => void;
11
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
+ }; };
12
25
  interface ComponentInterface {
13
26
  connectedCallback?(): void;
14
27
  disconnectedCallback?(): void;
@@ -34,14 +47,18 @@ interface ComponentInterface {
34
47
  */
35
48
  componentDidLoad?(): void;
36
49
  /**
37
- * 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.
38
53
  *
39
- * Called multiple times throughout the life of
40
- * 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.
41
58
  *
42
59
  * componentShouldUpdate is not called on the first render.
43
60
  */
44
- componentShouldUpdate?(newVal: any, oldVal: any, propName: string): boolean | void;
61
+ componentShouldUpdate?(changes: ComponentShouldUpdateChanges<this>): boolean | void;
45
62
  /**
46
63
  * The component is about to update and re-render.
47
64
  *
@@ -476,6 +493,15 @@ interface HostElement extends HTMLElement {
476
493
  * must be resolved for the top, ancestor component to be fully hydrated
477
494
  */
478
495
  ['s-p']?: Promise<void>[];
496
+ /**
497
+ * Pending Connects:
498
+ * A list of {@link HostRef.$onFirstConnectPromise$} promises for descendants that
499
+ * were already registered with this component (their nearest Stencil ancestor) by
500
+ * the time this component's own initial `componentWillLoad` was scheduled. Awaited
501
+ * so this component's `componentWillLoad` can't fire before those descendants'
502
+ * real `connectedCallback`s have.
503
+ */
504
+ ['s-pc']?: Promise<void>[];
479
505
  componentOnReady?: () => Promise<this>;
480
506
  }
481
507
  interface SsrResults {
@@ -567,6 +593,11 @@ interface RenderNode extends HostElement {
567
593
  * Slot name of either the slot itself or the slotted node
568
594
  */
569
595
  ['s-sn']?: string;
596
+ /**
597
+ * `slot` attribute of a `<slot>` reference rendered as a text node (no fallback content),
598
+ * since text nodes can't carry real DOM attributes.
599
+ */
600
+ ['s-sa']?: string;
570
601
  /**
571
602
  * Host element tag name:
572
603
  * The tag name of the host element that this
@@ -619,7 +650,7 @@ interface RenderNode extends HostElement {
619
650
  * Used to know the components encapsulation.
620
651
  * empty "" for shadow, "c" from scoped
621
652
  */
622
- ['s-en']?: '' | /*shadow*/'c';
653
+ ['s-en']?: '' | /*shadow*/ 'c';
623
654
  /**
624
655
  * On a `scoped: true` component
625
656
  * with `lightDomPatches` flag enabled,
@@ -744,10 +775,26 @@ interface PatchedSlotNode extends Node {
744
775
  __previousElementSibling?: RenderNode;
745
776
  }
746
777
  type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
747
- type LazyBundleRuntimeData = [/** bundleIds */string, ComponentRuntimeMetaCompact[]];
748
- type ComponentRuntimeMetaCompact = [/** flags */number, /** tagname */string, /** members */{
778
+ type LazyBundleRuntimeData = [
779
+ /** bundleIds */
780
+ string, ComponentRuntimeMetaCompact[]];
781
+ type ComponentRuntimeMetaCompact = [
782
+ /** flags */
783
+ number,
784
+ /** tagname */
785
+ string,
786
+ /** members */
787
+ {
749
788
  [memberName: string]: ComponentRuntimeMember;
750
- }?, /** listeners */ComponentRuntimeHostListener[]?, /** watchers */ComponentConstructorChangeHandlers?, /** serializers */ComponentConstructorChangeHandlers?, /** deserializers */ComponentConstructorChangeHandlers?];
789
+ }?,
790
+ /** listeners */
791
+ ComponentRuntimeHostListener[]?,
792
+ /** watchers */
793
+ ComponentConstructorChangeHandlers?,
794
+ /** serializers */
795
+ ComponentConstructorChangeHandlers?,
796
+ /** deserializers */
797
+ ComponentConstructorChangeHandlers?];
751
798
  /**
752
799
  * Runtime metadata for a Stencil component
753
800
  */
@@ -850,6 +897,11 @@ interface HostRef {
850
897
  $cmpMeta$: ComponentRuntimeMeta;
851
898
  $hostElement$: HostElement;
852
899
  $instanceValues$?: Map<string, any>;
900
+ /**
901
+ * Prop/state changes accumulated since the last render, flushed to
902
+ * `componentShouldUpdate` once per render cycle.
903
+ */
904
+ $queuedPropChanges$?: ComponentShouldUpdateChanges;
853
905
  $signalValues$?: Map<string, import('@preact/signals-core').Signal<any>>;
854
906
  /** Dispose function that tears down all signal effects for this component. */
855
907
  $signalCleanup$?: () => void;
@@ -885,6 +937,21 @@ interface HostRef {
885
937
  * It is called after {@link HostRef.$onInstancePromise$} resolves.
886
938
  */
887
939
  $onRenderResolve$?: () => void;
940
+ /**
941
+ * A promise that resolves once this component's real `connectedCallback` has fired
942
+ * for the first time. Created lazily - either by a descendant that needs to wait for
943
+ * this component's connection before firing its own real `connectedCallback`
944
+ * ({@link HOST_FLAGS.hasFiredConnected}), or by this component registering itself
945
+ * with its nearest Stencil ancestor's `s-pc` list. This is what lets a component's
946
+ * real `connectedCallback` (and, transitively, a pending ancestor's initial
947
+ * `componentWillLoad`) stay ordered correctly regardless of which of an
948
+ * ancestor/descendant pair's lazy module happens to resolve first.
949
+ */
950
+ $onFirstConnectPromise$?: Promise<void>;
951
+ /**
952
+ * A callback which resolves {@link HostRef.$onFirstConnectPromise$}
953
+ */
954
+ $onFirstConnectResolve$?: () => void;
888
955
  $vnode$?: VNode;
889
956
  $queuedListeners$?: [string, any][];
890
957
  $rmListeners$?: (() => void)[];
@@ -894,6 +961,11 @@ interface HostRef {
894
961
  * Defer connectedCallback until after first render for components with slot relocation.
895
962
  */
896
963
  $deferredConnectedCallback$?: boolean;
964
+ /**
965
+ * The number of times this host's lazy component load has failed and been retried.
966
+ * Used to give up retrying after {@link MAX_LAZY_LOAD_RETRIES} failed attempts.
967
+ */
968
+ $loadRetryCount$?: number;
897
969
  }
898
970
  interface PlatformRuntime {
899
971
  /**