@stencil/core 5.0.0-alpha.9 → 5.0.0-beta.1
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 +1 -1
- package/dist/app-data/index.js +4 -1
- package/dist/client-BRu0GtRn.mjs +2368 -0
- package/dist/compiler/browser.d.ts +1534 -0
- package/dist/compiler/browser.js +16436 -0
- package/dist/compiler/index.d.mts +167 -3
- package/dist/compiler/index.mjs +3 -3
- package/dist/compiler/utils/index.d.mts +272 -2
- package/dist/compiler/utils/index.mjs +4 -3
- package/dist/{compiler-C0qmPoKu.mjs → compiler-CJG6qvQt.mjs} +2978 -1231
- package/dist/declarations/stencil-ext-modules.d.ts +5 -5
- package/dist/declarations/stencil-public-compiler.d.ts +226 -69
- package/dist/declarations/stencil-public-docs.d.ts +9 -0
- package/dist/declarations/stencil-public-runtime.d.ts +111 -10
- package/dist/fragment-Di1hWOC8.mjs +4 -0
- package/dist/{regular-expression-CFVJOTUh.mjs → helpers-Cpp3qc3u.mjs} +31 -15
- package/dist/{index-xAkMgLX_.d.ts → index-BXAcVN2j.d.ts} +152 -20
- package/dist/{index-vY35H18z.d.mts → index-BopBfjPu.d.mts} +508 -848
- package/dist/index-DmHmu3y0.d.mts +100 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +171 -2
- package/dist/jsx-runtime.mjs +2 -1
- package/dist/{node--akYC-sG.mjs → node-75gQKkFz.mjs} +60 -58
- package/dist/{chunk-z9aeyW2b.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
- package/dist/runtime/client/lazy.js +577 -189
- package/dist/runtime/client/runtime.d.ts +178 -21
- package/dist/runtime/client/runtime.js +577 -189
- package/dist/runtime/index.d.ts +32 -4
- package/dist/runtime/index.js +576 -187
- package/dist/runtime/server/index.d.mts +107 -9
- package/dist/runtime/server/index.mjs +499 -182
- package/dist/runtime/server/runner.d.mts +3 -0
- package/dist/runtime/server/runner.mjs +320 -337
- package/dist/signals/index.d.ts +2 -0
- package/dist/signals/index.js +4 -1
- 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 +4731 -105
- package/dist/testing/index.mjs +7563 -797
- package/dist/util-IKfWWLJo.mjs +724 -0
- package/dist/validation-DAdGTrys.mjs +791 -0
- package/package.json +31 -27
- package/dist/client-aTQ7xHxx.mjs +0 -4678
- package/dist/index-BvkyxSY6.d.mts +0 -205
- package/dist/validation-ByxKj8bC.mjs +0 -1458
- /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
|
-
*
|
|
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
|
|
40
|
-
*
|
|
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?(
|
|
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 = [
|
|
748
|
-
|
|
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
|
-
}?,
|
|
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
|
/**
|
|
@@ -997,6 +1069,32 @@ declare const Fragment: FunctionalComponent;
|
|
|
997
1069
|
//#region src/runtime/host-listener.d.ts
|
|
998
1070
|
declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]) => void;
|
|
999
1071
|
//#endregion
|
|
1072
|
+
//#region src/runtime/inject-side-effect-style.d.ts
|
|
1073
|
+
/**
|
|
1074
|
+
* Registers a root (a shadow root, or `document`) to receive every side-effect CSS import
|
|
1075
|
+
* (a plain, non-component `import './foo.css'`), now and in future. Call in `connectedCallback`,
|
|
1076
|
+
* paired with `unregisterSideEffectStyleTarget` in `disconnectedCallback` so the registry doesn't
|
|
1077
|
+
* hold disconnected roots forever.
|
|
1078
|
+
* @param root the root to register
|
|
1079
|
+
*/
|
|
1080
|
+
declare function registerSideEffectStyleTarget(root: DocumentOrShadowRoot): void;
|
|
1081
|
+
/**
|
|
1082
|
+
* Removes a root registered via `registerSideEffectStyleTarget` - call in `disconnectedCallback`.
|
|
1083
|
+
* @param root the root to unregister
|
|
1084
|
+
*/
|
|
1085
|
+
declare function unregisterSideEffectStyleTarget(root: DocumentOrShadowRoot): void;
|
|
1086
|
+
/**
|
|
1087
|
+
* Applies plain (non-component) CSS text to every registered root - respects shadow DOM
|
|
1088
|
+
* encapsulation instead of always reaching for the top-level document. Not meant to be called
|
|
1089
|
+
* directly: this is what the compiler's CSS-to-ESM output calls for CSS with no Stencil `tag`
|
|
1090
|
+
* (i.e. not a component's own `styleUrl`), typically a third-party dependency's CSS import.
|
|
1091
|
+
*
|
|
1092
|
+
* `@font-face` rules are pulled out and adopted onto top-level `document` not per-root
|
|
1093
|
+
* (Chromium (https://issues.chromium.org/issues/41085401) per-root never loads).
|
|
1094
|
+
* @param cssText the CSS text to apply
|
|
1095
|
+
*/
|
|
1096
|
+
declare function injectSideEffectStyle(cssText: string): void;
|
|
1097
|
+
//#endregion
|
|
1000
1098
|
//#region src/runtime/mixin.d.ts
|
|
1001
1099
|
type Ctor<T = {}> = new (...args: any[]) => T;
|
|
1002
1100
|
declare function Mixin(...mixins: ((base: Ctor) => Ctor)[]): Ctor<{}>;
|
|
@@ -1176,4 +1274,4 @@ declare const setAssetPath: (path: string) => string;
|
|
|
1176
1274
|
declare const setScopedSsr: (opts: SsrFactoryOptions) => void;
|
|
1177
1275
|
declare const needsScopedSSR: () => boolean;
|
|
1178
1276
|
//#endregion
|
|
1179
|
-
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, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, proxyComponent, proxyCustomElement, readTask, registerComponents, registerHost, registerInstance, renderVdom, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setScopedSsr, setTagTransformer, setValue, ssrApp, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, transformTag, win, writeTask };
|
|
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, getShadowRoot, getValue, hAsync as h, injectSideEffectStyle, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, 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 };
|