@stencil/core 5.0.0-beta.13 → 5.0.0-beta.15

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.
@@ -1,6 +1,86 @@
1
1
  import { BUILD, BUILD as BUILD$1, Env, NAMESPACE, NAMESPACE as NAMESPACE$1 } from "@stencil/core/app-data";
2
2
  import { globalScripts, globalStyles } from "@stencil/core/app-globals";
3
3
  import * as SignalsCore from "@preact/signals-core";
4
+ //#region src/runtime/runtime-constants.ts
5
+ /**
6
+ * Bit flags for recording various properties of VDom nodes
7
+ */
8
+ const VNODE_FLAGS = {
9
+ /**
10
+ * Whether or not a vdom node is a slot reference
11
+ */
12
+ isSlotReference: 1,
13
+ /**
14
+ * Whether or not a slot element has fallback content
15
+ */
16
+ isSlotFallback: 2,
17
+ /**
18
+ * Whether or not an element is a host element
19
+ */
20
+ isHost: 4
21
+ };
22
+ const PROXY_FLAGS = {
23
+ isElementConstructor: 1,
24
+ proxyState: 2
25
+ };
26
+ const PLATFORM_FLAGS = {
27
+ /**
28
+ * designates a node in the DOM as being actively moved by the runtime
29
+ */
30
+ isTmpDisconnected: 1,
31
+ appLoaded: 2,
32
+ queueSync: 4,
33
+ queueMask: 6
34
+ };
35
+ /**
36
+ * A (subset) of node types which are relevant for the Stencil runtime. These
37
+ * values are based on the values which can possibly be returned by the
38
+ * `.nodeType` property of a DOM node. See here for details:
39
+ *
40
+ * {@link https://dom.spec.whatwg.org/#ref-for-dom-node-nodetype%E2%91%A0}
41
+ */
42
+ const NODE_TYPE = {
43
+ ElementNode: 1,
44
+ TextNode: 3,
45
+ CommentNode: 8,
46
+ DocumentNode: 9,
47
+ DocumentTypeNode: 10,
48
+ DocumentFragment: 11
49
+ };
50
+ const HYDRATE_ID = "s-id";
51
+ const HYDRATED_STYLE_ID = "sty-id";
52
+ const HYDRATE_CHILD_ID = "c-id";
53
+ const HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
54
+ const STENCIL_DOC_DATA = "_stencilDocData";
55
+ const DEFAULT_DOC_DATA = {
56
+ hostIds: 0,
57
+ rootLevelIds: 0,
58
+ staticComponents: /* @__PURE__ */ new Set()
59
+ };
60
+ /**
61
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
62
+ *
63
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
64
+ * support as of Stencil v4.
65
+ */
66
+ const SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
67
+ const XLINK_NS = "http://www.w3.org/1999/xlink";
68
+ /**
69
+ * Minimum delay, in milliseconds, before retrying a failed lazy component load.
70
+ */
71
+ const LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
72
+ const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
73
+ "formAssociatedCallback",
74
+ "formResetCallback",
75
+ "formDisabledCallback",
76
+ "formStateRestoreCallback"
77
+ ];
78
+ const SERVER_BUILD_FLAGS = {
79
+ isBrowser: false,
80
+ isServer: true,
81
+ isDev: false,
82
+ isTesting: false
83
+ };
4
84
  const MEMBER_FLAGS = {
5
85
  String: 1,
6
86
  Number: 2,
@@ -253,81 +333,6 @@ const reWireGetterSetter = (instance, hostRef) => {
253
333
  });
254
334
  };
255
335
  //#endregion
