@stencil/core 5.0.0-alpha.1 → 5.0.0-alpha.11

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 (50) hide show
  1. package/dist/app-data/index.d.ts +2 -0
  2. package/dist/{runtime/app-data → app-data}/index.js +17 -12
  3. package/dist/{client-B1nuvCd2.mjs → client-aTQ7xHxx.mjs} +2432 -2278
  4. package/dist/compiler/index.d.mts +6 -6
  5. package/dist/compiler/index.mjs +2 -2
  6. package/dist/compiler/utils/index.d.mts +2 -2
  7. package/dist/compiler/utils/index.mjs +3 -3
  8. package/dist/{compiler-LX4_RKKd.mjs → compiler-DCN7Np2A.mjs} +14854 -13500
  9. package/dist/declarations/stencil-public-compiler.d.ts +4374 -2
  10. package/dist/declarations/stencil-public-compiler.js +2 -4
  11. package/dist/declarations/stencil-public-docs.d.ts +504 -1
  12. package/dist/declarations/stencil-public-runtime.d.ts +1982 -2
  13. package/dist/{index-fIuYTL9f.d.mts → index-BvkyxSY6.d.mts} +29 -2
  14. package/dist/{index-D-LlB2nw.d.mts → index-vY35H18z.d.mts} +795 -1188
  15. package/dist/{index-BONzXKJt.d.ts → index-xAkMgLX_.d.ts} +88 -39
  16. package/dist/index.d.mts +1 -1
  17. package/dist/index.mjs +2 -2
  18. package/dist/jsx-runtime.d.mts +18 -0
  19. package/dist/jsx-runtime.mjs +2 -0
  20. package/dist/{node-SxQIOCZE.mjs → node--akYC-sG.mjs} +20 -30
  21. package/dist/regular-expression-CFVJOTUh.mjs +508 -0
  22. package/dist/{runtime-CF9DJtSu.js → runtime/client/lazy.js} +2675 -2493
  23. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +106 -78
  24. package/dist/runtime/client/{index.js → runtime.js} +2545 -2487
  25. package/dist/runtime/index.d.ts +58 -29
  26. package/dist/runtime/index.js +4795 -2
  27. package/dist/runtime/server/index.d.mts +103 -70
  28. package/dist/runtime/server/index.mjs +2545 -2350
  29. package/dist/runtime/server/runner.d.mts +44 -48
  30. package/dist/runtime/server/runner.mjs +347 -751
  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 +367 -59
  38. package/dist/{validation-CaCgjw-f.mjs → validation-ByxKj8bC.mjs} +116 -99
  39. package/package.json +47 -38
  40. package/dist/index-CHjZtib0.d.ts +0 -30
  41. package/dist/jsx-runtime-DBzBJLKk.d.ts +0 -28
  42. package/dist/jsx-runtime.d.ts +0 -2
  43. package/dist/jsx-runtime.js +0 -2
  44. package/dist/runtime/app-data/index.d.ts +0 -2
  45. package/dist/serialize-BkYHk7Mi.mjs +0 -766
  46. package/dist/stencil-public-compiler-C_X1iolo.d.ts +0 -4455
  47. package/dist/stencil-public-runtime-DlV8o7-z.d.ts +0 -1845
  48. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
  49. /package/dist/{runtime/app-globals → app-globals}/index.js +0 -0
  50. /package/dist/{chunk-CjcI7cDX.mjs → chunk-z9aeyW2b.mjs} +0 -0
@@ -1,16 +1,19 @@
1
- import { _ as ResolutionHandler, a as ComponentRuntimeMeta, c as HostRef, d as RenderNode, f as RuntimeRef, g as JSXBase, h as HTMLStencilElement, i as ComponentRuntimeHostListener, l as LazyBundlesRuntimeData, n as ChildType, o as ComponentRuntimeMetaCompact, p as CustomElementsDefineOptions, r as ComponentConstructor, s as HostElement, u as PlatformRuntime, v as TagTransformer, y as VNode } from "../index-BONzXKJt.js";
2
- import { n as jsxs, r as Fragment, t as jsx } from "../jsx-runtime-DBzBJLKk.js";
1
+ import { S as VNode, _ as FunctionalComponent, a as ComponentConstructor, b as ResolutionHandler, c as ComponentRuntimeMeta, d as HostRef, f as LazyBundlesRuntimeData, g as CustomElementsDefineOptions, h as RuntimeRef, i as ChildType, l as ComponentRuntimeMetaCompact, m as RenderNode, o as ComponentConstructorChangeHandlers, p as PlatformRuntime, s as ComponentRuntimeHostListener, u as HostElement, v as HTMLStencilElement, x as TagTransformer, y as JSXBase } from "../index-xAkMgLX_.js";
3
2
 
