@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.
- package/README.md +94 -0
- package/bin/stencil.mjs +1 -1
- package/dist/app-data/index.d.ts +2 -0
- package/dist/{runtime/app-data → app-data}/index.js +23 -15
- package/dist/{runtime/app-globals → app-globals}/index.js +1 -2
- package/dist/client-ClM4H9-P.mjs +2496 -0
- package/dist/compiler/browser.d.ts +1573 -0
- package/dist/compiler/browser.js +16998 -0
- package/dist/compiler/index.d.mts +284 -7
- package/dist/compiler/index.mjs +3 -9
- package/dist/compiler/utils/index.d.mts +272 -3
- package/dist/compiler/utils/index.mjs +4 -5
- package/dist/{transpile-CJQcQEVa.mjs → compiler-DFanjq9z.mjs} +20984 -15554
- package/dist/declarations/stencil-ext-modules.d.ts +8 -8
- package/dist/declarations/stencil-public-compiler.d.ts +1016 -840
- package/dist/declarations/stencil-public-compiler.js +3 -5
- package/dist/declarations/stencil-public-docs.d.ts +441 -376
- package/dist/declarations/stencil-public-docs.js +0 -0
- package/dist/declarations/stencil-public-runtime.d.ts +361 -113
- package/dist/fragment-Di1hWOC8.mjs +4 -0
- package/dist/helpers-Cpp3qc3u.mjs +524 -0
- package/dist/{index-szczUd2l.d.mts → index-DvfFOkiJ.d.mts} +1466 -2044
- package/dist/{stencil-private-Cgcr414u.d.ts → index-XQHZl0MW.d.ts} +308 -114
- package/dist/index-aBMJC5F9.d.mts +104 -0
- package/dist/index.d.mts +14 -2
- package/dist/index.mjs +171 -4
- package/dist/jsx-runtime.d.mts +24 -0
- package/dist/jsx-runtime.mjs +3 -0
- package/dist/mock-doc.mjs +2 -3
- package/dist/{node-sys-BGURUNOZ.mjs → node-DJP8JuAS.mjs} +176 -197
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{client-DR9zhmKG.mjs → runtime/client/lazy.js} +3780 -2652
- package/dist/runtime/client/{index.d.ts → runtime.d.ts} +516 -227
- package/dist/runtime/client/{index.js → runtime.js} +3588 -2856
- package/dist/runtime/index.d.ts +90 -72
- package/dist/runtime/index.js +3461 -2837
- package/dist/runtime/server/index.d.mts +243 -219
- package/dist/runtime/server/index.mjs +3763 -3352
- package/dist/runtime/server/runner.d.mts +114 -47
- package/dist/runtime/server/runner.mjs +12710 -763
- package/dist/signals/index.d.ts +58 -0
- package/dist/signals/index.js +182 -0
- package/dist/sys/node/index.d.mts +1 -3
- package/dist/sys/node/index.mjs +2 -7
- package/dist/sys/node/worker.d.mts +1 -1
- package/dist/sys/node/worker.mjs +3 -12
- package/dist/testing/index.d.mts +4763 -12
- package/dist/testing/index.mjs +7939 -619
- package/dist/util-C-H1H84W.mjs +731 -0
- package/dist/validation-ByYYKvnS.mjs +825 -0
- package/package.json +91 -59
- package/dist/chunk-ClPoSABd.mjs +0 -21
- package/dist/index-Bxo2jCf6.d.mts +0 -77
- package/dist/runtime/app-data/index.d.ts +0 -30
- package/dist/serialize-BJvhE9aQ.mjs +0 -775
- package/dist/validation-BdcPruW_.mjs +0 -1451
- /package/{LICENSE.md → LICENSE} +0 -0
- /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
|
|
1
|
+
import { C as ReactiveControllerHostInterface, E as VNode, S as MixedInCtor, T as TagTransformer, _ as ComponentInterface, a as ComponentConstructor, b as HTMLStencilElement, c as ComponentRuntimeMeta, d as HostRef, f as LazyBundlesRuntimeData, g as RuntimeRef, h as RenderNode, i as ChildType, l as ComponentRuntimeMetaCompact, m as PropsType, o as ComponentConstructorChangeHandlers, p as PlatformRuntime, s as ComponentRuntimeHostListener, u as HostElement, v as CustomElementsDefineOptions, w as ResolutionHandler, x as JSXBase, y as FunctionalComponent } from "../index-XQHZl0MW.js";
|
|
3
2
|
//#region src/runtime/asset-path.d.ts
|
|
4
3
|
declare const getAssetPath: (path: string) => string;
|
|
5
4
|
declare const setAssetPath: (path: string) => string;
|
|
6
5
|
//#endregion
|
|
7
|
-
//#region src/runtime/bootstrap-
|
|
6
|
+
//#region src/runtime/bootstrap-standalone.d.ts
|
|
8
7
|
declare const defineCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => void;
|
|
9
8
|
declare const proxyCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => any;
|
|
10
9
|
declare const forceModeUpdate: (elm: RenderNode) => void;
|
|
11
10
|
//#endregion
|
|
12
|
-
//#region src/runtime/
|
|
11
|
+
//#region src/runtime/registry.d.ts
|
|
12
|
+
declare const setRegistry: (registry: CustomElementRegistry) => void;
|
|
13
|
+
declare const getRegistry: () => CustomElementRegistry;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/runtime/bootstrap-loader.d.ts
|
|
13
16
|
declare const bootstrapLazy: (lazyBundles: LazyBundlesRuntimeData, options?: CustomElementsDefineOptions) => void;
|
|
14
17
|
//#endregion
|
|
15
18
|
//#region src/runtime/connected-callback.d.ts
|
|
@@ -20,6 +23,18 @@ declare const disconnectedCallback: (elm: HostElement) => Promise<void>;
|
|
|
20
23
|
//#endregion
|
|
21
24
|
//#region src/runtime/element.d.ts
|
|
22
25
|
declare const getElement: (ref: any) => HostElement;
|
|
26
|
+
/**
|
|
27
|
+
* Get the shadow root for a Stencil component's host element.
|
|
28
|
+
* This works for both open and closed shadow DOM modes.
|
|
29
|
+
*
|
|
30
|
+
* For closed shadow DOM, `element.shadowRoot` returns `null` by design,
|
|
31
|
+
* but Stencil stores the reference internally so components can still
|
|
32
|
+
* access their own shadow root.
|
|
33
|
+
*
|
|
34
|
+
* @param element The host element (from @Element() decorator)
|
|
35
|
+
* @returns The shadow root, or null if no shadow root exists
|
|
36
|
+
*/
|
|
37
|
+
declare const getShadowRoot: (element: HTMLElement) => ShadowRoot | null;
|
|
23
38
|
//#endregion
|
|
24
39
|
//#region src/runtime/event-emitter.d.ts
|
|
25
40
|
declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
|
|
@@ -30,25 +45,75 @@ declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
|
|
|
30
45
|
declare const Fragment: FunctionalComponent;
|
|
31
46
|
//#endregion
|
|
32
47
|
//#region src/runtime/host-listener.d.ts
|
|
33
|
-
declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]
|
|
48
|
+
declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]) => void;
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/runtime/inject-side-effect-style.d.ts
|
|
51
|
+
/**
|
|
52
|
+
* Registers a root (a shadow root, or `document`) to receive every side-effect CSS import
|
|
53
|
+
* (a plain, non-component `import './foo.css'`), now and in future. Call in `connectedCallback`,
|
|
54
|
+
* paired with `unregisterSideEffectStyleTarget` in `disconnectedCallback` so the registry doesn't
|
|
55
|
+
* hold disconnected roots forever.
|
|
56
|
+
* @param root the root to register
|
|
57
|
+
*/
|
|
58
|
+
declare function registerSideEffectStyleTarget(root: DocumentOrShadowRoot): void;
|
|
59
|
+
/**
|
|
60
|
+
* Removes a root registered via `registerSideEffectStyleTarget` - call in `disconnectedCallback`.
|
|
61
|
+
* @param root the root to unregister
|
|
62
|
+
*/
|
|
63
|
+
declare function unregisterSideEffectStyleTarget(root: DocumentOrShadowRoot): void;
|
|
64
|
+
/**
|
|
65
|
+
* Applies plain (non-component) CSS text to every registered root - respects shadow DOM
|
|
66
|
+
* encapsulation instead of always reaching for the top-level document. Not meant to be called
|
|
67
|
+
* directly: this is what the compiler's CSS-to-ESM output calls for CSS with no Stencil `tag`
|
|
68
|
+
* (i.e. not a component's own `styleUrl`), typically a third-party dependency's CSS import.
|
|
69
|
+
*
|
|
70
|
+
* `@font-face` rules are pulled out and adopted onto top-level `document` not per-root
|
|
71
|
+
* (Chromium (https://issues.chromium.org/issues/41085401) per-root never loads).
|
|
72
|
+
* @param cssText the CSS text to apply
|
|
73
|
+
*/
|
|
74
|
+
declare function injectSideEffectStyle(cssText: string): void;
|
|
34
75
|
//#endregion
|
|
35
76
|
//#region src/runtime/mixin.d.ts
|
|
36
77
|
type Ctor<T = {}> = new (...args: any[]) => T;
|
|
37
78
|
declare function Mixin(...mixins: ((base: Ctor) => Ctor)[]): Ctor<{}>;
|
|
38
79
|
//#endregion
|
|
39
80
|
//#region src/runtime/mode.d.ts
|
|
40
|
-
declare const setMode: (handler: ResolutionHandler) =>
|
|
81
|
+
declare const setMode: (handler: ResolutionHandler) => void;
|
|
41
82
|
declare const getMode: (ref: RuntimeRef) => string;
|
|
42
83
|
//#endregion
|
|
43
84
|
//#region src/runtime/nonce.d.ts
|
|
44
85
|
/**
|
|
45
86
|
* Assigns the given value to the nonce property on the runtime platform object.
|
|
46
|
-
* During runtime, this value is used to set the nonce attribute on all dynamically created
|
|
87
|
+
* During runtime, this value is used to set the nonce attribute on all dynamically created style tags.
|
|
47
88
|
* @param nonce The value to be assigned to the platform nonce property.
|
|
48
89
|
* @returns void
|
|
49
90
|
*/
|
|
50
91
|
declare const setNonce: (nonce: string) => string;
|
|
51
92
|
//#endregion
|
|
93
|
+
//#region src/runtime/normalize-watchers.d.ts
|
|
94
|
+
/**
|
|
95
|
+
* Normalizes watcher metadata to the current `{ [methodName]: flags }[]` format.
|
|
96
|
+
*
|
|
97
|
+
* Prior to Stencil 4.39.x (PR #6484), the `@Watch()` compiler emitted watcher
|
|
98
|
+
* handlers as a plain string array: `{ "min": ["minChanged"] }`. The new format
|
|
99
|
+
* wraps each entry in an object that carries option flags (e.g. `immediate`):
|
|
100
|
+
* `{ "min": [{ "minChanged": 0 }] }`.
|
|
101
|
+
*
|
|
102
|
+
* When a library (e.g. Ionic Framework) was compiled with an older Stencil compiler
|
|
103
|
+
* but consumed by an app using a newer Stencil runtime, the runtime's
|
|
104
|
+
* `Object.entries(watcher)` call receives a string and misinterprets its character
|
|
105
|
+
* indices as method names, causing:
|
|
106
|
+
* `TypeError: instance[watchMethodName] is not a function`
|
|
107
|
+
*
|
|
108
|
+
* This helper should be used at `$watchers$` assignment sites that need to
|
|
109
|
+
* accept both legacy and current compiler metadata so downstream code on those
|
|
110
|
+
* paths can safely assume the new object format.
|
|
111
|
+
*
|
|
112
|
+
* @param raw The raw watcher map from compiled metadata (new or legacy format).
|
|
113
|
+
* @returns A normalized watcher map in the `{ [methodName]: flags }[]` format, or `undefined` if `raw` is `undefined` or empty.
|
|
114
|
+
*/
|
|
115
|
+
declare const normalizeWatchers: (raw: ComponentConstructorChangeHandlers | undefined) => ComponentConstructorChangeHandlers | undefined;
|
|
116
|
+
//#endregion
|
|
52
117
|
//#region src/runtime/parse-property-value.d.ts
|
|
53
118
|
/**
|
|
54
119
|
* Parse a new property value for a given property type.
|
|
@@ -71,10 +136,9 @@ declare const setNonce: (nonce: string) => string;
|
|
|
71
136
|
*
|
|
72
137
|
* @param propValue the new value to coerce to some type
|
|
73
138
|
* @param propType the type of the prop, expressed as a binary number
|
|
74
|
-
* @param isFormAssociated whether the component is form-associated (optional)
|
|
75
139
|
* @returns the parsed/coerced value
|
|
76
140
|
*/
|
|
77
|
-
declare const parsePropertyValue: (propValue: unknown, propType: number
|
|
141
|
+
declare const parsePropertyValue: (propValue: unknown, propType: number) => any;
|
|
78
142
|
//#endregion
|
|
79
143
|
//#region src/runtime/platform-options.d.ts
|
|
80
144
|
interface SetPlatformOptions {
|
|
@@ -96,17 +160,24 @@ declare const setPlatformOptions: (opts: SetPlatformOptions) => PlatformRuntime
|
|
|
96
160
|
*
|
|
97
161
|
* On a traditional component, this is wired up to the element only.
|
|
98
162
|
*
|
|
99
|
-
* @param Cstr the constructor for a component that we need to process
|
|
100
|
-
* @param cmpMeta metadata collected previously about the component
|
|
101
|
-
* @param flags a number used to store a series of bit flags
|
|
163
|
+
* @param Cstr - the constructor for a component that we need to process
|
|
164
|
+
* @param cmpMeta - metadata collected previously about the component
|
|
165
|
+
* @param flags - a number used to store a series of bit flags
|
|
102
166
|
* @returns a reference to the same constructor passed in (but now mutated)
|
|
103
167
|
*/
|
|
104
168
|
declare const proxyComponent: (Cstr: ComponentConstructor, cmpMeta: ComponentRuntimeMeta, flags: number) => ComponentConstructor;
|
|
105
169
|
//#endregion
|
|
170
|
+
//#region src/runtime/reactive-controller.d.ts
|
|
171
|
+
declare const ReactiveControllerHost: <B extends MixedInCtor<ComponentInterface & HTMLElement>>(Base: B) => B & MixedInCtor<ReactiveControllerHostInterface>;
|
|
172
|
+
//#endregion
|
|
106
173
|
//#region src/runtime/render.d.ts
|
|
107
174
|
/**
|
|
108
175
|
* Method to render a virtual DOM tree to a container element.
|
|
109
176
|
*
|
|
177
|
+
* Supports efficient re-renders: calling `render()` again on the same container
|
|
178
|
+
* will diff the new VNode tree against the previous one and only update what changed,
|
|
179
|
+
* preserving existing DOM elements and their state.
|
|
180
|
+
*
|
|
110
181
|
* @example
|
|
111
182
|
* ```tsx
|
|
112
183
|
* import { render } from '@stencil/core';
|
|
@@ -128,6 +199,7 @@ declare function render(vnode: VNode, container: Element): void;
|
|
|
128
199
|
declare const HYDRATED_STYLE_ID = "sty-id";
|
|
129
200
|
//#endregion
|
|
130
201
|
//#region src/runtime/set-value.d.ts
|
|
202
|
+
declare const applySerializers: (hostRef: HostRef, cmpMeta: ComponentRuntimeMeta, propName: string, val: any, instance: any) => void;
|
|
131
203
|
declare const getValue: (ref: RuntimeRef, propName: string) => any;
|
|
132
204
|
declare const setValue: (ref: RuntimeRef, propName: string, newVal: any, cmpMeta: ComponentRuntimeMeta) => void;
|
|
133
205
|
//#endregion
|
|
@@ -150,72 +222,18 @@ declare const postUpdateComponent: (hostRef: HostRef) => void;
|
|
|
150
222
|
declare const forceUpdate: (ref: any) => boolean;
|
|
151
223
|
//#endregion
|
|
152
224
|
//#region src/runtime/vdom/h.d.ts
|
|
153
|
-
declare const h: (nodeName: any, vnodeData:
|
|
225
|
+
declare const h: (nodeName: any, vnodeData: PropsType, ...children: ChildType[]) => VNode;
|
|
154
226
|
declare const Host: {};
|
|
155
227
|
//#endregion
|
|
156
|
-
//#region src/runtime/vdom/jsx-dev-runtime.d.ts
|
|
157
|
-
/**
|
|
158
|
-
* JSX development runtime function for creating elements with debug info.
|
|
159
|
-
* Called by TypeScript's jsx transform in development mode.
|
|
160
|
-
*
|
|
161
|
-
* @param type - The element type (string tag name or functional component)
|
|
162
|
-
* @param props - The element props (includes children, key, etc.)
|
|
163
|
-
* @param key - The element's key (passed separately in dev mode)
|
|
164
|
-
* @param isStaticChildren - Whether children are static (optimization hint)
|
|
165
|
-
* @param source - Source location information for debugging
|
|
166
|
-
* @param self - The component instance (for debugging)
|
|
167
|
-
* @returns A virtual DOM node
|
|
168
|
-
*/
|
|
169
|
-
declare function jsxDEV(type: any, props: any, key?: string | number, _isStaticChildren?: boolean, _source?: any, _self?: any): VNode;
|
|
170
|
-
//#endregion
|
|
171
228
|
//#region src/runtime/vdom/jsx-runtime.d.ts
|
|
172
|
-
/**
|
|
173
|
-
* JSX runtime function for creating elements in production mode.
|
|
174
|
-
* Called by TypeScript's jsx transform for elements without static children.
|
|
175
|
-
*
|
|
176
|
-
* @param type - The element type (string tag name or functional component)
|
|
177
|
-
* @param props - The element props (includes children)
|
|
178
|
-
* @param key - Optional key for the element
|
|
179
|
-
* @returns A virtual DOM node
|
|
180
|
-
*/
|
|
181
229
|
declare function jsx(type: any, props: any, key?: string): VNode;
|
|
182
230
|
/**
|
|
183
|
-
*
|
|
184
|
-
* Called by TypeScript's jsx transform as an optimization when children are static.
|
|
185
|
-
*
|
|
186
|
-
* @param type - The element type (string tag name or functional component)
|
|
187
|
-
* @param props - The element props (includes children)
|
|
188
|
-
* @param key - Optional key for the element
|
|
189
|
-
* @returns A virtual DOM node
|
|
190
|
-
*/
|
|
191
|
-
declare function jsxs(type: any, props: any, key?: string): VNode;
|
|
192
|
-
//#endregion
|
|
193
|
-
//#region src/runtime/vdom/vdom-annotations.d.ts
|
|
194
|
-
/**
|
|
195
|
-
* Updates the DOM generated on the server with annotations such as node attributes and
|
|
196
|
-
* comment nodes to facilitate future client-side hydration. These annotations are used for things
|
|
197
|
-
* like moving elements back to their original hosts if using Shadow DOM on the client, and for quickly
|
|
198
|
-
* reconstructing the vNode representations of the DOM.
|
|
199
|
-
*
|
|
200
|
-
* @param doc The DOM generated by the server.
|
|
201
|
-
* @param staticComponents Any components that should be considered static and do not need client-side hydration.
|
|
231
|
+
* @alias
|
|
202
232
|
*/
|
|
203
|
-
declare const
|
|
204
|
-
//#endregion
|
|
205
|
-
//#region src/runtime/vdom/vdom-render.d.ts
|
|
233
|
+
declare const jsxs: typeof jsx;
|
|
206
234
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
|
210
|
-
* function will handle creating a virtual DOM tree with a single root, patching
|
|
211
|
-
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
|
212
|
-
* relocation, and reflecting attributes.
|
|
213
|
-
*
|
|
214
|
-
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
|
215
|
-
* the DOM node into which it should be rendered.
|
|
216
|
-
* @param renderFnResults the virtual DOM nodes to be rendered
|
|
217
|
-
* @param isInitialLoad whether or not this is the first call after page load
|
|
235
|
+
* @alias
|
|
218
236
|
*/
|
|
219
|
-
declare const
|
|
237
|
+
declare const jsxDEV: typeof jsx;
|
|
220
238
|
//#endregion
|
|
221
|
-
export { Fragment, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Mixin, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getValue, h,
|
|
239
|
+
export { Fragment, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Mixin, ReactiveControllerHost, addHostEventListeners, applySerializers, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRegistry, getRenderingRef, getShadowRoot, getValue, h, injectSideEffectStyle, jsx, jsxDEV, jsxs, normalizeWatchers, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, registerSideEffectStyleTarget, render, setAssetPath, setMode, setNonce, setPlatformOptions, setRegistry, setTagTransformer, setValue, transformTag, unregisterSideEffectStyleTarget };
|