256
- //#region src/runtime/runtime-constants.ts
257
- /**
258
- * Bit flags for recording various properties of VDom nodes
259
- */
260
- const VNODE_FLAGS = {
261
- /**
262
- * Whether or not a vdom node is a slot reference
263
- */
264
- isSlotReference: 1,
265
- /**
266
- * Whether or not a slot element has fallback content
267
- */
268
- isSlotFallback: 2,
269
- /**
270
- * Whether or not an element is a host element
271
- */
272
- isHost: 4
273
- };
274
- const PROXY_FLAGS = {
275
- isElementConstructor: 1,
276
- proxyState: 2
277
- };
278
- const PLATFORM_FLAGS = {
279
- /**
280
- * designates a node in the DOM as being actively moved by the runtime
281
- */
282
- isTmpDisconnected: 1,
283
- appLoaded: 2,
284
- queueSync: 4,
285
- queueMask: 6
286
- };
287
- /**
288
- * A (subset) of node types which are relevant for the Stencil runtime. These
289
- * values are based on the values which can possibly be returned by the
290
- * `.nodeType` property of a DOM node. See here for details:
291
- *
292
- * {@link https://dom.spec.whatwg.org/#ref-for-dom-node-nodetype%E2%91%A0}
293
- */
294
- const NODE_TYPE = {
295
- ElementNode: 1,
296
- TextNode: 3,
297
- CommentNode: 8,
298
- DocumentNode: 9,
299
- DocumentTypeNode: 10,
300
- DocumentFragment: 11
301
- };
302
- const HYDRATE_ID = "s-id";
303
- const HYDRATED_STYLE_ID = "sty-id";
304
- const HYDRATE_CHILD_ID = "c-id";
305
- const HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
306
- const STENCIL_DOC_DATA = "_stencilDocData";
307
- const DEFAULT_DOC_DATA = {
308
- hostIds: 0,
309
- rootLevelIds: 0,
310
- staticComponents: /* @__PURE__ */ new Set()
311
- };
312
- /**
313
- * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
314
- *
315
- * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
316
- * support as of Stencil v4.
317
- */
318
- const SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
319
- const XLINK_NS = "http://www.w3.org/1999/xlink";
320
- /**
321
- * Minimum delay, in milliseconds, before retrying a failed lazy component load.
322
- */
323
- const LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
324
- const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
325
- "formAssociatedCallback",
326
- "formResetCallback",
327
- "formDisabledCallback",
328
- "formStateRestoreCallback"
329
- ];
330
- //#endregion
331
336
  //#region src/utils/shadow-root.ts
332
337
  let globalStyleSheet;
333
338
  const GLOBAL_STYLE_ID = "sc-global";
@@ -3625,7 +3630,7 @@ const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector)
3625
3630
  else return shallowPart.trim();
3626
3631
  }).join(", ");
3627
3632
  };
3628
- const isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer");
3633
+ const isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer") || selector.startsWith("@container");
3629
3634
  const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
