@stencil/core 5.0.0-alpha.4 → 5.0.0-alpha.6

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/{client-Dti6fFpE.mjs → client-fWOou5EW.mjs} +2360 -2090
  2. package/dist/compiler/index.d.mts +5 -5
  3. package/dist/compiler/index.mjs +2 -2
  4. package/dist/compiler/utils/index.d.mts +2 -2
  5. package/dist/compiler/utils/index.mjs +3 -3
  6. package/dist/{compiler-BYRrEeD-.mjs → compiler-CdUbDTbV.mjs} +13426 -12276
  7. package/dist/declarations/stencil-public-compiler.d.ts +527 -238
  8. package/dist/declarations/stencil-public-compiler.js +2 -3
  9. package/dist/declarations/stencil-public-docs.d.ts +10 -0
  10. package/dist/declarations/stencil-public-runtime.d.ts +51 -12
  11. package/dist/{index-BwTaN1Nq.d.mts → index-D8vvsppY.d.mts} +566 -350
  12. package/dist/{index-CyrGY82h.d.ts → index-Dap2E02-.d.ts} +83 -32
  13. package/dist/{index-9LTuoSiw.d.mts → index-UUlemGuu.d.mts} +13 -2
  14. package/dist/index.d.mts +0 -1
  15. package/dist/index.mjs +1 -1
  16. package/dist/jsx-runtime.d.mts +18 -0
  17. package/dist/jsx-runtime.mjs +2 -0
  18. package/dist/{node-BF2jSfWg.mjs → node-klLZLdDe.mjs} +20 -19
  19. package/dist/{regular-expression-D5pGVpCu.mjs → regular-expression-DUdhF3Ei.mjs} +113 -29
  20. package/dist/runtime/app-data/index.d.ts +1 -1
  21. package/dist/runtime/app-data/index.js +15 -9
  22. package/dist/{runtime-COEYYPyw.js → runtime/client/lazy.js} +2596 -2182
  23. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +89 -47
  24. package/dist/runtime/client/{index.js → runtime.js} +2473 -2183
  25. package/dist/runtime/index.d.ts +46 -5
  26. package/dist/runtime/index.js +4956 -2
  27. package/dist/runtime/server/index.d.mts +85 -63
  28. package/dist/runtime/server/index.mjs +2462 -2193
  29. package/dist/runtime/server/runner.d.mts +44 -32
  30. package/dist/runtime/server/runner.mjs +335 -383
  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 +197 -45
  38. package/dist/{validation-Byxie0Uk.mjs → validation-2QipI30K.mjs} +90 -77
  39. package/package.json +41 -28
  40. package/dist/index-hS-KBdAP.d.ts +0 -30
  41. package/dist/jsx-runtime-DlDkTqps.d.ts +0 -28
  42. package/dist/jsx-runtime.d.ts +0 -2
  43. package/dist/jsx-runtime.js +0 -2
  44. /package/dist/{chunk-CjcI7cDX.mjs → chunk-z9aeyW2b.mjs} +0 -0
