@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
@@ -40,11 +40,22 @@ const HOST_FLAGS = {
40
40
  isWatchReady: 128,
41
41
  isListenReady: 256,
42
42
  needsRerender: 512,
43
- devOnRender: 1024,
44
- devOnDidLoad: 2048
43
+ /**
44
+ * Set once this component's real (lazy-loaded) `connectedCallback` has fired for
45
+ * the first time. Lets a descendant skip creating/awaiting a connect-promise for
46
+ * an ancestor that's already connected. See {@link HostRef.$onFirstConnectResolve$}.
47
+ */
48
+ hasFiredConnected: 1024,
49
+ /**
50
+ * Set when a lazy component's dynamic `import()` fails to resolve a
51
+ * constructor. Distinct from `hasInitializedComponent` being unset, which
52
+ * is true while an initialization attempt is merely queued/in-flight.
53
+ */
54
+ hasFailedLoad: 2048,
55
+ devOnRender: 4096,
56
+ devOnDidLoad: 8192
45
57
  };
46
58
  const CF_scopedCssEncapsulation = 2;
47
- const CF_needsShadowDomShim = 8;
48
59
  /**
49
60
  * A set of flags used for bitwise calculations against {@link ComponentRuntimeMeta#$flags$}.
50
61
  *
@@ -52,22 +63,81 @@ const CF_needsShadowDomShim = 8;
52
63
  * They should _not_ be used for calculations against other fields/numbers
53
64
  */
54
65
  const CMP_FLAGS = {
66
+ /**
67
+ * Used to determine if a component is using the shadow DOM.
68
+ * e.g. `shadow: true | {}` is set on the `@Component()` decorator
69
+ */
55
70
  shadowDomEncapsulation: 1,
71
+ /**
72
+ * Used to determine if a component is using scoped stylesheets
73
+ * e.g. `scoped: true` is set on the `@Component()` decorator
74
+ */
56
75
  scopedCssEncapsulation: CF_scopedCssEncapsulation,
76
+ /**
77
+ * Used to determine if a component does not use the shadow DOM _and_ has `<slot/>` tags in its markup.
78
+ */
57
79
  hasSlotRelocation: 4,
58
- needsShadowDomShim: CF_needsShadowDomShim,
80
+ /**
81
+ * Determines if `delegatesFocus` is enabled for a component that uses the shadow DOM.
82
+ * e.g. `shadow: { delegatesFocus: true }` is set on the `@Component()` decorator
83
+ */
59
84
  shadowDelegatesFocus: 16,
85
+ /**
86
+ * Determines if `mode` is set on the `@Component()` decorator
87
+ */
60
88
  hasMode: 32,
61
- needsScopedEncapsulation: CF_scopedCssEncapsulation | CF_needsShadowDomShim,
89
+ /**
90
+ * Determines if styles must be scoped - i.e. the component uses scoped stylesheets.
91
+ */
92
+ needsScopedEncapsulation: CF_scopedCssEncapsulation,
93
+ /**
94
+ * Determines if a component is form-associated or not. This is set based on
95
+ * options passed to the `@Component` decorator.
96
+ */
62
97
  formAssociated: 64,
98
+ /**
99
+ * Determines if a `shadow: true` component needs
100
+ * to have its styles scoped during SSR as opposed to using DSD.
101
+ */
63
102
  shadowNeedsScopedCss: 128,
103
+ /**
104
+ * Determines if a component has a `<slot>` in its template.
105
+ */
64
106
  hasSlot: 256,
107
+ /**
108
+ * Determines if a component uses modern class property declarations.
109
+ */
65
110
  hasModernPropertyDecls: 512,
111
+ /**
112
+ * Determines if `slotAssignment` is set to `'manual'` for a component that uses the shadow DOM.
113
+ * e.g. `shadow: { slotAssignment: 'manual' }` is set on the `@Component()` decorator
114
+ */
66
115
  shadowSlotAssignmentManual: 1024,
116
+ /**
117
+ * Determines if the shadow DOM mode is 'closed'.
118
+ * e.g. `encapsulation: { type: 'shadow', mode: 'closed' }` is set on the `@Component()` decorator
119
+ */
67
120
  shadowModeClosed: 2048,
121
+ /**
122
+ * Determines if the component should patch child node accessors for slot handling.
123
+ * e.g. `encapsulation: { type: 'none', patches: ['children'] }`
124
+ */
68
125
  patchChildren: 4096,
126
+ /**
127
+ * Determines if the component should patch cloneNode() for slot handling.
128
+ * e.g. `encapsulation: { type: 'none', patches: ['clone'] }`
129
+ */
69
130
  patchClone: 8192,
131
+ /**
132
+ * Determines if the component should patch appendChild/insertBefore for slot handling.
133
+ * e.g. `encapsulation: { type: 'none', patches: ['insert'] }`
134
+ */
70
135
  patchInsert: 16384,
136
+ /**
137
+ * Determines if the component should apply all slot patches.
138
+ * e.g. `encapsulation: { type: 'none', patches: ['all'] }`
139
+ * Equivalent to the global `experimentalSlotFixes` config option.
140
+ */
71
141
  patchAll: 32768
72
142
  };