3630
3635
  return processRules(cssText, (rule) => {
3631
3636
  let selector = rule.selector;
@@ -4260,9 +4265,16 @@ const connectedCallback = (elm) => {
4260
4265
  }
4261
4266
  if (BUILD$1.asyncLoading) {
4262
4267
  let ancestorComponent = elm;
4263
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) if (BUILD$1.hydrateClientSide && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
4264
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
4265
- break;
4268
+ while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
4269
+ if (BUILD$1.hydrateClientSide && !ancestorComponent["s-p"] && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute("s-id")) {
4270
+ ancestorComponent["s-p"] = [];
4271
+ ancestorComponent["s-rc"] = [];
4272
+ ancestorComponent["s-pc"] = [];
4273
+ }
4274
+ if (ancestorComponent["s-p"]) {
4275
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
4276
+ break;
4277
+ }
4266
4278
  }
4267
4279
  }
4268
4280
  if (BUILD$1.prop && !BUILD$1.hydrateServerSide && cmpMeta.$members$) Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
@@ -5467,12 +5479,7 @@ const registerHost = (elm, cmpMeta) => {
5467
5479
  elm.__s_ghr = () => hostRef;
5468
5480
  return hostRef;
5469
5481
  };
5470
- const Build = {
5471
- isDev: false,
5472
- isBrowser: false,
5473
- isServer: true,
5474
- isTesting: false
5475
- };
5482
+ const Build = { ...SERVER_BUILD_FLAGS };
5476
5483
  const styles = /* @__PURE__ */ new Map();
5477
5484
  const modeResolver = [];
5478
5485
  /**
@@ -139,7 +139,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
139
139
  * Note that this is "approximate", in that HTML may often not be able
140
140
  * to be split at an exact line width. Additionally, new lines created
141
141
  * is where HTML naturally already has whitespace, such as before an
142
- * attribute or spaces between words. Defaults to `100`.
142
+ * attribute or spaces between words. Defaults to no wrapping (`100` when prerendering).
143
143
  */
144
144
  approximateLineWidth?: number;
145
145
  /**
@@ -157,12 +157,12 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
157
157
  prettyHtml?: boolean;
158
158
  /**
159
159
  * Remove quotes from attribute values when possible.
160
- * Defaults to `true`.
160
+ * Defaults to `false` (`true` when prerendering).
161
161
  */
162
162
  removeAttributeQuotes?: boolean;
163
163
  /**
164
164
  * Remove the `=""` from standardized `boolean` attributes,
165
- * such as `hidden` or `checked`. Defaults to `true`.
165
+ * such as `hidden` or `checked`. Defaults to `false` (`true` when prerendering).
166
166
  */
167
167
  removeBooleanAttributeQuotes?: boolean;
168
168
  /**
@@ -171,7 +171,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
171
171
  */
172
172
  removeEmptyAttributes?: boolean;
173
173
  /**
174
- * Remove HTML comments. Defaults to `true`.
174
+ * Remove HTML comments. Defaults to `false` (`true` when prerendering).
175
175
  */
176
176
  removeHtmlComments?: boolean;
177
177
  /**
@@ -8047,10 +8047,12 @@ var MockTokenList = class {
8047
8047
  token = String(token);
8048
8048
  return getItems(this.elm, this.attr).includes(token);
8049
8049
  }
8050
- toggle(token) {
8050
+ toggle(token, force) {
8051
8051
  token = String(token);
8052
- if (this.contains(token) === true) this.remove(token);
8053
- else this.add(token);
8052
+ const shouldAdd = force === void 0 ? !this.contains(token) : !!force;
8053
+ if (shouldAdd) this.add(token);
8054
+ else this.remove(token);
8055
+ return shouldAdd;
8054
8056
  }
8055
8057
  get length() {
8056
8058
  return getItems(this.elm, this.attr).length;
@@ -1,4 +1,4 @@
1
- import { Nt as Logger, Y as CompilerSystem } from "../../index-BilaSOF5.mjs";
1
+ import { J as CompilerSystem, Mt as Logger } from "../../index-BxnFTzyD.mjs";
2
2
  //#region src/sys/node/logger/index.d.ts
3
3
  /**
4
4
  * Create a logger to run in a Node environment
@@ -1,2 +1,2 @@
1
- import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-DrwzfDH1.mjs";
1
+ import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-v9OHhp0m.mjs";
2
2
  export { createNodeLogger, createNodeSys, setupNodeProcess };
@@ -1,5 +1,5 @@
1
- import { l as createWorkerMessageHandler } from "../../compiler-Dr9JHtLp.mjs";
2
- import { t as createNodeSys } from "../../node-DrwzfDH1.mjs";
1
+ import { l as createWorkerMessageHandler } from "../../compiler-DhVflHyt.mjs";
2
+ import { t as createNodeSys } from "../../node-v9OHhp0m.mjs";
3
3
  //#region src/sys/node/node-worker-thread.ts
4
4
  /**
5
5
  * Initialize a worker thread, setting up various machinery for managing
@@ -1564,7 +1564,7 @@ interface CompilerSystem {
1564
1564
  name: 'node' | 'in-memory';
1565
1565
  version: string;
1566
1566
  events?: BuildEvents;
1567
- details?: SystemDetails;
1567
+ details: SystemDetails;
1568
1568
  /**
1569
1569
  * Add a callback which will be ran when destroy() is called.
1570
1570
  */
@@ -1577,14 +1577,15 @@ interface CompilerSystem {
1577
1577
  * SYNC! Always returns a boolean, does not throw.
1578
1578
  */
1579
1579
  accessSync(p: string): boolean;
1580
- applyGlobalPatch?(fromDir: string): Promise<void>;
1581
1580
  applyPrerenderGlobalPatch?(opts: {
1582
1581
  devServerHostUrl: string;
1583
1582
  window: any;
1584
1583
  }): void;
1585
- cacheStorage?: CacheStorage;
1586
- checkVersion?: (logger: Logger, currentVersion: string) => Promise<() => void>;
1587
- copy?(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
1584
+ /**
1585
+ * Check npm for a newer Stencil version. Resolves a function that logs the result.
1586
+ */
1587
+ checkVersion(logger: Logger, currentVersion: string): Promise<() => void>;
1588
+ copy(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
1588
1589
  /**
1589
1590
  * Always returns a boolean if the files were copied or not. Does not throw.
1590
1591
  */
@@ -1609,7 +1610,7 @@ interface CompilerSystem {
1609
1610
  /**
1610
1611
  * Each platform has a different way to dynamically import modules.
1611
1612
  */
1612
- dynamicImport?(p: string): Promise<any>;
1613
+ dynamicImport(p: string): Promise<any>;
1613
1614
  /**
1614
1615
  * Creates the worker controller for the current system.
1615
1616
  *
@@ -1623,20 +1624,14 @@ interface CompilerSystem {
1623
1624
  * process.exit()
1624
1625
  */
1625
1626
  exit(exitCode: number): Promise<void>;
1626
- /**
1627
- * Optionally provide a fetch() function rather than using the built-in fetch().
1628
- * First arg is a url string or Request object (RequestInfo).
1629
- * Second arg is the RequestInit. Returns the Response object
1630
- */
1631
- fetch?(input: string | any, init?: any): Promise<any>;
1632
1627
  /**
1633
1628
  * Generates a sha1 digest encoded as HEX
1634
1629
  */
1635
- generateContentHash?(content: string | any, length?: number): Promise<string>;
1630
+ generateContentHash(content: string | any, length?: number): Promise<string>;
1636
1631
  /**
1637
1632
  * Generates a sha1 digest encoded as HEX from a file path
1638
1633
  */
1639
- generateFileHash?(filePath: string | any, length?: number): Promise<string>;
1634
+ generateFileHash(filePath: string | any, length?: number): Promise<string>;
1640
1635
  /**
1641
1636
  * Get the current directory.
1642
1637
  */
@@ -1645,7 +1640,6 @@ interface CompilerSystem {
1645
1640
  * The compiler's executing path.
1646
1641
  */
1647
1642
  getCompilerExecutingPath(): string;
1648
- getEnvironmentVar?(key: string): string;
1649
1643
  /**
1650
1644
  * Gets the absolute file path when for a dependency module.
1651
1645
  */
@@ -1684,11 +1678,7 @@ interface CompilerSystem {
1684
1678
  * Normalize file system path.
1685
1679
  */
1686
1680
  normalizePath(p: string): string;
1687
- onProcessInterrupt?(cb: () => void): void;
1688
- parseYarnLockFile?: (content: string) => {
1689
- type: 'success' | 'merge' | 'conflict';
1690
- object: any;
1691
- };
1681
+ onProcessInterrupt(cb: () => void): void;
1692
1682
  platformPath: PlatformPath;
1693
1683
  /**
1694
1684
  * All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
@@ -1724,6 +1714,9 @@ interface CompilerSystem {
1724
1714
  * Rename old path to new path. Does not throw.
1725
1715
  */
1726
1716
  rename(oldPath: string, newPath: string): Promise<CompilerSystemRenameResults>;
1717
+ /**
1718
+ * Assigned by the compiler. Used by plugins (e.g. `@stencil/sass`) to resolve `~` imports.
1719
+ */
1727
1720
  resolveModuleId?(opts: ResolveModuleIdOptions): Promise<ResolveModuleIdResults>;
1728
1721
  resolvePath(p: string): string;
1729
1722
  /**
@@ -2363,7 +2356,7 @@ interface OutputTargetCollection extends OutputTargetBaseNext {
2363
2356
  * When `true` this flag will transform aliased import paths defined in
2364
2357
  * a project's `tsconfig.json` to relative import paths in the compiled output.
2365
2358
  *
2366
- * Paths will be left in aliased format if `false` or `undefined`.
2359
+ * Paths will be left in aliased format if `false`. Defaults to `true`.
2367
2360
  *
2368
2361
  * @example
2369
2362
  * // tsconfig.json
@@ -2465,11 +2458,11 @@ interface OutputTargetGlobalStyle extends OutputTargetBaseNext {
2465
2458
  * Controls whether this global stylesheet is injected into component shadow DOMs
2466
2459
  * as a constructable stylesheet at runtime.
2467
2460
  *
2468
- * - `'none'` (default): Don't inject - stylesheet must be loaded externally (e.g., via `<link>`)
2461
+ * - `'none'`: Don't inject - stylesheet must be loaded externally (e.g., via `<link>`)
2469
2462
  * - `'client'`: Inject only in client builds, not SSR (reduces SSR output size)
2470
2463
  * - `'all'`: Inject in both client and SSR builds
2471
2464
  *
2472
- * @default 'none'
2465
+ * @default 'client' when the stylesheet comes from `globalStyle` (or an auto-detected `src/global.*`), 'none' when `input` is set
2473
2466
  */
2474
2467
  inject?: 'none' | 'client' | 'all';
2475
2468
  }
@@ -2668,7 +2661,7 @@ interface OutputTargetDocsAgentSkill extends OutputTargetBase {
2668
2661
  /**
2669
2662
  * The skill's name, used in the `SKILL.md` frontmatter.
2670
2663
  *
2671
- * Defaults to a kebab-cased form of {@link Config.namespace}.
2664
+ * Defaults to {@link Config.namespace}, lowercased, with anything other than letters and numbers replaced by `-`.
2672
2665
  */
2673
2666
  name?: string;
2674
2667
  /**
@@ -2796,8 +2789,10 @@ interface OutputTargetBase {
2796
2789
  * This improves dev build times by not generating production-only artifacts.
2797
2790
  *
2798
2791
  * Defaults vary by output target type:
2799
- * - `loader-bundle`: `false` (always builds)
2800
- * - `standalone`: `true` (skips in dev)
2792
+ * - `loader-bundle`: `true` (skips the npm distribution files; the browser bundle always builds)
2793
+ * - `standalone`: `true` if `loader-bundle` is also configured, otherwise `false`
2794
+ * - `types`, `collection`, `ssr-wasm`: `true` (skips in dev)
2795
+ * - `assets`, `global-style`: `false` (always runs)
2801
2796
  * - `ssr`: `true` (skips in dev, unless `devServer.ssr` is enabled)
2802
2797
  * - `docs-*`: `true` (skips in dev)
2803
2798
  * - `custom`: `true` (skips in dev)
@@ -2967,10 +2962,6 @@ interface Diagnostic {
2967
2962
  relFilePath?: string | undefined;
2968
2963
  type: string;
2969
2964
  }
2970
- interface CacheStorage {
2971
- get(key: string): Promise<any>;
2972
- set(key: string, value: any): Promise<void>;
2973
- }
2974
2965
  /**
2975
2966
  * Input for CSS optimization functions, including the input CSS
2976
2967
  * string and a few boolean options which turn on or off various
@@ -33,7 +33,7 @@ import "@rollup/pluginutils";
33
33
  import { createHash } from "crypto";
34
34
  import { afterAll, vi } from "vitest";
35
35
  //#region src/version.ts
36
- const version = "5.0.0-beta.13";
36
+ const version = "5.0.0-beta.15";
37
37
  const MEMBER_FLAGS = {
38
38
  String: 1,
39
39
  Number: 2,
@@ -380,6 +380,10 @@ const trimFalsy = (data) => {
380
380
  */
381
381
  const isDef = (v) => v != null && v !== void 0;
382
382
  /**
383
+ * This is just a no-op, don't expect it to do anything.
384
+ */
385
+ const noop = () => {};
386
+ /**
383
387
  * Check whether a value is a 'complex type', defined here as an object or a
384
388
  * function.
385
389
  *
@@ -3626,9 +3630,7 @@ const h = (nodeName, vnodeData, ...children) => {
3626
3630
  if (classData && !(BUILD.vdomSignals && isSignalLike(classData))) vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
3627
3631
  }
3628
3632
  }
3629
- if (BUILD.isDev && vNodeChildren.some(isHost)) consoleDevError(`The <Host> must be the single root component. Make sure:
3630
- - You are NOT using hostData() and <Host> in the same component.
3631
- - <Host> is used once, and it's the single root component of the render() function.`);
3633
+ if (BUILD.isDev && vNodeChildren.some(isHost)) consoleDevError(`The <Host> must be used once, and be the single root component of the render() function.`);
3632
3634
  if (BUILD.vdomFunctional && typeof nodeName === "function") return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
3633
3635
  const vnode = newVNode(nodeName, null);
3634
3636
  vnode.$attrs$ = vnodeData;
@@ -4393,7 +4395,7 @@ const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector)
4393
4395
  else return shallowPart.trim();
4394
4396
  }).join(", ");
4395
4397
  };
4396
- const isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer");
4398
+ const isScopableAtRule = (selector) => selector.startsWith("@media") || selector.startsWith("@supports") || selector.startsWith("@page") || selector.startsWith("@document") || selector.startsWith("@layer") || selector.startsWith("@container");
4397
4399
  const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
4398
4400
  return processRules(cssText, (rule) => {
4399
4401
  let selector = rule.selector;
@@ -5024,9 +5026,16 @@ const connectedCallback = (elm) => {
5024
5026
  }
5025
5027
  if (BUILD.asyncLoading) {
5026
5028
  let ancestorComponent = elm;
5027
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) if (BUILD.hydrateClientSide && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
5028
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
5029
- break;
5029
+ while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
5030
+ if (BUILD.hydrateClientSide && !ancestorComponent["s-p"] && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute("s-id")) {
5031
+ ancestorComponent["s-p"] = [];
5032
+ ancestorComponent["s-rc"] = [];
5033
+ ancestorComponent["s-pc"] = [];
5034
+ }
5035
+ if (ancestorComponent["s-p"]) {
5036
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
5037
+ break;
5038
+ }
5030
5039
  }
5031
5040
  }
5032
5041
  if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
@@ -7401,15 +7410,6 @@ const createSystem = (c) => {
7401
7410
  }
7402
7411
  return results;
7403
7412
  };
7404
- /**
7405
- * `self` is the global namespace object used within a web worker.
7406
- * `window` is the browser's global namespace object (I reorganized this to check the reference on that second)
7407
- * `global` is Node's global namespace object. https://nodejs.org/api/globals.html#globals_global
7408
- *
7409
- * loading in this order should allow workers, which are most common, then browser,
7410
- * then Node to grab the reference to fetch correctly.
7411
- */
7412
- const fetch = typeof self !== "undefined" ? self?.fetch : typeof window !== "undefined" ? window?.fetch : typeof global !== "undefined" ? global?.fetch : void 0;
7413
7413
  const writeFile = async (p, data) => writeFileSync(p, data);
7414
7414
  const tmpDirSync = () => "/.tmp";
7415
7415
  const tick = Promise.resolve();
@@ -7420,6 +7420,7 @@ const createSystem = (c) => {
7420
7420
  if (typeof hashLength === "number") hashHex = hashHex.slice(0, hashLength);
7421
7421
  return hashHex;
7422
7422
  };
7423
+ const generateFileHash = async (filePath, hashLength) => generateContentHash(readFileSync(filePath), hashLength);
7423
7424
  const copy = async (copyTasks, srcDir) => {
7424
7425
  const results = {
7425
7426
  diagnostics: [],
@@ -7429,9 +7430,6 @@ const createSystem = (c) => {
7429
7430
  logger.info("todo, copy task", copyTasks.length, srcDir);
7430
7431
  return results;
7431
7432
  };
7432
- const getEnvironmentVar = (key) => {
7433
- return process$1?.env[key];
7434
- };
7435
7433
  const getLocalModulePath = (opts) => join(opts.rootDir, "node_modules", opts.moduleId, opts.path);
7436
7434
  const getRemoteModuleUrl = (opts) => {
7437
7435
  const npmBaseUrl = "https://cdn.jsdelivr.net/npm/";
@@ -7447,13 +7445,14 @@ const createSystem = (c) => {
7447
7445
  access,
7448
7446
  accessSync,
7449
7447
  addDestroy,
7448
+ checkVersion: async () => noop,
7450
7449
  copyFile,
7451
7450
  createDir,
7452
7451
  createDirSync,
7453
7452
  homeDir,
7454
7453
  isTTY,
7455
- getEnvironmentVar,
7456
7454
  destroy,
7455
+ dynamicImport: (p) => import(p),
7457
7456
  encodeToBase64,
7458
7457
  exit: async (exitCode) => logger.warn(`exit ${exitCode}`),
7459
7458
  getCurrentDirectory,
@@ -7464,6 +7463,7 @@ const createSystem = (c) => {
7464
7463
  isSymbolicLink,
7465
7464
  nextTick,
7466
7465
  normalizePath: normalize,
7466
+ onProcessInterrupt: noop,
7467
7467
  platformPath: path,
7468
7468
  readDir,
7469
7469
  readDirSync,
@@ -7473,7 +7473,6 @@ const createSystem = (c) => {
7473
7473
  realpathSync,
7474
7474
  removeDestroy,
7475
7475
  rename,
7476
- fetch,
7477
7476
  resolvePath,
7478
7477
  removeDir,
7479
7478
  removeDirSync,
@@ -7488,6 +7487,7 @@ const createSystem = (c) => {
7488
7487
  writeFile,
7489
7488
  writeFileSync,
7490
7489
  generateContentHash,
7490
+ generateFileHash,
7491
7491
  createWorkerController: null,
7492
7492
  details: {
7493
7493
  cpuModel: "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "5.0.0-beta.13",
3
+ "version": "5.0.0-beta.15",
4
4
  "description": "A Compiler for Web Components and Progressive Web Apps",
5
5
  "keywords": [
6
6
  "components",
@@ -126,9 +126,9 @@
126
126
  "terser": "^5.50.0",
127
127
  "tinyglobby": "^0.2.17",
128
128
  "typescript": ">5.0.0 <7.0.0",
129
- "@stencil/cli": "5.0.0-beta.13",
130
- "@stencil/dev-server": "5.0.0-beta.13",
131
- "@stencil/mock-doc": "5.0.0-beta.13"
129
+ "@stencil/mock-doc": "5.0.0-beta.15",
130
+ "@stencil/cli": "5.0.0-beta.15",
131
+ "@stencil/dev-server": "5.0.0-beta.15"
132
132
  },
133
133
  "devDependencies": {
134
134
  "@ionic/prettier-config": "^4.0.0",