4
3
  //#region src/runtime/asset-path.d.ts
5
4
  declare const getAssetPath: (path: string) => string;
6
5
  declare const setAssetPath: (path: string) => string;
7
6
  //#endregion
8
- //#region src/runtime/bootstrap-custom-element.d.ts
7
+ //#region src/runtime/bootstrap-standalone.d.ts
9
8
  declare const defineCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => void;
10
9
  declare const proxyCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => any;
11
10
  declare const forceModeUpdate: (elm: RenderNode) => void;
12
11
  //#endregion
13
- //#region src/runtime/bootstrap-lazy.d.ts
12
+ //#region src/runtime/registry.d.ts
13
+ declare const setRegistry: (registry: CustomElementRegistry) => void;
14
+ declare const getRegistry: () => CustomElementRegistry;
15
+ //#endregion
16
+ //#region src/runtime/bootstrap-loader.d.ts
14
17
  declare const bootstrapLazy: (lazyBundles: LazyBundlesRuntimeData, options?: CustomElementsDefineOptions) => void;
15
18
  //#endregion
16
19
  //#region src/runtime/connected-callback.d.ts
@@ -21,14 +24,29 @@ declare const disconnectedCallback: (elm: HostElement) => Promise<void>;
21
24
  //#endregion
22
25
  //#region src/runtime/element.d.ts
23
26
  declare const getElement: (ref: any) => HostElement;
27
+ /**
28
+ * Get the shadow root for a Stencil component's host element.
29
+ * This works for both open and closed shadow DOM modes.
30
+ *
31
+ * For closed shadow DOM, `element.shadowRoot` returns `null` by design,
32
+ * but Stencil stores the reference internally so components can still
33
+ * access their own shadow root.
34
+ *
35
+ * @param element The host element (from @Element() decorator)
36
+ * @returns The shadow root, or null if no shadow root exists
37
+ */
38
+ declare const getShadowRoot: (element: HTMLElement) => ShadowRoot | null;
24
39
  //#endregion
25
40
  //#region src/runtime/event-emitter.d.ts
26
41
  declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
27
42
  emit: (detail: any) => CustomEvent<any>;
28
43
  };
29
44
  //#endregion
45
+ //#region src/runtime/fragment.d.ts
46
+ declare const Fragment: FunctionalComponent;
47
+ //#endregion
30
48
  //#region src/runtime/host-listener.d.ts
31
- declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[], attachParentListeners?: boolean) => void;
49
+ declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]) => void;
32
50
  //#endregion
33
51
  //#region src/runtime/mixin.d.ts
34
52
  type Ctor<T = {}> = new (...args: any[]) => T;
@@ -47,6 +65,30 @@ declare const getMode: (ref: RuntimeRef) => string;
47
65
  */
48
66
  declare const setNonce: (nonce: string) => string;
49
67
  //#endregion