@@ -29,7 +29,7 @@ const LOG_LEVELS = [
29
29
  /**
30
30
  * The collection of valid export behaviors.
31
31
  * Used to generate a type for typed configs as well as output target validation
32
- * for the `dist-custom-elements` output target.
32
+ * for the `standalone` output target.
33
33
  *
34
34
  * Adding a value to this const array will automatically add it as a valid option on the
35
35
  * output target configuration for `customElementsExportBehavior`.
@@ -38,8 +38,7 @@ const LOG_LEVELS = [
38
38
  * - `auto-define-custom-elements`: Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
39
39
  * functionality allows consumers to bypass the explicit call to define a component, its children, its children's
40
40
  * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
41
- * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory. This behavior was added to allow easy migration
42
- * from `dist-custom-elements-bundle` to `dist-custom-elements`.
41
+ * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory.
43
42
  * - `single-export-module`: All components will be re-exported from the specified directory's root `index.js` file.
44
43
  */
45
44
  const CustomElementsExportBehaviorOptions = [
@@ -20,6 +20,11 @@ interface ComponentCompilerPropertyComplexType {
20
20
  * annotation in the original source file.
21
21
  */
22
22
  references: ComponentCompilerTypeReferences;
23
+ /**
24
+ * @internal TypeScript AST node used for semantic type analysis during compilation.
25
+ * Not serialized, only used internally for improved type renaming logic.
26
+ */
27
+ _astNode?: any;
23
28
  }
24
29
  /**
25
30
  * A record of `ComponentCompilerTypeReference` entities.
@@ -90,6 +95,11 @@ interface ComponentCompilerMethodComplexType {
90
95
  parameters: JsonDocMethodParameter[];
91
96
  references: ComponentCompilerTypeReferences;
92
97
  return: string;
98
+ /**
99
+ * @internal TypeScript AST method node used for semantic type analysis during compilation.
100
+ * Not serialized, only used internally for improved type renaming logic.
101
+ */
102
+ _astNode?: any;
93
103
  }
94
104
  //#endregion
95
105
  //#region src/declarations/stencil-public-docs.d.ts
@@ -55,6 +55,28 @@ interface ComponentOptions {
55
55
  * Array of relative links to folders of assets required by the component.
56
56
  */
57
57
  assetsDirs?: string[];
58
+ /**
59
+ * Relative URL to an external stylesheet providing document-level styles for this component.
60
+ * Unlike `styleUrl`, these styles are not scoped to shadow/scoped DOM - they are collected
61
+ * at build time and injected wherever `@import "stencil-globals"` appears in a global stylesheet.
62
+ *
63
+ * Useful for
64
+ * - pre-first-js-render styles (combatting cumulative layout shift)
65
+ * - host element and slotted content style
66
+ * - 'css-only' CEs - those that don't use a JS runtime at all
67
+ *
68
+ * @example
69
+ * ```tsx
70
+ * @Component({ tag: 'my-button', globalStyleUrl: './my-button.global.css' })
71
+ * ```
72
+ */
73
+ globalStyleUrl?: string;
74
+ /**
75
+ * Inline CSS string providing document-level styles for this component.
76
+ * Collected at build time and injected wherever `@import "stencil-globals"` appears.
77
+ * @see globalStyleUrl
78
+ */
79
+ globalStyle?: string;
58
80
  }
59
81
  /**
60
82
  * Shadow DOM encapsulation options for the `encapsulation` property.
@@ -83,7 +105,7 @@ interface ShadowEncapsulation {
83
105
  }
84
106
  /**
85
107
  * Patch types for non-shadow DOM components that use slots.
86
- * - `'all'`: Apply all slot-related patches (equivalent to `experimentalSlotFixes`)
108
+ * - `'all'`: Apply all slot-related patches (equivalent to `lightDomPatches: true`)
87
109
  * - `'children'`: Patch child node accessors (children, firstChild, lastChild, etc.)
88
110
  * - `'clone'`: Patch `cloneNode()` to handle slotted content
89
111
  * - `'insert'`: Patch `appendChild()`, `insertBefore()`, etc. for slot relocation
@@ -331,6 +353,7 @@ declare const Listen: ListenDecorator;
331
353
  * and object properties to their string literal values. This allows variables to be
332
354
  * used in `@Listen` and `@Event` decorators instead of hardcoded strings.
333
355
  *
356
+ *
334
357
  * @example
335
358
  * ```ts
336
359
  * const MY_EVENT = 'myEvent';
@@ -534,15 +557,16 @@ declare function setTagTransformer(transformer: TagTransformer): void;
534
557
  * @returns the transformed tag e.g. `new-my-tag`
535
558
  */
536
559
  declare function transformTag(tag: string): string;
560
+ type MixinFactory = (base: MixedInCtor) => MixedInCtor;
537
561
  /**
538
- * @deprecated - Use `MixedInCtor` instead:
562
+ * A constructor type that can be used as the base for mixin factories.
563
+ *
539
564
  * ```ts
540
565
  * import { MixedInCtor } from '@stencil/core';
541
566
  *
542
567
  * const AFactoryFn = <B extends MixedInCtor>(Base: B) => {class A extends Base { propA = A }; return A;}
543
568
  * ```
544
569
  */
545
- type MixinFactory = (base: MixedInCtor) => MixedInCtor;
546
570
  type MixedInCtor<T = {}> = new (...args: any[]) => T;
547
571
  /**
548
572
  * Compose multiple mixin classes into a single constructor.
@@ -683,13 +707,21 @@ interface QueueApi {
683
707
  clear?: () => void;
684
708
  flush?: (cb?: () => void) => void;
685
709
  }
710
+ /**
711
+ * Minimal interface matched by signal objects (from @stencil/core/signals).
712
+ * Used in JSX attribute types.
713
+ */
714
+ interface SignalRef<T = any> {
715
+ readonly value: T;
716
+ peek(): T;
717
+ }
686
718
  /**
687
719
  * Host
688
720
  */
689
721
  interface HostAttributes {
690
722
  class?: string | {
691
723
  [className: string]: boolean;
692
- };
724
+ } | SignalRef<string>;
693
725
  style?: {
694
726
  [key: string]: string | undefined;
695
727
  };
@@ -737,7 +769,7 @@ interface FunctionalUtilities {
737
769
  map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[];
738
770
  }
739
771
  interface FunctionalComponent<T = {}> {
740
- (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[] | null;
772
+ (props: T, children: VNode[], utils: FunctionalUtilities): VNode | null;
741
773
  }
742
774
  /**
743
775
  * A Child VDOM node
@@ -748,7 +780,7 @@ interface FunctionalComponent<T = {}> {
748
780
  * {@link FunctionalUtilities}).
749
781
  */
750
782
  interface ChildNode {
751
- vtag?: string | number | Function;
783
+ vtag?: string | number | Function | symbol | null;
752
784
  vkey?: string | number;
753
785
  vtext?: string;
754
786
  vchildren?: VNode[];
@@ -761,11 +793,11 @@ interface ChildNode {
761
793
  *
762
794
  * For further information: https://stenciljs.com/docs/host-element
763
795
  */
764
- declare const Host: FunctionalComponent<HostAttributes>;
796
+ declare const Host: (props: HostAttributes) => VNode;
765
797
  /**
766
798
  * Fragment
767
799
  */
768
- declare const Fragment: FunctionalComponent<{}>;
800
+ declare const Fragment: (props: {}) => VNode;
769
801
  /**
770
802
  * The "h" namespace is used to import JSX types for elements and attributes.
771
803
  * It is imported in order to avoid conflicting global JSX issues.
@@ -781,6 +813,7 @@ declare namespace h {
781
813
  function h(sel: any, data: VNodeData | null, children: VNode): VNode;
782
814
  function h(sel: any, data: VNodeData | null, ...children: (VNode | string | number)[]): VNode;
783
815
  namespace JSX {
816
+ type Element = VNode;
784
817
  interface IntrinsicElements extends LocalJSX.IntrinsicElements, JSXBase.IntrinsicElements {
785
818
  [tagName: string]: any;
786
819
  }
@@ -817,13 +850,15 @@ declare function jsxs(type: any, props: any, key?: string): VNode;
817
850
  */
818
851
  interface VNode {
819
852
  $flags$: number;
820
- $tag$: string | number | Function;
853
+ $tag$: string | number | Function | symbol | null;
821
854
  $elm$: any;
822
855
  $text$: string;
823
856
  $children$: VNode[];
824
857
  $attrs$?: any;
825
858
  $name$?: string;
826
859
  $key$?: string | number;
860
+ /** Signal reference for vdom bypass: signal text nodes store the signal here. */
861
+ $signal$?: any;
827
862
  }
828
863
  interface VNodeData {
829
864
  class?: {
@@ -1154,6 +1189,7 @@ declare namespace JSXBase {
1154
1189
  importance?: 'low' | 'auto' | 'high';
1155
1190
  height?: number | string;
1156
1191
  loading?: 'lazy' | 'auto' | 'eager';
1192
+ referrerPolicy?: ReferrerPolicy;
1157
1193
  sizes?: string;
1158
1194
  src?: string;
1159
1195
  srcSet?: string;
@@ -1469,7 +1505,7 @@ declare namespace JSXBase {
1469
1505
  autofocus?: boolean | string;
1470
1506
  class?: string | {
1471
1507
  [className: string]: boolean;
1472
- };
1508
+ } | SignalRef<string>;
1473
1509
  contentEditable?: boolean | string;
1474
1510
  contenteditable?: boolean | string;
1475
1511
  contextMenu?: string;
@@ -1528,7 +1564,7 @@ declare namespace JSXBase {
1528
1564
  interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
1529
1565
  class?: string | {
1530
1566
  [className: string]: boolean;
1531
- };
1567
+ } | SignalRef<string>;
1532
1568
  color?: string;
1533
1569
  height?: number | string;
1534
1570
  id?: string;
@@ -1929,10 +1965,13 @@ declare namespace JSXBase {
1929
1965
  interface JSXAttributes<T = Element> {
1930
1966
  key?: string | number;
1931
1967
  ref?: (elm?: T) => void;
1968
+ children?: any;
1932
1969
  }
1933
1970
  interface CustomElementsDefineOptions {
1934
1971
  exclude?: string[];
1935
1972
  syncQueue?: boolean;
1973
+ /** Scoped custom element registry to define components in. Defaults to the global registry. */
1974
+ registry?: CustomElementRegistry;
1936
1975
  jmp?: (c: Function) => any;
1937
1976
  raf?: (c: FrameRequestCallback) => number;
1938
1977
  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
@@ -1940,4 +1979,4 @@ interface CustomElementsDefineOptions {
1940
1979
  ce?: (eventName: string, opts?: any) => CustomEvent;
1941
1980
  }
1942
1981
  //#endregion
1943
- export { AttachInternals, AttachInternalsDecorator, AttachInternalsOptions, AttrDeserialize, AttrDeserializeDecorator, Build, ChildNode, Component, ComponentDecorator, ComponentDidLoad, ComponentDidUpdate, ComponentInterface, ComponentOptions, ComponentWillLoad, ComponentWillUpdate, CustomElementsDefineOptions, Element, ElementDecorator, EncapsulationOptions, Env, ErrorHandler, Event, EventDecorator, EventEmitter, EventOptions, Fragment, FunctionalComponent, FunctionalUtilities, HTMLStencilElement, Host, HostAttributes, LocalJSX as JSX, JSXAttributes, JSXBase, Listen, ListenDecorator, ListenOptions, ListenTargetOptions, Method, MethodDecorator, MethodOptions, MixedInCtor, Mixin, MixinFactory, ModeStyles, NoneEncapsulation, Prop, PropDecorator, PropOptions, PropSerialize, PropSerializeDecorator, QueueApi, RafCallback, ResolutionHandler, ResolveVarFunction, ScopedEncapsulation, ShadowEncapsulation, ShadowRootOptions, SlotPatch, State, StateDecorator, TagTransformer, UserBuildConditionals, VNode, VNodeData, Watch, WatchDecorator, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, h, jsx, jsxs, readTask, render, resolveVar, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setTagTransformer, transformTag, writeTask };
1982
+ export { AttachInternals, AttachInternalsDecorator, AttachInternalsOptions, AttrDeserialize, AttrDeserializeDecorator, Build, ChildNode, Component, ComponentDecorator, ComponentDidLoad, ComponentDidUpdate, ComponentInterface, ComponentOptions, ComponentWillLoad, ComponentWillUpdate, CustomElementsDefineOptions, Element, ElementDecorator, EncapsulationOptions, Env, ErrorHandler, Event, EventDecorator, EventEmitter, EventOptions, Fragment, FunctionalComponent, FunctionalUtilities, HTMLStencilElement, Host, HostAttributes, LocalJSX as JSX, JSXAttributes, JSXBase, Listen, ListenDecorator, ListenOptions, ListenTargetOptions, Method, MethodDecorator, MethodOptions, MixedInCtor, Mixin, ModeStyles, NoneEncapsulation, Prop, PropDecorator, PropOptions, PropSerialize, PropSerializeDecorator, QueueApi, RafCallback, ResolutionHandler, ResolveVarFunction, ScopedEncapsulation, ShadowEncapsulation, ShadowRootOptions, SignalRef, SlotPatch, State, StateDecorator, TagTransformer, UserBuildConditionals, VNode, VNodeData, Watch, WatchDecorator, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, h, jsx, jsxs, readTask, render, resolveVar, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setTagTransformer, transformTag, writeTask };