@stencil/core 2.8.0 → 2.10.0

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 (72) hide show
  1. package/cli/index.cjs +234 -209
  2. package/cli/index.js +234 -209
  3. package/cli/package.json +1 -1
  4. package/compiler/lib.dom.d.ts +263 -648
  5. package/compiler/lib.dom.iterable.d.ts +1 -5
  6. package/compiler/lib.es2015.core.d.ts +2 -2
  7. package/compiler/lib.es2015.iterable.d.ts +1 -1
  8. package/compiler/lib.es2015.symbol.wellknown.d.ts +10 -10
  9. package/compiler/lib.es2018.asynciterable.d.ts +1 -1
  10. package/compiler/lib.es2020.bigint.d.ts +1 -1
  11. package/compiler/lib.es2020.intl.d.ts +6 -7
  12. package/compiler/lib.es2020.symbol.wellknown.d.ts +1 -1
  13. package/compiler/lib.es2021.d.ts +24 -0
  14. package/compiler/lib.es2021.full.d.ts +25 -0
  15. package/compiler/lib.es2021.promise.d.ts +43 -0
  16. package/compiler/lib.es2021.string.d.ts +35 -0
  17. package/compiler/lib.es2021.weakref.d.ts +75 -0
  18. package/compiler/lib.es5.d.ts +9 -9
  19. package/compiler/lib.esnext.d.ts +1 -4
  20. package/compiler/lib.esnext.promise.d.ts +26 -26
  21. package/compiler/lib.esnext.string.d.ts +18 -18
  22. package/compiler/lib.esnext.weakref.d.ts +58 -58
  23. package/compiler/lib.webworker.d.ts +98 -153
  24. package/compiler/lib.webworker.iterable.d.ts +1 -1
  25. package/compiler/package.json +1 -1
  26. package/compiler/stencil.js +923 -234
  27. package/compiler/stencil.min.js +2 -2
  28. package/dependencies.json +6 -1
  29. package/dev-server/client/index.js +1 -1
  30. package/dev-server/client/package.json +1 -1
  31. package/dev-server/connector.html +2 -2
  32. package/dev-server/index.js +1 -1
  33. package/dev-server/package.json +1 -1
  34. package/dev-server/server-process.js +2 -2
  35. package/internal/app-data/index.cjs +1 -0
  36. package/internal/app-data/index.js +1 -0
  37. package/internal/app-data/package.json +1 -1
  38. package/internal/client/css-shim.js +1 -1
  39. package/internal/client/dom.js +1 -1
  40. package/internal/client/index.js +188 -99
  41. package/internal/client/package.json +1 -1
  42. package/internal/client/patch-browser.js +1 -1
  43. package/internal/client/patch-esm.js +1 -1
  44. package/internal/client/shadow-css.js +1 -1
  45. package/internal/hydrate/index.js +64 -39
  46. package/internal/hydrate/package.json +1 -1
  47. package/internal/index.js +1 -0
  48. package/internal/package.json +1 -1
  49. package/internal/stencil-private.d.ts +130 -6
  50. package/internal/stencil-public-compiler.d.ts +20 -2
  51. package/internal/testing/index.js +78 -50
  52. package/internal/testing/package.json +1 -1
  53. package/mock-doc/index.cjs +4 -1
  54. package/mock-doc/index.d.ts +7 -6
  55. package/mock-doc/index.js +4 -1
  56. package/mock-doc/package.json +1 -1
  57. package/package.json +11 -5
  58. package/readme.md +2 -2
  59. package/screenshot/index.js +1 -1
  60. package/screenshot/package.json +1 -1
  61. package/sys/node/index.js +4435 -425
  62. package/sys/node/package.json +1 -1
  63. package/sys/node/worker.js +1 -1
  64. package/testing/index.js +24 -19
  65. package/testing/mocks.d.ts +1 -5
  66. package/testing/package.json +1 -1
  67. package/testing/testing-sys.d.ts +6 -1
  68. package/bin/cli.ts +0 -20
  69. package/screenshot/index.js.map +0 -1
  70. package/sys/deno/index.js +0 -1791
  71. package/sys/deno/node-compat.js +0 -2654
  72. package/sys/deno/worker.js +0 -44
@@ -1,5 +1,15 @@
1
- import type { BuildEvents, BuildLog, BuildOutput, CompilerBuildResults, CompilerBuildStart, CompilerFsStats, CompilerRequestResponse, CompilerSystem, Config, CopyResults, DevServerConfig, DevServerEditor, Diagnostic, FsWriteOptions, Logger, LoggerTimeSpan, OptimizeCssInput, OptimizeCssOutput, OutputTargetWww, PageReloadStrategy, PrerenderConfig, StyleDoc, LoggerLineUpdater } from './stencil-public-compiler';
1
+ import { BuildResultsComponentGraph } from '.';
2
+ import type { BuildEvents, BuildLog, BuildOutput, CompilerBuildResults, CompilerBuildStart, CompilerFsStats, CompilerRequestResponse, CompilerSystem, Config, CopyResults, DevServerConfig, DevServerEditor, Diagnostic, FsWriteOptions, Logger, LoggerTimeSpan, OptimizeCssInput, OptimizeCssOutput, OutputTargetWww, PageReloadStrategy, PrerenderConfig, StyleDoc, LoggerLineUpdater, TaskCommand } from './stencil-public-compiler';
2
3
  import type { ComponentInterface, ListenOptions, ListenTargetOptions, VNode, VNodeData } from './stencil-public-runtime';