73
143
  /**
@@ -84,6 +154,7 @@ const XLINK_NS = "http://www.w3.org/1999/xlink";
84
154
  * File names and value
85
155
  */
86
156
  const COLLECTION_MANIFEST_FILE_NAME = "collection-manifest.json";
157
+ const COLLECTION_APP_DATA_FILE_NAME = "app-data.js";
87
158
  /**
88
159
  * Constant for the 'copy' output target
89
160
  */
@@ -93,37 +164,54 @@ const COPY = "copy";
93
164
  */
94
165
  const CUSTOM = "custom";
95
166
  /**
96
- * Constant for the 'dist' output target
167
+ * Constant for the 'loader-bundle' output target
168
+ * (formerly 'dist' in v4)
97
169
  */
98
- const DIST = "dist";
170
+ const LOADER_BUNDLE = "loader-bundle";
99
171
  /**
100
- * Constant for the 'dist-collection' output target
172
+ * Constant for the 'standalone' output target
173
+ * (formerly 'dist-custom-elements' in v4)
101
174
  */
102
- const DIST_COLLECTION = "dist-collection";
175
+ const STANDALONE = "standalone";
103
176
  /**
104
- * Constant for the 'dist-custom-elements' output target
177
+ * Constant for the 'ssr' output target
178
+ * (formerly 'dist-hydrate-script' in v4)
105
179
  */
106
- const DIST_CUSTOM_ELEMENTS = "dist-custom-elements";
180
+ const SSR = "ssr";
107
181
  /**
108
- * Constant for the 'dist-types' output target
182
+ * Constant for the 'ssr-wasm' output target.
183
+ * Compiles the SSR script to a WASM binary via javy for use in any WASM-capable host
184
+ * (PHP, Java, Ruby, Go, etc.) without requiring a JavaScript runtime.
109
185
  */
110
- const DIST_TYPES = "dist-types";
186
+ const SSR_WASM = "ssr-wasm";
111
187
  /**
112
- * Constant for the 'dist-hydrate-script' output target
188
+ * Constant for the 'collection' output target
189
+ * (formerly 'dist-collection' sub-output in v4)
190
+ *
191
+ * Contains transpiled source + metadata for downstream Stencil projects
192
+ * to re-compile/bundle.
113
193
  */
114
- const DIST_HYDRATE_SCRIPT = "dist-hydrate-script";
194
+ const COLLECTION = "collection";
115
195
  /**
116
- * Constant for the 'dist-lazy' output target
196
+ * Constant for the 'types' output target
197
+ * (formerly 'dist-types' sub-output in v4)
117
198
  */
118
- const DIST_LAZY = "dist-lazy";
199
+ const TYPES = "types";
119
200
  /**
120
- * Constant for the 'dist-lazy-loader' output target
201
+ * Constant for the 'global-style' output target
202
+ * Outputs global styles to a unified location available to all distributions.
121
203
  */
122
- const DIST_LAZY_LOADER = "dist-lazy-loader";
204
+ const GLOBAL_STYLE = "global-style";
123
205
  /**
124
- * Constant for the 'dist-global-styles' output target
206
+ * Constant for the 'assets' output target
207
+ * Copies component assetsDirs to a unified location available to all distributions.
125
208
  */
126
- const DIST_GLOBAL_STYLES = "dist-global-styles";
209
+ const ASSETS = "assets";
210
+ /**
211
+ * Internal constant for the 'dist-lazy' output target
212
+ * (used by loader-bundle and www)
213
+ */
214
+ const DIST_LAZY = "dist-lazy";
127
215
  /**
128
216
  * Constant for the 'docs-custom' output target
129
217
  */
@@ -145,6 +233,10 @@ const DOCS_VSCODE = "docs-vscode";
145
233
  */
146
234
  const DOCS_CUSTOM_ELEMENTS_MANIFEST = "docs-custom-elements-manifest";
147
235
  /**
236
+ * Constant for the 'docs-agent-skill' output target
237
+ */
238
+ const DOCS_AGENT_SKILL = "docs-agent-skill";
239
+ /**
148
240
  * Constant for the 'stats' output target
149
241
  */
150
242
  const STATS = "stats";
@@ -155,28 +247,46 @@ const WWW = "www";
155
247
  /**
156
248
  * Valid output targets to specify in a Stencil config.
157
249
  *
158
- * Note that there are some output targets (e.g. `DIST_TYPES`) which are
159
- * programmatically set as output targets by the compiler when other output
160
- * targets (in that case `DIST`) are set, but which are _not_ supported in a
161
- * Stencil config. This is enforced in the output target validation code.
250
+ * Note that some internal output targets (e.g. `DIST_LAZY`, `DIST_GLOBAL_STYLES`)
251
+ * are programmatically created by the compiler and are not user-configurable.
252
+ *
253
+ * In v5, `TYPES` and `COLLECTION` are auto-generated in production builds unless explicitly configured.
162
254
  */
