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

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 (42) hide show
  1. package/dist/{client-DucyoZT4.mjs → client-Dti6fFpE.mjs} +108 -69
  2. package/dist/compiler/index.d.mts +3 -3
  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-DyK1_szo.mjs → compiler-BYRrEeD-.mjs} +2065 -2106
  7. package/dist/declarations/stencil-public-compiler.d.ts +4085 -2
  8. package/dist/declarations/stencil-public-compiler.js +0 -1
  9. package/dist/declarations/stencil-public-docs.d.ts +494 -1
  10. package/dist/declarations/stencil-public-runtime.d.ts +1943 -2
  11. package/dist/{index-fIuYTL9f.d.mts → index-9LTuoSiw.d.mts} +18 -2
  12. package/dist/{index-D-LlB2nw.d.mts → index-BwTaN1Nq.d.mts} +199 -809
  13. package/dist/{index-BONzXKJt.d.ts → index-CyrGY82h.d.ts} +5 -7
  14. package/dist/{index-CHjZtib0.d.ts → index-hS-KBdAP.d.ts} +1 -1
  15. package/dist/index.d.mts +1 -0
  16. package/dist/index.mjs +2 -2
  17. package/dist/{jsx-runtime-DBzBJLKk.d.ts → jsx-runtime-DlDkTqps.d.ts} +1 -1
  18. package/dist/jsx-runtime.d.ts +1 -1
  19. package/dist/jsx-runtime.js +1 -1
  20. package/dist/{node-BWBQAh8C.mjs → node-BF2jSfWg.mjs} +3 -14
  21. package/dist/regular-expression-D5pGVpCu.mjs +415 -0
  22. package/dist/runtime/app-data/index.d.ts +1 -1
  23. package/dist/runtime/app-data/index.js +1 -2
  24. package/dist/runtime/client/index.d.ts +18 -4
  25. package/dist/runtime/client/index.js +130 -214
  26. package/dist/runtime/index.d.ts +20 -4
  27. package/dist/runtime/index.js +2 -2
  28. package/dist/runtime/server/index.d.mts +18 -7
  29. package/dist/runtime/server/index.mjs +128 -215
  30. package/dist/runtime/server/runner.d.mts +1 -17
  31. package/dist/runtime/server/runner.mjs +12 -394
  32. package/dist/{runtime-CqlPYKjW.js → runtime-COEYYPyw.js} +130 -214
  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 +3 -3
  37. package/dist/testing/index.mjs +20 -18
  38. package/dist/{validation-BR7tMYEv.mjs → validation-Byxie0Uk.mjs} +28 -24
  39. package/package.json +9 -13
  40. package/dist/serialize-o-Sj1lvg.mjs +0 -792
  41. package/dist/stencil-public-compiler-C_X1iolo.d.ts +0 -4455
  42. package/dist/stencil-public-runtime-DlV8o7-z.d.ts +0 -1845
@@ -1,5 +1,5 @@
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 { _ 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-CyrGY82h.js";
2
+ import { n as jsxs, r as Fragment, t as jsx } from "../jsx-runtime-DlDkTqps.js";
3
3
 
4
4
  //#region src/runtime/asset-path.d.ts
5
5
  declare const getAssetPath: (path: string) => string;
@@ -21,6 +21,18 @@ declare const disconnectedCallback: (elm: HostElement) => Promise<void>;
21
21
  //#endregion
22
22
  //#region src/runtime/element.d.ts
23
23
  declare const getElement: (ref: any) => HostElement;
24
+ /**
25
+ * Get the shadow root for a Stencil component's host element.
26
+ * This works for both open and closed shadow DOM modes.
27
+ *
28
+ * For closed shadow DOM, `element.shadowRoot` returns `null` by design,
29
+ * but Stencil stores the reference internally so components can still
30
+ * access their own shadow root.
31
+ *
32
+ * @param element The host element (from @Element() decorator)
33
+ * @returns The shadow root, or null if no shadow root exists
34
+ */
35
+ declare const getShadowRoot: (element: HTMLElement) => ShadowRoot | null;
24
36
  //#endregion
25
37
  //#region src/runtime/event-emitter.d.ts
26
38
  declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
@@ -28,7 +40,7 @@ declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
28
40
  };
29
41
  //#endregion
30
42
  //#region src/runtime/host-listener.d.ts
31
- declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[], attachParentListeners?: boolean) => void;
43
+ declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]) => void;
32
44
  //#endregion
33
45
  //#region src/runtime/mixin.d.ts
34
46
  type Ctor<T = {}> = new (...args: any[]) => T;