4
+ export interface SourceMap {
5
+ file: string;
6
+ mappings: string;
7
+ names: string[];
8
+ sourceRoot?: string;
9
+ sources: string[];
10
+ sourcesContent?: string[];
11
+ version: number;
12
+ }
3
13
  export interface PrintLine {
4
14
  lineIndex: number;
5
15
  lineNumber: number;
@@ -109,6 +119,7 @@ export interface BuildConditionals extends Partial<BuildFeatures> {
109
119
  constructableCSS?: boolean;
110
120
  appendChildSlotFix?: boolean;
111
121
  slotChildNodesFix?: boolean;
122
+ scopedSlotTextContentFix?: boolean;
112
123
  cloneNodeFix?: boolean;
113
124
  dynamicImportShim?: boolean;
114
125
  hydratedAttribute?: boolean;
@@ -128,13 +139,25 @@ export interface RollupResultModule {
128
139
  export interface RollupResults {
129
140
  modules: RollupResultModule[];
130
141
  }
142
+ export interface UpdatedLazyBuildCtx {
143
+ name: 'esm-browser' | 'esm' | 'cjs' | 'system';
144
+ buildCtx: BuildCtx;
145
+ }
131
146
  export interface BuildCtx {
132
147
  buildId: number;
133
148
  buildResults: CompilerBuildResults;
149
+ buildStats?: CompilerBuildStats | {
150
+ diagnostics: Diagnostic[];
151
+ };
134
152
  buildMessages: string[];
135
153
  bundleBuildCount: number;
136
154
  collections: Collection[];
137
155
  compilerCtx: CompilerCtx;
156
+ esmBrowserComponentBundle: ReadonlyArray<BundleModule>;
157
+ esmComponentBundle: ReadonlyArray<BundleModule>;
158
+ es5ComponentBundle: ReadonlyArray<BundleModule>;
159
+ systemComponentBundle: ReadonlyArray<BundleModule>;
160
+ commonJsComponentBundle: ReadonlyArray<BundleModule>;
138
161
  components: ComponentCompilerMeta[];
139
162
  componentGraph: Map<string, string[]>;
140
163
  config: Config;
@@ -190,7 +213,8 @@ export interface BuildStyleUpdate {
190
213
  }
191
214
  export declare type BuildTask = any;
192
215
  export declare type BuildStatus = 'pending' | 'error' | 'disabled' | 'default';
193
- export interface BuildStats {
216
+ export interface CompilerBuildStats {
217
+ timestamp: string;
194
218
  compiler: {
195
219
  name: string;
196
220
  version: string;
@@ -201,24 +225,41 @@ export interface BuildStats {
201
225
  components: number;
202
226
  entries: number;
203
227
  bundles: number;
228
+ outputs: any;
204
229
  };
205
230
  options: {
206
231
  minifyJs: boolean;
207
232
  minifyCss: boolean;
208
233
  hashFileNames: boolean;
209
234
  hashedFileNameLength: number;
210
- buildEs5: boolean;
235
+ buildEs5: boolean | 'prod';
236
+ };
237
+ formats: {
238
+ esmBrowser: ReadonlyArray<CompilerBuildStatBundle>;
239
+ esm: ReadonlyArray<CompilerBuildStatBundle>;
240
+ es5: ReadonlyArray<CompilerBuildStatBundle>;
241
+ system: ReadonlyArray<CompilerBuildStatBundle>;
242
+ commonjs: ReadonlyArray<CompilerBuildStatBundle>;
211
243
  };
212
244
  components: BuildComponent[];
213
- entries: BuildEntry[];
245
+ entries: EntryModule[];
214
246
  rollupResults: RollupResults;
215
- sourceGraph: BuildSourceGraph;
247
+ sourceGraph?: BuildSourceGraph;
248
+ componentGraph: BuildResultsComponentGraph;
216
249
  collections: {
217
250
  name: string;
218
251
  source: string;
219
252
  tags: string[];
220
253
  }[];
221
254
  }
255
+ export interface CompilerBuildStatBundle {
256
+ key: string;
257
+ components: string[];
258
+ bundleId: string;
259
+ fileName: string;
260
+ imports: string[];
261
+ originalByteSize: number;
262
+ }
222
263
  export interface BuildEntry {
223
264
  entryId: string;
224
265
  components: BuildComponent[];
@@ -266,6 +307,12 @@ export declare type SourceTarget = 'es5' | 'es2017' | 'latest';
266
307
  export interface BundleEntryInputs {
267
308
  [entryKey: string]: string;
268
309
  }
310
+ /**
311
+ * A note regarding Rollup types:
312
+ * As of this writing, there is no great way to import external types for packages that are directly embedded in the
313
+ * Stencil source. As a result, some types are duplicated here for Rollup that will be used within the codebase.
314
+ * Updates to rollup may require these typings to be updated.
315
+ */
269
316
  export declare type RollupResult = RollupChunkResult | RollupAssetResult;
270
317
  export interface RollupAssetResult {
271
318
  type: 'asset';
@@ -284,7 +331,26 @@ export interface RollupChunkResult {
284
331
  isBrowserLoader: boolean;
285
332
  imports: string[];
286
333
  moduleFormat: ModuleFormat;
334
+ map?: RollupSourceMap;
335
+ }
336
+ export interface RollupSourceMap {
337
+ file: string;
338
+ mappings: string;
339
+ names: string[];
340
+ sources: string[];
341
+ sourcesContent: string[];
342
+ version: number;
343
+ toString(): string;
344
+ toUrl(): string;
287
345
  }
346
+ /**
347
+ * Result of Stencil compressing, mangling, and otherwise 'minifying' JavaScript
348
+ */
349
+ export declare type OptimizeJsResult = {
350
+ output: string;
351
+ diagnostics: Diagnostic[];
352
+ sourceMap?: SourceMap;
353
+ };
288
354
  export interface BundleModule {
289
355
  entryKey: string;
290
356
  rollupResult: RollupChunkResult;
@@ -587,6 +653,7 @@ export interface ComponentCompilerMeta extends ComponentCompilerFeatures {
587
653
  isCollectionDependency: boolean;
588
654
  docs: CompilerJsDoc;
589
655
  jsFilePath: string;
656
+ sourceMapPath: string;
590
657
  listeners: ComponentCompilerListener[];
591
658
  events: ComponentCompilerEvent[];
592
659
  methods: ComponentCompilerMethod[];
@@ -1175,6 +1242,8 @@ export interface Module {
1175
1242
  sourceFilePath: string;
1176
1243
  staticSourceFile: any;
1177
1244
  staticSourceFileText: string;
1245
+ sourceMapPath: string;
1246
+ sourceMapFileText: string;
1178
1247
  hasVdomAttribute: boolean;
1179
1248
  hasVdomClass: boolean;
1180
1249
  hasVdomFunctional: boolean;
@@ -1264,7 +1333,7 @@ export interface RenderNode extends HostElement {
1264
1333
  ['s-cn']?: boolean;
1265
1334
  /**
1266
1335
  * Is a slot reference node:
1267
- * This is a node that represents where a slots
1336
+ * This is a node that represents where a slot
1268
1337
  * was originally located.
1269
1338
  */
1270
1339
  ['s-sr']?: boolean;
@@ -1368,6 +1437,9 @@ export interface ModeBundleIds {
1368
1437
  [modeName: string]: string;
1369
1438
  }
1370
1439
  export declare type RuntimeRef = HostElement | {};
1440
+ /**
1441
+ * Interface used to track an Element, it's virtual Node (`VNode`), and other data
1442
+ */
1371
1443
  export interface HostRef {
1372
1444
  $ancestorComponent$?: HostElement;
1373
1445
  $flags$: number;
@@ -2067,6 +2139,7 @@ export interface CompilerWorkerContext {
2067
2139
  prepareModule(input: string, minifyOpts: any, transpile: boolean, inlineHelpers: boolean): Promise<{
2068
2140
  output: string;
2069
2141
  diagnostics: Diagnostic[];
2142
+ sourceMap?: SourceMap;
2070
2143
  }>;
2071
2144
  prerenderWorker(prerenderRequest: PrerenderUrlRequest): Promise<PrerenderUrlResults>;
2072
2145
  transformCssToEsm(input: TransformCssToEsmInput): Promise<TransformCssToEsmOutput>;
@@ -2127,3 +2200,54 @@ export interface ValidateTypesResults {
2127
2200
  dirPaths: string[];
2128
2201
  filePaths: string[];
2129
2202
  }
2203
+ export interface TerminalInfo {
2204
+ /**
2205
+ * Whether this is in CI or not.
2206
+ */
2207
+ readonly ci: boolean;
2208
+ /**
2209
+ * Whether the terminal is an interactive TTY or not.
2210
+ */
2211
+ readonly tty: boolean;
2212
+ }
2213
+ /**
2214
+ * The task to run in order to collect the duration data point.
2215
+ */
2216
+ export declare type TelemetryCallback = (...args: any[]) => void | Promise<void>;
2217
+ /**
2218
+ * The model for the data that's tracked.
2219
+ */
2220
+ export interface TrackableData {
2221
+ yarn: boolean;
2222
+ component_count?: number;
2223
+ arguments: string[];
2224
+ targets: string[];
2225
+ task: TaskCommand;
2226
+ duration_ms: number;
2227
+ packages: string[];
2228
+ packages_no_versions?: string[];
2229
+ os_name: string;
2230
+ os_version: string;
2231
+ cpu_model: string;
2232
+ typescript: string;
2233
+ rollup: string;
2234
+ system: string;
2235
+ system_major?: string;
2236
+ build: string;
2237
+ stencil: string;
2238
+ has_app_pwa_config: boolean;
2239
+ }
2240
+ /**
2241
+ * Used as the object sent to the server. Value is the data tracked.
2242
+ */
2243
+ export interface Metric {
2244
+ name: string;
2245
+ timestamp: string;
2246
+ source: 'stencil_cli';
2247
+ value: TrackableData;
2248
+ session_id: string;
2249
+ }
2250
+ export interface TelemetryConfig {
2251
+ 'telemetry.stencil'?: boolean;
2252
+ 'tokens.telemetry'?: string;
2253
+ }
@@ -82,6 +82,10 @@ export interface StencilConfig {
82
82
  * However, either can be added using the plugin array.
83
83
  */
84
84
  plugins?: any[];
85
+ /**
86
+ * Generate js source map files for all bundles
87
+ */
88
+ sourceMap?: boolean;
85
89
  /**
86
90
  * The srcDir config specifies the directory which should contain the source typescript files
87
91
  * for each component. The standard for Stencil apps is to use src, which is the default.
@@ -264,6 +268,11 @@ export interface ConfigExtras {
264
268
  * for very special cases and rarely needed. Defaults to `false`.
265
269
  */
266
270
  scriptDataOpts?: boolean;
271
+ /**
272
+ * Experimental flag to align the behavior of invoking `textContent` on a scoped component to act more like a
273
+ * component that uses the shadow DOM. Defaults to `false`
274
+ */
275
+ scopedSlotTextContentFix?: boolean;
267
276
  /**
268
277
  * If enabled `true`, the runtime will check if the shadow dom shim is required. However,
269
278
  * if it's determined that shadow dom is already natively supported by the browser then
@@ -302,7 +311,6 @@ export interface Config extends StencilConfig {
302
311
  logLevel?: LogLevel;
303
312
  rootDir?: string;
304
313
  packageJsonFilePath?: string;
305
- sourceMap?: boolean;
306
314
  suppressLogs?: boolean;
307
315
  profile?: boolean;
308
316
  tsCompilerOptions?: any;
@@ -818,7 +826,7 @@ export interface SitemapXmpResults {
818
826
  * of the actual platform it's being ran ontop of.
819
827
  */
820
828
  export interface CompilerSystem {
821
- name: 'deno' | 'node' | 'in-memory';
829
+ name: 'node' | 'in-memory';
822
830
  version: string;
823
831
  events?: BuildEvents;
824
832
  details?: SystemDetails;
@@ -955,6 +963,10 @@ export interface CompilerSystem {
955
963
  */
956
964
  normalizePath(p: string): string;
957
965
  onProcessInterrupt?(cb: () => void): void;
966
+ parseYarnLockFile?: (content: string) => {
967
+ type: 'success' | 'merge' | 'conflict';
968
+ object: any;
969
+ };
958
970
  platformPath: PlatformPath;
959
971
  /**
960
972
  * All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
@@ -1745,6 +1757,12 @@ export interface OutputTargetDistCustomElements extends OutputTargetBaseNext {
1745
1757
  inlineDynamicImports?: boolean;
1746
1758
  includeGlobalScripts?: boolean;
1747
1759
  minify?: boolean;
1760
+ /**
1761
+ * Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
1762
+ * functionality allows consumers to bypass the explicit call to define a component, its children, its children's
1763
+ * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
1764
+ */
1765
+ autoDefineCustomElements?: boolean;
1748
1766
  }
1749
1767
  export interface OutputTargetDistCustomElementsBundle extends OutputTargetBaseNext {
1750
1768
  type: 'dist-custom-elements-bundle';
@@ -303,10 +303,10 @@ const createElm = (e, t, a, o) => {
303
303
  appData.BUILD.vdomText && null !== l ? appData.BUILD.vdomText && appData.BUILD.slotRelocation && (r = a["s-cr"]) ? r.parentNode.textContent = l : appData.BUILD.vdomText && e.$text$ !== l && (a.data = l) : (appData.BUILD.svg && (isSvgMode = "svg" === n || "foreignObject" !== n && isSvgMode),
304
304
  (appData.BUILD.vdomAttribute || appData.BUILD.reflect) && (appData.BUILD.slot && "slot" === n || updateElement(e, t, isSvgMode)),
305
305
  appData.BUILD.updatable && null !== o && null !== s ? ((e, t, a, o) => {
306
- let s, n, l = 0, r = 0, p = 0, i = 0, d = t.length - 1, c = t[0], $ = t[d], m = o.length - 1, u = o[0], D = o[m];
307
- for (;l <= d && r <= m; ) if (null == c) c = t[++l]; else if (null == $) $ = t[--d]; else if (null == u) u = o[++r]; else if (null == D) D = o[--m]; else if (isSameVnode(c, u)) patch(c, u),
308
- c = t[++l], u = o[++r]; else if (isSameVnode($, D)) patch($, D), $ = t[--d], D = o[--m]; else if (isSameVnode(c, D)) !appData.BUILD.slotRelocation || "slot" !== c.$tag$ && "slot" !== D.$tag$ || putBackInOriginalLocation(c.$elm$.parentNode, !1),
309
- patch(c, D), e.insertBefore(c.$elm$, $.$elm$.nextSibling), c = t[++l], D = o[--m]; else if (isSameVnode($, u)) !appData.BUILD.slotRelocation || "slot" !== c.$tag$ && "slot" !== D.$tag$ || putBackInOriginalLocation($.$elm$.parentNode, !1),
306
+ let s, n, l = 0, r = 0, p = 0, i = 0, d = t.length - 1, c = t[0], $ = t[d], m = o.length - 1, u = o[0], h = o[m];
307
+ for (;l <= d && r <= m; ) if (null == c) c = t[++l]; else if (null == $) $ = t[--d]; else if (null == u) u = o[++r]; else if (null == h) h = o[--m]; else if (isSameVnode(c, u)) patch(c, u),
308
+ c = t[++l], u = o[++r]; else if (isSameVnode($, h)) patch($, h), $ = t[--d], h = o[--m]; else if (isSameVnode(c, h)) !appData.BUILD.slotRelocation || "slot" !== c.$tag$ && "slot" !== h.$tag$ || putBackInOriginalLocation(c.$elm$.parentNode, !1),
309
+ patch(c, h), e.insertBefore(c.$elm$, $.$elm$.nextSibling), c = t[++l], h = o[--m]; else if (isSameVnode($, u)) !appData.BUILD.slotRelocation || "slot" !== c.$tag$ && "slot" !== h.$tag$ || putBackInOriginalLocation($.$elm$.parentNode, !1),
310
310
  patch($, u), e.insertBefore($.$elm$, c.$elm$), $ = t[--d], u = o[++r]; else {
311
311
  if (p = -1, appData.BUILD.vdomKey) for (i = l; i <= d; ++i) if (t[i] && null !== t[i].$key$ && t[i].$key$ === u.$key$) {
312
312
  p = i;
@@ -582,7 +582,8 @@ const callRender = (e, t, a) => {
582
582
  s.attributeChangedCallback = function(e, t, o) {
583
583
  plt.jmp((() => {
584
584
  const t = a.get(e);
585
- this.hasOwnProperty(t) && (o = this[t], delete this[t]), this[t] = (null !== o || "boolean" != typeof this[t]) && o;
585
+ if (this.hasOwnProperty(t)) o = this[t], delete this[t]; else if (s.hasOwnProperty(t) && "number" == typeof this[t] && this[t] == o) return;
586
+ this[t] = (null !== o || "boolean" != typeof this[t]) && o;
586
587
  }));
587
588
  }, e.observedAttributes = o.filter((([e, t]) => 15 & t[0])).map((([e, o]) => {
588
589
  const s = o[1] || e;
@@ -704,6 +705,14 @@ const callRender = (e, t, a) => {
704
705
  },
705
706
  disconnectedCallback() {
706
707
  disconnectedCallback(this), appData.BUILD.disconnectedCallback && s && s.call(this);
708
+ },
709
+ __attachShadow() {
710
+ exports.supportsShadow ? appData.BUILD.shadowDelegatesFocus ? this.attachShadow({
711
+ mode: "open",
712
+ delegatesFocus: !!(16 & a.$flags$)
713
+ }) : this.attachShadow({
714
+ mode: "open"
715
+ }) : this.shadowRoot = this;
707
716
  }
708
717
  }), e.is = a.$tagName$, proxyComponent(e, a, 3);
709
718
  }, patchCloneNode = e => {
@@ -727,6 +736,26 @@ const callRender = (e, t, a) => {
727
736
  }
728
737
  return this.__appendChild(e);
729
738
  };
739
+ }, patchTextContent = (e, t) => {
740
+ if (appData.BUILD.scoped && 2 & t.$flags$) {
741
+ const t = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
742
+ Object.defineProperty(e, "__textContent", t), Object.defineProperty(e, "textContent", {
743
+ get() {
744
+ var e;
745
+ const t = getHostSlotNode(this.childNodes, "");
746
+ return 3 === (null === (e = null == t ? void 0 : t.nextSibling) || void 0 === e ? void 0 : e.nodeType) ? t.nextSibling.textContent : t ? t.textContent : this.__textContent;
747
+ },
748
+ set(e) {
749
+ var t;
750
+ const a = getHostSlotNode(this.childNodes, "");
751
+ if (3 === (null === (t = null == a ? void 0 : a.nextSibling) || void 0 === t ? void 0 : t.nodeType)) a.nextSibling.textContent = e; else if (a) a.textContent = e; else {
752
+ this.__textContent = e;
753
+ const t = this["s-cr"];
754
+ t && this.insertBefore(t, this.firstChild);
755
+ }
756
+ }
757
+ });
758
+ }
730
759
  }, patchChildSlotNodes = (e, t) => {
731
760
  class a extends Array {
732
761
  item(e) {
@@ -845,11 +874,7 @@ Object.defineProperty(exports, "Env", {
845
874
  isServer: !0,
846
875
  isTesting: !0
847
876
  }, exports.Context = Context, exports.Fragment = (e, t) => t, exports.Host = Host,
848
- exports.addHostEventListeners = addHostEventListeners, exports.attachShadow = e => {
849
- exports.supportsShadow ? e.attachShadow({
850
- mode: "open"
851
- }) : e.shadowRoot = e;
852
- }, exports.bootstrapLazy = (e, t = {}) => {
877
+ exports.addHostEventListeners = addHostEventListeners, exports.bootstrapLazy = (e, t = {}) => {
853
878
  appData.BUILD.profile && performance.mark && performance.mark("st:app:start"), (() => {
854
879
  if (appData.BUILD.devTools) {
855
880
  const e = win.stencil = win.stencil || {}, t = e.inspect;
@@ -902,46 +927,49 @@ exports.addHostEventListeners = addHostEventListeners, exports.attachShadow = e
902
927
  if (Object.assign(plt, t), plt.$resourcesUrl$ = new URL(t.resourcesUrl || "./", doc.baseURI).href,
903
928
  appData.BUILD.asyncQueue && t.syncQueue && (plt.$flags$ |= 4), appData.BUILD.hydrateClientSide && (plt.$flags$ |= 2),
904
929
  appData.BUILD.hydrateClientSide && appData.BUILD.shadowDom) for (;m < d.length; m++) registerStyle(d[m].getAttribute("sty-id"), d[m].innerHTML.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{"));
905
- e.map((e => e[1].map((a => {
906
- const l = {
907
- $flags$: a[0],
908
- $tagName$: a[1],
909
- $members$: a[2],
910
- $listeners$: a[3]
911
- };
912
- appData.BUILD.member && (l.$members$ = a[2]), appData.BUILD.hostListener && (l.$listeners$ = a[3]),
913
- appData.BUILD.reflect && (l.$attrsToReflect$ = []), appData.BUILD.watchCallback && (l.$watchers$ = {}),
914
- appData.BUILD.shadowDom && !exports.supportsShadow && 1 & l.$flags$ && (l.$flags$ |= 8);
915
- const r = appData.BUILD.transformTagName && t.transformTagName ? t.transformTagName(l.$tagName$) : l.$tagName$, p = class extends HTMLElement {
916
- constructor(e) {
917
- super(e), registerHost(e = this, l), appData.BUILD.shadowDom && 1 & l.$flags$ && (exports.supportsShadow ? appData.BUILD.shadowDelegatesFocus ? e.attachShadow({
918
- mode: "open",
919
- delegatesFocus: !!(16 & l.$flags$)
920
- }) : e.attachShadow({
921
- mode: "open"
922
- }) : appData.BUILD.hydrateServerSide || "shadowRoot" in e || (e.shadowRoot = e)),
923
- appData.BUILD.slotChildNodesFix && patchChildSlotNodes(e, l);
924
- }
925
- connectedCallback() {
926
- c && (clearTimeout(c), c = null), $ ? i.push(this) : plt.jmp((() => connectedCallback(this)));
927
- }
928
- disconnectedCallback() {
929
- plt.jmp((() => disconnectedCallback(this)));
930
- }
931
- componentOnReady() {
932
- return getHostRef(this).$onReadyPromise$;
933
- }
934
- };
935
- appData.BUILD.cloneNodeFix && patchCloneNode(p.prototype), appData.BUILD.appendChildSlotFix && patchSlotAppendChild(p.prototype),
936
- appData.BUILD.hotModuleReplacement && (p.prototype["s-hmr"] = function(e) {
937
- ((e, t, a) => {
938
- const o = getHostRef(e);
939
- o.$flags$ = 1, e["s-hmr-load"] = () => {
940
- delete e["s-hmr-load"];
941
- }, initializeComponent(e, o, t);
942
- })(this, l);
943
- }), l.$lazyBundleId$ = e[0], s.includes(r) || n.get(r) || (o.push(r), n.define(r, proxyComponent(p, l, 1)));
944
- })))), appData.BUILD.invisiblePrehydration && (appData.BUILD.hydratedClass || appData.BUILD.hydratedAttribute) && (p.innerHTML = o + "{visibility:hidden}.hydrated{visibility:inherit}",
930
+ e.map((e => {
931
+ e[1].map((a => {
932
+ const l = {
933
+ $flags$: a[0],
934
+ $tagName$: a[1],
935
+ $members$: a[2],
936
+ $listeners$: a[3]
937
+ };
938
+ appData.BUILD.member && (l.$members$ = a[2]), appData.BUILD.hostListener && (l.$listeners$ = a[3]),
939
+ appData.BUILD.reflect && (l.$attrsToReflect$ = []), appData.BUILD.watchCallback && (l.$watchers$ = {}),
940
+ appData.BUILD.shadowDom && !exports.supportsShadow && 1 & l.$flags$ && (l.$flags$ |= 8);
941
+ const r = appData.BUILD.transformTagName && t.transformTagName ? t.transformTagName(l.$tagName$) : l.$tagName$, p = class extends HTMLElement {
942
+ constructor(e) {
943
+ super(e), registerHost(e = this, l), appData.BUILD.shadowDom && 1 & l.$flags$ && (exports.supportsShadow ? appData.BUILD.shadowDelegatesFocus ? e.attachShadow({
944
+ mode: "open",
945
+ delegatesFocus: !!(16 & l.$flags$)
946
+ }) : e.attachShadow({
947
+ mode: "open"
948
+ }) : appData.BUILD.hydrateServerSide || "shadowRoot" in e || (e.shadowRoot = e)),
949
+ appData.BUILD.slotChildNodesFix && patchChildSlotNodes(e, l);
950
+ }
951
+ connectedCallback() {
952
+ c && (clearTimeout(c), c = null), $ ? i.push(this) : plt.jmp((() => connectedCallback(this)));
953
+ }
954
+ disconnectedCallback() {
955
+ plt.jmp((() => disconnectedCallback(this)));
956
+ }
957
+ componentOnReady() {
958
+ return getHostRef(this).$onReadyPromise$;
959
+ }
960
+ };
961
+ appData.BUILD.cloneNodeFix && patchCloneNode(p.prototype), appData.BUILD.appendChildSlotFix && patchSlotAppendChild(p.prototype),
962
+ appData.BUILD.hotModuleReplacement && (p.prototype["s-hmr"] = function(e) {
963
+ ((e, t, a) => {
964
+ const o = getHostRef(e);
965
+ o.$flags$ = 1, e["s-hmr-load"] = () => {
966
+ delete e["s-hmr-load"];
967
+ }, initializeComponent(e, o, t);
968
+ })(this, l);
969
+ }), appData.BUILD.scopedSlotTextContentFix && patchTextContent(p.prototype, l),
970
+ l.$lazyBundleId$ = e[0], s.includes(r) || n.get(r) || (o.push(r), n.define(r, proxyComponent(p, l, 1)));
971
+ }));
972
+ })), appData.BUILD.invisiblePrehydration && (appData.BUILD.hydratedClass || appData.BUILD.hydratedAttribute) && (p.innerHTML = o + "{visibility:hidden}.hydrated{visibility:inherit}",
945
973
  p.setAttribute("data-styles", ""), l.insertBefore(p, r ? r.nextSibling : l.firstChild)),
946
974
  $ = !1, i.length ? i.map((e => e.connectedCallback())) : appData.BUILD.profile ? plt.jmp((() => c = setTimeout(appDidLoad, 30, "timeout"))) : plt.jmp((() => c = setTimeout(appDidLoad, 30))),
947
975
  a();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "2.8.0",
3
+ "version": "2.10.0",
4
4
  "description": "Stencil internal testing platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc (CommonJS) v2.8.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc (CommonJS) v2.10.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var mockDoc = (function(exports) {
5
5
  'use strict';
@@ -2566,6 +2566,9 @@ class MockAnchorElement extends MockHTMLElement {
2566
2566
  set href(value) {
2567
2567
  this.setAttribute('href', value);
2568
2568
  }
2569
+ get pathname() {
2570
+ return new URL(this.href).pathname;
2571
+ }
2569
2572
  }
2570
2573
  class MockButtonElement extends MockHTMLElement {
2571
2574
  constructor(ownerDocument) {
@@ -166,6 +166,7 @@ declare class MockAnchorElement extends MockHTMLElement {
166
166
  constructor(ownerDocument: any);
167
167
  get href(): string;
168
168
  set href(value: string);
169
+ get pathname(): string;
169
170
  }
170
171
  declare class MockButtonElement extends MockHTMLElement {
171
172
  constructor(ownerDocument: any);
@@ -399,17 +400,17 @@ declare class MockNode {
399
400
  prepend(...items: (MockNode | string)[]): void;
400
401
  cloneNode(deep?: boolean): MockNode;
401
402
  compareDocumentPosition(_other: MockNode): number;
402
- get firstChild(): MockNode;
403
+ get firstChild(): MockNode | null;
403
404
  insertBefore(newNode: MockNode, referenceNode: MockNode): MockNode;
404
405
  get isConnected(): boolean;
405
406
  isSameNode(node: any): boolean;
406
- get lastChild(): MockNode;
407
- get nextSibling(): MockNode;
407
+ get lastChild(): MockNode | null;
408
+ get nextSibling(): MockNode | null;
408
409
  get nodeValue(): string;
409
410
  set nodeValue(value: string);
410
411
  get parentElement(): any;
411
412
  set parentElement(value: any);
412
- get previousSibling(): MockNode;
413
+ get previousSibling(): MockNode | null;
413
414
  contains(otherNode: MockNode): boolean;
414
415
  removeChild(childNode: MockNode): MockNode;
415
416
  remove(): void;
@@ -451,7 +452,7 @@ declare class MockElement extends MockNode {
451
452
  get dir(): string;
452
453
  set dir(value: string);
453
454
  dispatchEvent(ev: MockEvent): boolean;
454
- get firstElementChild(): MockElement;
455
+ get firstElementChild(): MockElement | null;
455
456
  getAttribute(attrName: string): any;
456
457
  getAttributeNS(namespaceURI: string, attrName: string): string;
457
458
  getBoundingClientRect(): {
@@ -486,7 +487,7 @@ declare class MockElement extends MockNode {
486
487
  set hidden(isHidden: boolean);
487
488
  get lang(): string;
488
489
  set lang(value: string);
489
- get lastElementChild(): MockElement;
490
+ get lastElementChild(): MockElement | null;
490
491
  matches(selector: string): boolean;
491
492
  get nextElementSibling(): any;
492
493
  get outerHTML(): string;
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v2.8.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v2.10.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  const CONTENT_REF_ID = 'r';
5
5
  const ORG_LOCATION_ID = 'o';
@@ -2563,6 +2563,9 @@ class MockAnchorElement extends MockHTMLElement {
2563
2563
  set href(value) {
2564
2564
  this.setAttribute('href', value);
2565
2565
  }
2566
+ get pathname() {
2567
+ return new URL(this.href).pathname;
2568
+ }
2566
2569
  }
2567
2570
  class MockButtonElement extends MockHTMLElement {
2568
2571
  constructor(ownerDocument) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "2.8.0",
3
+ "version": "2.10.0",
4
4
  "description": "Mock window, document and DOM outside of a browser environment.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "2.8.0",
3
+ "version": "2.10.0",
4
4
  "license": "MIT",
5
5
  "main": "./internal/stencil-core/index.cjs",
6
6
  "module": "./internal/stencil-core/index.js",
@@ -9,6 +9,7 @@
9
9
  "stencil": "bin/stencil"
10
10
  },
11
11
  "files": [
12
+ "!**/*.map",
12
13
  "bin/",
13
14
  "cli/",
14
15
  "compiler/",
@@ -21,9 +22,10 @@
21
22
  "testing/"
22
23
  ],
23
24
  "scripts": {
25
+ "clean": "rm -rf build/ cli/ compiler/ dev-server/ internal/ mock-doc/ sys/ testing/ && npm run clean-scripts",
26
+ "clean-scripts": "rm -rf scripts/build",
24
27
  "start": "npm run watch",
25
- "build": "node scripts && npm run tsc.prod && npm run rollup.prod.ci",
26
- "build.prod": "node scripts && npm run tsc.scripts && npm run tsc.prod && npm run rollup.prod.ci",
28
+ "build": "node scripts --prepare && npm run tsc.prod && npm run rollup.prod.ci",
27
29
  "watch": "node scripts && npm run tsc && concurrently \"npm run rollup.watch\" \"npm run tsc.watch\"",
28
30
  "release": "node scripts --release --publish",
29
31
  "release.prepare": "node scripts --release --prepare",
@@ -79,6 +81,8 @@
79
81
  "@types/sizzle": "^2.3.2",
80
82
  "@types/webpack": "^4.41.26",
81
83
  "@types/ws": "^7.4.0",
84
+ "@types/yarnpkg__lockfile": "^1.1.5",
85
+ "@yarnpkg/lockfile": "^1.1.0",
82
86
  "ansi-colors": "4.1.1",
83
87
  "autoprefixer": "10.2.5",
84
88
  "concurrently": "^6.0.0",
@@ -99,6 +103,7 @@
99
103
  "jest-environment-node": "^26.6.2",
100
104
  "listr": "^0.14.3",
101
105
  "magic-string": "^0.25.7",
106
+ "merge-source-map": "^1.1.0",
102
107
  "mime-db": "^1.46.0",
103
108
  "minimatch": "3.0.4",
104
109
  "node-fetch": "2.6.1",
@@ -108,16 +113,17 @@
108
113
  "path-browserify": "^1.0.1",
109
114
  "pixelmatch": "4.0.2",
110
115
  "postcss": "^8.2.8",
111
- "prettier": "2.3.2",
116
+ "prettier": "2.4.0",
112
117
  "prompts": "2.4.0",
113
118
  "puppeteer": "~10.0.0",
114
119
  "rollup": "2.42.3",
120
+ "rollup-plugin-sourcemaps": "^0.6.3",
115
121
  "semiver": "^1.1.0",
116
122
  "semver": "7.3.4",
117
123
  "sizzle": "^2.3.6",
118
124
  "terser": "5.6.1",
119
125
  "tslib": "^2.1.0",
120
- "typescript": "4.2.3",
126
+ "typescript": "4.3.5",
121
127
  "webpack": "^4.46.0",
122
128
  "ws": "7.4.6"
123
129
  },
package/readme.md CHANGED
@@ -123,13 +123,13 @@ Stencil is a tool developers use to create Web Components with some powerful fea
123
123
 
124
124
  ## License
125
125
 
126
- - [MIT](https://raw.githubusercontent.com/ionic-team/stencil/master/LICENSE.md)
126
+ - [MIT](https://raw.githubusercontent.com/ionic-team/stencil/main/LICENSE.md)
127
127
 
128
128
 
129
129
  [npm-badge]: https://img.shields.io/npm/v/@stencil/core.svg
130
130
  [npm-badge-url]: https://www.npmjs.com/package/@stencil/core
131
131
  [npm-license]: https://img.shields.io/npm/l/@stencil/core.svg
132
- [npm-license-url]: https://github.com/ionic-team/stencil/blob/master/LICENSE
132
+ [npm-license-url]: https://github.com/ionic-team/stencil/blob/main/LICENSE
133
133
  [circle-badge]: https://circleci.com/gh/ionic-team/stencil.svg?style=shield
134
134
  [circle-badge-url]: https://circleci.com/gh/ionic-team/stencil
135
135
  [browserstack-badge]: https://www.browserstack.com/automate/badge.svg?badge_key=WVNVbkRJdDBJQnBEMzZuWUdlMEZuTjlPUm9sOHZsSVNkUlJTRkJVQkx0ST0tLTFhbk5jRUNEVWxJL1J0SVR0WUFndnc9PQ==--90c84981a2ed2ede760ca48fbfc3fdd5b71d3e5e