163
255
  const VALID_CONFIG_OUTPUT_TARGETS = [
164
256
  "www",
165
- DIST,
166
- DIST_COLLECTION,
167
- DIST_CUSTOM_ELEMENTS,
168
- DIST_LAZY,
169
- DIST_HYDRATE_SCRIPT,
257
+ LOADER_BUNDLE,
258
+ STANDALONE,
259
+ "ssr",
260
+ SSR_WASM,
261
+ COLLECTION,
262
+ TYPES,
263
+ GLOBAL_STYLE,
264
+ ASSETS,
265
+ "dist",
266
+ "dist-custom-elements",
267
+ "dist-hydrate-script",
268
+ "dist-collection",
269
+ "dist-types",
170
270
  DOCS_JSON,
171
271
  DOCS_README,
172
272
  DOCS_VSCODE,
173
273
  DOCS_CUSTOM,
174
274
  DOCS_CUSTOM_ELEMENTS_MANIFEST,
275
+ DOCS_AGENT_SKILL,
175
276
  COPY,
176
277
  CUSTOM,
177
278
  STATS
178
279
  ];
179
280
  const GENERATED_DTS = "components.d.ts";
281
+ const STYLE_EXT = [
282
+ "css",
283
+ "scss",
284
+ "sass",
285
+ "pcss",
286
+ "styl",
287
+ "stylus",
288
+ "less"
289
+ ];
180
290
  /**
181
291
  * DOM Node types
182
292
  *
@@ -412,4 +522,4 @@ const escapeRegExpSpecialCharacters = (text) => {
412
522
  return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
413
523
  };
414
524
  //#endregion
415
- export { XLINK_NS as $, DIST_CUSTOM_ELEMENTS as A, DOCS_VSCODE as B, CMP_FLAGS as C, DEFAULT_STYLE_MODE as D, CUSTOM as E, DIST_TYPES as F, LISTENER_FLAGS as G, GENERATED_DTS as H, DOCS_CUSTOM as I, STATS as J, MEMBER_FLAGS as K, DOCS_CUSTOM_ELEMENTS_MANIFEST as L, DIST_HYDRATE_SCRIPT as M, DIST_LAZY as N, DIST as O, DIST_LAZY_LOADER as P, WWW as Q, DOCS_JSON as R, queryNonceMetaTagContent as S, COPY as T, HOST_FLAGS as U, EVENT_FLAGS as V, HTML_NS as W, VALID_CONFIG_OUTPUT_TARGETS as X, SVG_NS as Y, WATCH_FLAGS as Z, sortBy as _, fromEntries as a, toTitleCase as b, isDef as c, isNumber as d, isObject as f, pluck as g, noop as h, flatOne as i, DIST_GLOBAL_STYLES as j, DIST_COLLECTION as k, isFunction as l, mergeIntoWith as m, dashToPascalCase as n, isBoolean as o, isString as p, NODE_TYPES as q, escapeWithPattern as r, isComplexType as s, escapeRegExpSpecialCharacters as t, isIterable as u, toCamelCase as v, COLLECTION_MANIFEST_FILE_NAME as w, unique as x, toDashCase as y, DOCS_README as z };
525
+ export { TYPES as $, DEFAULT_STYLE_MODE as A, GLOBAL_STYLE as B, ASSETS as C, COLLECTION_MANIFEST_FILE_NAME as D, COLLECTION_APP_DATA_FILE_NAME as E, DOCS_JSON as F, MEMBER_FLAGS as G, HTML_NS as H, DOCS_README as I, SSR_WASM as J, NODE_TYPES as K, DOCS_VSCODE as L, DOCS_AGENT_SKILL as M, DOCS_CUSTOM as N, COPY as O, DOCS_CUSTOM_ELEMENTS_MANIFEST as P, SVG_NS as Q, EVENT_FLAGS as R, queryNonceMetaTagContent as S, COLLECTION as T, LISTENER_FLAGS as U, HOST_FLAGS as V, LOADER_BUNDLE as W, STATS as X, STANDALONE as Y, STYLE_EXT as Z, sortBy as _, fromEntries as a, toTitleCase as b, isDef as c, isNumber as d, VALID_CONFIG_OUTPUT_TARGETS as et, isObject as f, pluck as g, noop as h, flatOne as i, DIST_LAZY as j, CUSTOM as k, isFunction as l, mergeIntoWith as m, dashToPascalCase as n, WWW as nt, isBoolean as o, isString as p, SSR as q, escapeWithPattern as r, XLINK_NS as rt, isComplexType as s, escapeRegExpSpecialCharacters as t, WATCH_FLAGS as tt, isIterable as u, toCamelCase as v, CMP_FLAGS as w, unique as x, toDashCase as y, GENERATED_DTS as z };
@@ -10,6 +10,6 @@ var __exportAll = (all, no_symbols) => {
10
10
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
11
11
  return target;
12
12
  };
13
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
13
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
14
14
  //#endregion
15
15
  export { __require as n, __exportAll as t };