68
+ //#region src/runtime/normalize-watchers.d.ts
69
+ /**
70
+ * Normalizes watcher metadata to the current `{ [methodName]: flags }[]` format.
71
+ *
72
+ * Prior to Stencil 4.39.x (PR #6484), the `@Watch()` compiler emitted watcher
73
+ * handlers as a plain string array: `{ "min": ["minChanged"] }`. The new format
74
+ * wraps each entry in an object that carries option flags (e.g. `immediate`):
75
+ * `{ "min": [{ "minChanged": 0 }] }`.
76
+ *
77
+ * When a library (e.g. Ionic Framework) was compiled with an older Stencil compiler
78
+ * but consumed by an app using a newer Stencil runtime, the runtime's
79
+ * `Object.entries(watcher)` call receives a string and misinterprets its character
80
+ * indices as method names, causing:
81
+ * `TypeError: instance[watchMethodName] is not a function`
82
+ *
83
+ * This helper should be used at `$watchers$` assignment sites that need to
84
+ * accept both legacy and current compiler metadata so downstream code on those
85
+ * paths can safely assume the new object format.
86
+ *
87
+ * @param raw The raw watcher map from compiled metadata (new or legacy format).
88
+ * @returns A normalized watcher map in the `{ [methodName]: flags }[]` format, or `undefined` if `raw` is `undefined` or empty.
89
+ */
90
+ declare const normalizeWatchers: (raw: ComponentConstructorChangeHandlers | undefined) => ComponentConstructorChangeHandlers | undefined;
91
+ //#endregion
50
92
  //#region src/runtime/parse-property-value.d.ts
51
93
  /**
52
94
  * Parse a new property value for a given property type.
@@ -105,6 +147,10 @@ declare const proxyComponent: (Cstr: ComponentConstructor, cmpMeta: ComponentRun
105
147
  /**
106
148
  * Method to render a virtual DOM tree to a container element.
107
149
  *
150
+ * Supports efficient re-renders: calling `render()` again on the same container
151
+ * will diff the new VNode tree against the previous one and only update what changed,
152
+ * preserving existing DOM elements and their state.
153
+ *
108
154
  * @example
109
155
  * ```tsx
110
156
  * import { render } from '@stencil/core';
@@ -151,32 +197,15 @@ declare const forceUpdate: (ref: any) => boolean;
151
197
  declare const h: (nodeName: any, vnodeData: any, ...children: ChildType[]) => VNode;
152
198
  declare const Host: {};
153
199
  //#endregion
154
- //#region src/runtime/vdom/vdom-annotations.d.ts
200
+ //#region src/runtime/vdom/jsx-runtime.d.ts
201
+ declare function jsx(type: any, props: any, key?: string): VNode;
155
202
  /**
156
- * Updates the DOM generated on the server with annotations such as node attributes and
157
- * comment nodes to facilitate future client-side hydration. These annotations are used for things
158
- * like moving elements back to their original hosts if using Shadow DOM on the client, and for quickly
159
- * reconstructing the vNode representations of the DOM.
160
- *
161
- * @param doc The DOM generated by the server.
162
- * @param staticComponents Any components that should be considered static and do not need client-side hydration.
203
+ * @alias
163
204
  */
164
- declare const insertVdomAnnotations: (doc: Document, staticComponents: string[]) => void;
165
- //#endregion
166
- //#region src/runtime/vdom/vdom-render.d.ts
205
+ declare const jsxs: typeof jsx;
167
206
  /**
168
- * The main entry point for Stencil's virtual DOM-based rendering engine
169
- *
170
- * Given a {@link d.HostRef} container and some virtual DOM nodes, this
171
- * function will handle creating a virtual DOM tree with a single root, patching
172
- * the current virtual DOM tree onto an old one (if any), dealing with slot
173
- * relocation, and reflecting attributes.
174
- *
175
- * @param hostRef data needed to root and render the virtual DOM tree, such as
176
- * the DOM node into which it should be rendered.
177
- * @param renderFnResults the virtual DOM nodes to be rendered
178
- * @param isInitialLoad whether or not this is the first call after page load
207
+ * @alias
179
208
  */
180
- declare const renderVdom: (hostRef: HostRef, renderFnResults: VNode | VNode[], isInitialLoad?: boolean) => void;
209
+ declare const jsxDEV: typeof jsx;
181
210
  //#endregion
182
- 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, insertVdomAnnotations, jsx, jsxs, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, render, renderVdom, setAssetPath, setMode, setNonce, setPlatformOptions, setTagTransformer, setValue, transformTag };
211
+ export { Fragment, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Mixin, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRegistry, getRenderingRef, getShadowRoot, getValue, h, jsx, jsxDEV, jsxs, normalizeWatchers, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, render, setAssetPath, setMode, setNonce, setPlatformOptions, setRegistry, setTagTransformer, setValue, transformTag };