@@ -105,6 +117,10 @@ declare const proxyComponent: (Cstr: ComponentConstructor, cmpMeta: ComponentRun
105
117
  /**
106
118
  * Method to render a virtual DOM tree to a container element.
107
119
  *
120
+ * Supports efficient re-renders: calling `render()` again on the same container
121
+ * will diff the new VNode tree against the previous one and only update what changed,
122
+ * preserving existing DOM elements and their state.
123
+ *
108
124
  * @example
109
125
  * ```tsx
110
126
  * import { render } from '@stencil/core';
@@ -179,4 +195,4 @@ declare const insertVdomAnnotations: (doc: Document, staticComponents: string[])
179
195
  */
180
196
  declare const renderVdom: (hostRef: HostRef, renderFnResults: VNode | VNode[], isInitialLoad?: boolean) => void;
181
197
  //#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 };
198
+ export { Fragment, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Mixin, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, getValue, h, insertVdomAnnotations, jsx, jsxs, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, render, renderVdom, setAssetPath, setMode, setNonce, setPlatformOptions, setTagTransformer, setValue, transformTag };
@@ -1,2 +1,2 @@
1
- import { A as Host, C as postUpdateComponent, D as parsePropertyValue, E as getElement, M as getAssetPath, N as setAssetPath, O as getMode, P as HYDRATED_STYLE_ID, S as getRenderingRef, T as createEvent, _ as connectedCallback, a as transformTag, b as setValue, c as setNonce, d as Fragment, f as bootstrapLazy, g as disconnectedCallback, h as proxyCustomElement, i as setTagTransformer, j as h, k as setMode, l as Mixin, m as forceModeUpdate, n as jsx, o as render, p as defineCustomElement, r as jsxs, s as setPlatformOptions, t as insertVdomAnnotations, u as addHostEventListeners, v as proxyComponent, w as renderVdom, x as forceUpdate, y as getValue } from "../runtime-CqlPYKjW.js";
2
- export { Fragment, HYDRATED_STYLE_ID, Host, 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 };
1
+ import { A as h, C as postUpdateComponent, D as getMode, E as parsePropertyValue, F as HYDRATED_STYLE_ID, M as getShadowRoot, N as getAssetPath, O as setMode, P as setAssetPath, S as getRenderingRef, T as createEvent, _ as connectedCallback, a as transformTag, b as setValue, c as setNonce, d as Fragment, f as bootstrapLazy, g as disconnectedCallback, h as proxyCustomElement, i as setTagTransformer, j as getElement, k as Host, l as Mixin, m as forceModeUpdate, n as jsx, o as render, p as defineCustomElement, r as jsxs, s as setPlatformOptions, t as insertVdomAnnotations, u as addHostEventListeners, v as proxyComponent, w as renderVdom, x as forceUpdate, y as getValue } from "../runtime-COEYYPyw.js";
2
+ export { Fragment, HYDRATED_STYLE_ID, Host, Mixin, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, getValue, h, insertVdomAnnotations, jsx, jsxs, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, render, renderVdom, setAssetPath, setMode, setNonce, setPlatformOptions, setTagTransformer, setValue, transformTag };
@@ -139,8 +139,6 @@ interface VNode {
139
139
  interface CustomElementsDefineOptions {
140
140
  exclude?: string[];
141
141
  syncQueue?: boolean;
142
- /** @deprecated in-favour of `setTagTransformer` and `transformTag` */
143
- transformTagName?: (tagName: string) => string;
144
142
  jmp?: (c: Function) => any;
145
143
  raf?: (c: FrameRequestCallback) => number;
146
144
  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
@@ -933,10 +931,6 @@ declare const hAsync: (nodeName: any, vnodeData: any, ...children: ChildType[])
933
931
  //#region src/server/platform/hydrate-app.d.ts
934
932
  declare function hydrateApp(win: Window & typeof globalThis, opts: HydrateFactoryOptions, results: HydrateResults, afterHydrate: (win: Window, opts: HydrateFactoryOptions, results: HydrateResults, resolve: (results: HydrateResults) => void) => void, resolve: (results: HydrateResults) => void): void;
935
933
  //#endregion
936
- //#region src/runtime/asset-path.d.ts
937
- declare const getAssetPath: (path: string) => string;
938
- declare const setAssetPath: (path: string) => string;
939
- //#endregion
940
934
  //#region src/runtime/bootstrap-custom-element.d.ts
941
935
  declare const defineCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => void;
942
936
  declare const proxyCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => any;
@@ -963,7 +957,7 @@ declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
963
957
  declare const Fragment: FunctionalComponent;
964
958
  //#endregion
965
959
  //#region src/runtime/host-listener.d.ts
966
- declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[], attachParentListeners?: boolean) => void;
960
+ declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]) => void;
967
961
  //#endregion
968
962
  //#region src/runtime/mixin.d.ts
969
963
  type Ctor<T = {}> = new (...args: any[]) => T;
@@ -1136,6 +1130,23 @@ declare const registerHost: (elm: HostElement, cmpMeta: ComponentRuntimeMeta) =>
1136
1130
  declare const Build: UserBuildConditionals;
1137
1131
  declare const styles: StyleMap;
1138
1132
  declare const modeResolutionChain: ResolutionHandler[];
1133
+ /**
1134
+ * Server-side implementation of getAssetPath.
1135
+ *
1136
+ * Unlike the client-side version, this doesn't use import.meta.url as a fallback
1137
+ * because it doesn't make sense in the bundled hydrate factory context.
1138
+ * The base URL must come from plt.$resourcesUrl$ (set via hydration options).
1139
+ * @param path - The relative path to the asset
1140
+ * @returns The resolved asset path, which may be an absolute URL if resourcesUrl is set to an external URL, or a relative path if resourcesUrl is a relative path or not set at all
1141
+ */
1142
+ declare const getAssetPath: (path: string) => string;
1143
+ /**
1144
+ * Sets the base URL for resolving asset paths in the server/hydrate context.
1145
+ * @param path - The base URL to use for resolving asset paths. This should typically be set to the same value as the `resourcesUrl` option passed to `hydrateDocument` to ensure that asset paths are resolved correctly in the server/hydrate context.
1146
+ * If not set, it defaults to './', which is a reasonable default for server-side rendering.
1147
+ * @returns void
1148
+ */
1149
+ declare const setAssetPath: (path: string) => string;
1139
1150
  /**
1140
1151
  * Checks to see any components are rendered with `scoped`
1141
1152
  * @param opts - SSR options