@stencil/core 5.0.0-alpha.3 → 5.0.0-alpha.31

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 (56) hide show
  1. package/README.md +94 -0
  2. package/dist/app-data/index.d.ts +2 -0
  3. package/dist/{runtime/app-data → app-data}/index.js +17 -11
  4. package/dist/{client-CSm3x5ke.mjs → client-D1MsT-Rp.mjs} +2717 -2424
  5. package/dist/compiler/index.d.mts +170 -6
  6. package/dist/compiler/index.mjs +4 -3
  7. package/dist/compiler/utils/index.d.mts +272 -2
  8. package/dist/compiler/utils/index.mjs +4 -3
  9. package/dist/{compiler-D6iP7Bzb.mjs → compiler-Cddp97Pg.mjs} +14953 -12327
  10. package/dist/declarations/stencil-ext-modules.d.ts +5 -5
  11. package/dist/declarations/stencil-public-compiler.d.ts +728 -287
  12. package/dist/declarations/stencil-public-compiler.js +2 -3
  13. package/dist/declarations/stencil-public-docs.d.ts +19 -0
  14. package/dist/declarations/stencil-public-runtime.d.ts +131 -17
  15. package/dist/fragment-Di1hWOC8.mjs +4 -0
  16. package/dist/{index-tUR6pD3J.d.mts → index-BHj3EBl2.d.mts} +1052 -668
  17. package/dist/{index-CyrGY82h.d.ts → index-D2PAsXxx.d.ts} +215 -40
  18. package/dist/index-VK8okIiF.d.mts +108 -0
  19. package/dist/index.d.mts +4 -1
  20. package/dist/index.mjs +91 -2
  21. package/dist/jsx-runtime.d.mts +18 -0
  22. package/dist/jsx-runtime.mjs +3 -0
  23. package/dist/{node-Bg-mO5dw.mjs → node-BQR4L-TG.mjs} +76 -73
  24. package/dist/reactive-controller-BdCpSAQP.d.mts +13 -0
  25. package/dist/{regular-expression-D5pGVpCu.mjs → regular-expression-XqU5zmPp.mjs} +141 -31
  26. package/dist/{chunk-CjcI7cDX.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
  27. package/dist/{runtime-BBCnuprF.js → runtime/client/lazy.js} +2987 -2443
  28. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +228 -83
  29. package/dist/runtime/client/{index.js → runtime.js} +2852 -2432
  30. package/dist/runtime/index.d.ts +48 -29
  31. package/dist/runtime/index.js +5069 -2
  32. package/dist/runtime/server/index.d.mts +182 -75
  33. package/dist/runtime/server/index.mjs +2769 -2283
  34. package/dist/runtime/server/runner.d.mts +47 -32
  35. package/dist/runtime/server/runner.mjs +563 -687
  36. package/dist/signals/index.d.ts +49 -0
  37. package/dist/signals/index.js +199 -0
  38. package/dist/sys/node/index.d.mts +1 -2
  39. package/dist/sys/node/index.mjs +1 -1
  40. package/dist/sys/node/worker.d.mts +1 -1
  41. package/dist/sys/node/worker.mjs +6 -3
  42. package/dist/testing/index.d.mts +98 -9
  43. package/dist/testing/index.mjs +395 -70
  44. package/dist/util-BIa-iHnt.mjs +724 -0
  45. package/dist/validation-Dd3g77T5.mjs +778 -0
  46. package/package.json +49 -36
  47. package/dist/index-CXHCTQNt.d.mts +0 -190
  48. package/dist/index-hS-KBdAP.d.ts +0 -30
  49. package/dist/jsx-runtime-DlDkTqps.d.ts +0 -28
  50. package/dist/jsx-runtime.d.ts +0 -2
  51. package/dist/jsx-runtime.js +0 -2
  52. package/dist/runtime/app-data/index.d.ts +0 -2
  53. package/dist/validation-Byxie0Uk.mjs +0 -1445
  54. /package/{LICENSE.md → LICENSE} +0 -0
  55. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
  56. /package/dist/{runtime/app-globals → app-globals}/index.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "5.0.0-alpha.3",
3
+ "version": "5.0.0-alpha.31",
4
4
  "description": "A Compiler for Web Components and Progressive Web Apps",
5
5
  "keywords": [
6
6
  "components",
@@ -44,33 +44,45 @@
44
44
  "import": "./dist/compiler/utils/index.mjs"
45
45
  },
46
46
  "./jsx-runtime": {
47
- "types": "./dist/jsx-runtime.d.ts",
48
- "import": "./dist/jsx-runtime.js"
47
+ "types": "./dist/jsx-runtime.d.mts",
48
+ "import": "./dist/jsx-runtime.mjs"
49
49
  },
50
50
  "./jsx-dev-runtime": {
51
- "types": "./dist/jsx-runtime.d.ts",
52
- "import": "./dist/jsx-runtime.js"
51
+ "types": "./dist/jsx-runtime.d.mts",
52
+ "import": "./dist/jsx-runtime.mjs"
53
53
  },
54
54
  "./mock-doc": {
55
55
  "types": "./dist/mock-doc.d.mts",
56
56
  "import": "./dist/mock-doc.mjs",
57
57
  "default": "./dist/mock-doc.mjs"
58
58
  },
59
+ "./signals": {
60
+ "types": "./dist/signals/index.d.ts",
61
+ "import": "./dist/signals/index.js"
62
+ },
59
63
  "./runtime": {
60
64
  "types": "./dist/runtime/index.d.ts",
61
65
  "import": "./dist/runtime/index.js"
62
66
  },
63
- "./runtime/app-data": {
64
- "types": "./dist/runtime/app-data/index.d.ts",
65
- "import": "./dist/runtime/app-data/index.js"
67
+ "./app-data": {
68
+ "types": "./dist/app-data/index.d.ts",
69
+ "import": "./dist/app-data/index.js"
66
70
  },
67
- "./runtime/app-globals": {
68
- "types": "./dist/runtime/app-globals/index.d.ts",
69
- "import": "./dist/runtime/app-globals/index.js"
71
+ "./app-globals": {
72
+ "types": "./dist/app-globals/index.d.ts",
73
+ "import": "./dist/app-globals/index.js"
70
74
  },
71
75
  "./runtime/client": {
72
- "types": "./dist/runtime/client/index.d.ts",
73
- "import": "./dist/runtime/client/index.js"
76
+ "types": "./dist/runtime/client/runtime.d.ts",
77
+ "import": "./dist/runtime/client/runtime.js"
78
+ },
79
+ "./runtime/client/standalone": {
80
+ "types": "./dist/runtime/client/runtime.d.ts",
81
+ "import": "./dist/runtime/client/runtime.js"
82
+ },
83
+ "./runtime/client/lazy": {
84
+ "types": "./dist/runtime/client/runtime.d.ts",
85
+ "import": "./dist/runtime/client/lazy.js"
74
86
  },
75
87
  "./runtime/server": {
76
88
  "types": "./dist/runtime/server/index.d.mts",
@@ -90,35 +102,36 @@
90
102
  }
91
103
  },
92
104
  "dependencies": {
93
- "@parcel/watcher": "^2.5.1",
94
- "@rollup/pluginutils": "^5.3.0",
95
- "@stencil/vitest": "^1.10.0",
96
- "browserslist": "^4.24.0",
105
+ "@parcel/watcher": "^2.6.0",
106
+ "@preact/signals-core": "^1.14.4",
107
+ "@rollup/pluginutils": "^5.4.0",
108
+ "browserslist": "^4.28.8",
97
109
  "chalk": "^5.6.2",
98
110
  "css-what": "^7.0.0",
99
- "glob": "^10.0.0",
100
- "graceful-fs": "^4.2.11",
101
- "lightningcss": "^1.32.0",
102
- "magic-string": "^0.30.0",
103
- "minimatch": "^10.1.2",
104
- "postcss": "^8.5.6",
111
+ "jiti": "^2.7.0",
112
+ "lightningcss": "^1.33.0",
113
+ "magic-string": "^0.30.21",
114
+ "picomatch": "^4.0.5",
115
+ "postcss": "^8.5.26",
105
116
  "postcss-safe-parser": "^7.0.1",
106
- "postcss-selector-parser": "^7.1.1",
107
- "resolve": "^1.22.0",
108
- "rolldown": "^1.0.0-rc.13",
109
- "semver": "^7.7.4",
110
- "terser": "5.37.0",
111
- "typescript": "~6.0.2",
112
- "@stencil/cli": "5.0.0-alpha.3",
113
- "@stencil/mock-doc": "5.0.0-alpha.3",
114
- "@stencil/dev-server": "5.0.0-alpha.3"
117
+ "postcss-selector-parser": "^7.1.5",
118
+ "resolve": "^1.22.12",
119
+ "rolldown": "^1.2.4",
120
+ "semver": "^7.8.5",
121
+ "terser": "^5.50.0",
122
+ "tinyglobby": "^0.2.17",
123
+ "typescript": ">5.0.0 <7.0.0",
124
+ "@stencil/cli": "5.0.0-alpha.31",
125
+ "@stencil/mock-doc": "5.0.0-alpha.31",
126
+ "@stencil/dev-server": "5.0.0-alpha.31"
115
127
  },
116
128
  "devDependencies": {
117
129
  "@ionic/prettier-config": "^4.0.0",
118
- "prettier": "^3.5.0",
119
- "tsdown": "^0.21.6",
120
- "vitest": "^4.1.1",
121
- "vitest-environment-stencil": "^1.10.0"
130
+ "@stencil/vitest": "^1.14.0",
131
+ "prettier": "^3.9.6",
132
+ "tsdown": "^0.22.14",
133
+ "vitest": "^4.1.10",
134
+ "vitest-environment-stencil": "^1.14.0"
122
135
  },
123
136
  "volta": {
124
137
  "extends": "../../package.json"
@@ -1,190 +0,0 @@
1
- import { ca as RafCallback, da as UserBuildConditionals, fa as VNode, la as ResolutionHandler, mn as RuntimeRef, oa as ErrorHandler, p as ChildType, sa as FunctionalComponent, ua as TagTransformer, wt as HostElement } from "./index-tUR6pD3J.mjs";
2
-
3
- //#region src/client/client-build.d.ts
4
- declare const Build: UserBuildConditionals;
5
- //#endregion
6
- //#region src/client/client-decorators.d.ts
7
- /**
8
- * Runtime stubs for Stencil decorators.
9
- *
10
- * These decorators are compile-time metadata flags that Stencil's compiler parses
11
- * and transforms. At runtime, they do nothing - the actual component behavior is
12
- * wired up by the compiled output, not by these decorators.
13
- *
14
- * These stubs exist so that:
15
- * 1. Component classes can be instantiated directly in tests without going through
16
- * Stencil's full compilation pipeline
17
- * 2. The decorators don't throw "X is not a function" errors when used outside
18
- * of Stencil's build process
19
- */
20
- /**
21
- * No-op class decorator stub for @Component()
22
- * @param _opts - component options (ignored at runtime)
23
- * @returns a class decorator that returns the target unchanged
24
- */
25
- declare const Component: (_opts?: any) => ClassDecorator;
26
- /**
27
- * No-op property decorator stub for @Element()
28
- * @returns a property decorator that does nothing
29
- */
30
- declare const Element$1: () => PropertyDecorator;
31
- /**
32
- * No-op property decorator stub for @Event()
33
- * @param _opts - event options (ignored at runtime)
34
- * @returns a property decorator that does nothing
35
- */
36
- declare const Event: (_opts?: any) => PropertyDecorator;
37
- /**
38
- * No-op property decorator stub for @AttachInternals()
39
- * @param _opts - attach internals options (ignored at runtime)
40
- * @returns a property decorator that does nothing
41
- */
42
- declare const AttachInternals: (_opts?: any) => PropertyDecorator;
43
- /**
44
- * No-op method decorator stub for @Listen()
45
- * @param _eventName - event name to listen for (ignored at runtime)
46
- * @param _opts - listen options (ignored at runtime)
47
- * @returns a method decorator that does nothing
48
- */
49
- declare const Listen: (_eventName: string, _opts?: any) => MethodDecorator;
50
- /**
51
- * No-op method decorator stub for @Method()
52
- * @param _opts - method options (ignored at runtime)
53
- * @returns a method decorator that does nothing
54
- */
55
- declare const Method: (_opts?: any) => MethodDecorator;
56
- /**
57
- * No-op property decorator stub for @Prop()
58
- * @param _opts - prop options (ignored at runtime)
59
- * @returns a property decorator that does nothing
60
- */
61
- declare const Prop: (_opts?: any) => PropertyDecorator;
62
- /**
63
- * No-op property decorator stub for @State()
64
- * @returns a property decorator that does nothing
65
- */
66
- declare const State: () => PropertyDecorator;
67
- /**
68
- * No-op method decorator stub for @Watch()
69
- * @param _propName - property name to watch (ignored at runtime)
70
- * @param _opts - watch options (ignored at runtime)
71
- * @returns a method decorator that does nothing
72
- */
73
- declare const Watch: (_propName: any, _opts?: any) => MethodDecorator;
74
- /**
75
- * No-op method decorator stub for @PropSerialize()
76
- * @param _propName - property name to serialize (ignored at runtime)
77
- * @returns a method decorator that does nothing
78
- */
79
- declare const PropSerialize: (_propName: any) => MethodDecorator;
80
- /**
81
- * No-op method decorator stub for @AttrDeserialize()
82
- * @param _propName - property name to deserialize (ignored at runtime)
83
- * @returns a method decorator that does nothing
84
- */
85
- declare const AttrDeserialize: (_propName: any) => MethodDecorator;
86
- /**
87
- * No-op compile-time utility stub for resolveVar()
88
- * At runtime, this just returns the string representation of whatever is passed in.
89
- * @param variable - the variable to resolve
90
- * @returns the string representation of the variable
91
- */
92
- declare const resolveVar: <T>(variable: T) => string;
93
- //#endregion
94
- //#region src/client/client-log.d.ts
95
- declare const setErrorHandler: (handler: ErrorHandler) => ErrorHandler;
96
- //#endregion
97
- //#region src/client/client-task-queue.d.ts
98
- declare const readTask: (cb: RafCallback) => void;
99
- declare const writeTask: (cb: RafCallback) => void;
100
- //#endregion
101
- //#region src/client/client-window.d.ts
102
- declare const setPlatformHelpers: (helpers: {
103
- jmp?: (c: any) => any;
104
- raf?: (c: any) => number;
105
- ael?: (el: any, eventName: string, listener: any, options: any) => void;
106
- rel?: (el: any, eventName: string, listener: any, options: any) => void;
107
- ce?: (eventName: string, opts?: any) => any;
108
- }) => void;
109
- //#endregion
110
- //#region src/app-data/index.d.ts
111
- declare const Env: {};
112
- //#endregion
113
- //#region src/runtime/asset-path.d.ts
114
- declare const getAssetPath: (path: string) => string;
115
- declare const setAssetPath: (path: string) => string;
116
- //#endregion
117
- //#region src/runtime/element.d.ts
118
- declare const getElement: (ref: any) => HostElement;
119
- /**
120
- * Get the shadow root for a Stencil component's host element.
121
- * This works for both open and closed shadow DOM modes.
122
- *
123
- * For closed shadow DOM, `element.shadowRoot` returns `null` by design,
124
- * but Stencil stores the reference internally so components can still
125
- * access their own shadow root.
126
- *
127
- * @param element The host element (from @Element() decorator)
128
- * @returns The shadow root, or null if no shadow root exists
129
- */
130
- declare const getShadowRoot: (element: HTMLElement) => ShadowRoot | null;
131
- //#endregion
132
- //#region src/runtime/event-emitter.d.ts
133
- declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
134
- emit: (detail: any) => CustomEvent<any>;
135
- };
136
- //#endregion
137
- //#region src/runtime/fragment.d.ts
138
- declare const Fragment: FunctionalComponent;
139
- //#endregion
140
- //#region src/runtime/mixin.d.ts
141
- type Ctor<T = {}> = new (...args: any[]) => T;
142
- declare function Mixin(...mixins: ((base: Ctor) => Ctor)[]): Ctor<{}>;
143
- //#endregion
144
- //#region src/runtime/mode.d.ts
145
- declare const setMode: (handler: ResolutionHandler) => number;
146
- declare const getMode: (ref: RuntimeRef) => string;
147
- //#endregion
148
- //#region src/runtime/render.d.ts
149
- /**
150
- * Method to render a virtual DOM tree to a container element.
151
- *
152
- * @example
153
- * ```tsx
154
- * import { render } from '@stencil/core';
155
- *
156
- * const vnode = (
157
- * <div>
158
- * <h1>Hello, world!</h1>
159
- * </div>
160
- * );
161
- * render(vnode, document.body);
162
- * ```
163
- *
164
- * @param vnode - The virtual DOM tree to render
165
- * @param container - The container element to render the virtual DOM tree to
166
- */
167
- declare function render(vnode: VNode, container: Element): void;
168
- //#endregion
169
- //#region src/runtime/tag-transform.d.ts
170
- /**
171
- * Transforms a tag name using the current tag transformer
172
- * @param tag - the tag to transform e.g. `my-tag`
173
- * @returns the transformed tag e.g. `new-my-tag`
174
- */
175
- declare function transformTag<T extends string>(tag: T): T;
176
- /**
177
- * Sets the tag transformer to be used when rendering custom elements
178
- * @param transformer the transformer function to use. Must return a string
179
- */
180
- declare function setTagTransformer(transformer: TagTransformer): void;
181
- //#endregion
182
- //#region src/runtime/update-component.d.ts
183
- declare const getRenderingRef: () => any;
184
- declare const forceUpdate: (ref: any) => boolean;
185
- //#endregion
186
- //#region src/runtime/vdom/h.d.ts
187
- declare const h: (nodeName: any, vnodeData: any, ...children: ChildType[]) => VNode;
188
- declare const Host: {};
189
- //#endregion
190
- export { PropSerialize as A, AttrDeserialize as C, Listen as D, Event as E, Watch as M, resolveVar as N, Method as O, Build as P, AttachInternals as S, Element$1 as T, Env as _, setTagTransformer as a, writeTask as b, getMode as c, Fragment as d, createEvent as f, setAssetPath as g, getAssetPath as h, getRenderingRef as i, State as j, Prop as k, setMode as l, getShadowRoot as m, h as n, transformTag as o, getElement as p, forceUpdate as r, render as s, Host as t, Mixin as u, setPlatformHelpers as v, Component as w, setErrorHandler as x, readTask as y };
@@ -1,30 +0,0 @@
1
- import { t as BuildConditionals } from "./index-CyrGY82h.js";
2
-
3
- //#region src/app-data/index.d.ts
4
- /**
5
- * A collection of default build flags for a Stencil project.
6
- *
7
- * This collection can be found throughout the Stencil codebase, often imported from the `virtual:app-data` module like so:
8
- * ```ts
9
- * import { BUILD } from 'virtual:app-data';
10
- * ```
11
- * and is used to determine if a portion of the output of a Stencil _project_'s compilation step can be eliminated.
12
- *
13
- * e.g. When `BUILD.allRenderFn` evaluates to `false`, the compiler will eliminate conditional statements like:
14
- * ```ts
15
- * if (BUILD.allRenderFn) {
16
- * // some code that will be eliminated if BUILD.allRenderFn is false
17
- * }
18
- * ```
19
- *
20
- * `virtual:app-data`, the module that `BUILD` is imported from, is an alias for the `@stencil/core/runtime/app-data`, and is
21
- * partially referenced by {@link STENCIL_APP_DATA_ID}. The `src/compiler/bundle/app-data-plugin.ts` references
22
- * `STENCIL_APP_DATA_ID` uses it to replace these defaults with {@link BuildConditionals} that are derived from a
23
- * Stencil project's contents (i.e. metadata from the components). This replacement happens at a Stencil project's
24
- * compile time. Such code can be found at `src/compiler/app-core/app-data.ts`.
25
- */
26
- declare const BUILD: BuildConditionals;
27
- declare const Env: {};
28
- declare const NAMESPACE: string;
29
- //#endregion
30
- export { Env as n, NAMESPACE as r, BUILD as t };
@@ -1,28 +0,0 @@
1
- import { m as FunctionalComponent, y as VNode } from "./index-CyrGY82h.js";
2
-
3
- //#region src/runtime/fragment.d.ts
4
- declare const Fragment: FunctionalComponent;
5
- //#endregion
6
- //#region src/runtime/vdom/jsx-runtime.d.ts
7
- /**
8
- * JSX runtime function for creating elements in production mode.
9
- * Called by TypeScript's jsx transform for elements without static children.
10
- *
11
- * @param type - The element type (string tag name or functional component)
12
- * @param props - The element props (includes children)
13
- * @param key - Optional key for the element
14
- * @returns A virtual DOM node
15
- */
16
- declare function jsx(type: any, props: any, key?: string): VNode;
17
- /**
18
- * JSX runtime function for creating elements with static children.
19
- * Called by TypeScript's jsx transform as an optimization when children are static.
20
- *
21
- * @param type - The element type (string tag name or functional component)
22
- * @param props - The element props (includes children)
23
- * @param key - Optional key for the element
24
- * @returns A virtual DOM node
25
- */
26
- declare function jsxs(type: any, props: any, key?: string): VNode;
27
- //#endregion
28
- export { jsxs as n, Fragment as r, jsx as t };
@@ -1,2 +0,0 @@
1
- import { n as jsxs, r as Fragment, t as jsx } from "./jsx-runtime-DlDkTqps.js";
2
- export { Fragment, jsx, jsxs };
@@ -1,2 +0,0 @@
1
- import { d as Fragment, n as jsx, r as jsxs } from "./runtime-BBCnuprF.js";
2
- export { Fragment, jsx, jsxs };
@@ -1,2 +0,0 @@
1
- import { n as Env, r as NAMESPACE, t as BUILD } from "../../index-hS-KBdAP.js";
2
- export { BUILD, Env, NAMESPACE };