@stencil/core 5.0.0-alpha.28 → 5.0.0-alpha.29

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 (44) hide show
  1. package/dist/app-data/index.d.ts +1 -1
  2. package/dist/{client-CvcvHKz4.mjs → client-D1MsT-Rp.mjs} +373 -238
  3. package/dist/compiler/index.d.mts +2 -3
  4. package/dist/compiler/index.mjs +3 -3
  5. package/dist/compiler/utils/index.d.mts +272 -2
  6. package/dist/compiler/utils/index.mjs +4 -3
  7. package/dist/{compiler-BEGofLCO.mjs → compiler-BbS9TDF_.mjs} +1804 -1085
  8. package/dist/declarations/stencil-ext-modules.d.ts +5 -5
  9. package/dist/declarations/stencil-public-compiler.d.ts +108 -40
  10. package/dist/declarations/stencil-public-docs.d.ts +9 -0
  11. package/dist/declarations/stencil-public-runtime.d.ts +81 -6
  12. package/dist/fragment-Di1hWOC8.mjs +4 -0
  13. package/dist/{index-F3IidHM1.d.mts → index-BHj3EBl2.d.mts} +395 -312
  14. package/dist/{index-xAkMgLX_.d.ts → index-D2PAsXxx.d.ts} +133 -9
  15. package/dist/index-VK8okIiF.d.mts +108 -0
  16. package/dist/index.d.mts +4 -0
  17. package/dist/index.mjs +91 -2
  18. package/dist/jsx-runtime.mjs +2 -1
  19. package/dist/{node-BlgRcMMi.mjs → node-BQR4L-TG.mjs} +9 -7
  20. package/dist/reactive-controller-BdCpSAQP.d.mts +13 -0
  21. package/dist/{regular-expression-CFVJOTUh.mjs → regular-expression-XqU5zmPp.mjs} +20 -3
  22. package/dist/{chunk-z9aeyW2b.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
  23. package/dist/runtime/client/lazy.js +411 -165
  24. package/dist/runtime/client/runtime.d.ts +136 -9
  25. package/dist/runtime/client/runtime.js +411 -165
  26. package/dist/runtime/index.d.ts +5 -3
  27. package/dist/runtime/index.js +410 -163
  28. package/dist/runtime/server/index.d.mts +80 -8
  29. package/dist/runtime/server/index.mjs +333 -158
  30. package/dist/runtime/server/runner.d.mts +3 -0
  31. package/dist/runtime/server/runner.mjs +232 -308
  32. package/dist/signals/index.d.ts +2 -0
  33. package/dist/sys/node/index.d.mts +1 -2
  34. package/dist/sys/node/index.mjs +1 -1
  35. package/dist/sys/node/worker.d.mts +1 -1
  36. package/dist/sys/node/worker.mjs +6 -3
  37. package/dist/testing/index.d.mts +4 -9
  38. package/dist/testing/index.mjs +64 -46
  39. package/dist/util-BIa-iHnt.mjs +724 -0
  40. package/dist/validation-Dd3g77T5.mjs +778 -0
  41. package/package.json +27 -27
  42. package/dist/index-3fu7WQs4.d.mts +0 -205
  43. package/dist/validation-CtaOJgnM.mjs +0 -1458
  44. /package/{LICENSE.md → LICENSE} +0 -0
@@ -1,4 +1,6 @@
1
1
  import { ReadonlySignal, ReadonlySignal as ReadonlySignal$1, Signal, batch, computed, effect, signal, untracked } from "@preact/signals-core";
2
+ import "rolldown";
3
+ import "typescript";
2
4
  //#region src/runtime/signals.d.ts
3
5
  declare const STENCIL_SIGNALS_SYMBOL: unique symbol;
4
6
  //#endregion
@@ -1,5 +1,4 @@
1
- import { ti as Logger, yr as CompilerSystem } from "../../index-F3IidHM1.mjs";
2
-
1
+ import { ni as Logger, yr as CompilerSystem } from "../../index-BHj3EBl2.mjs";
3
2
  //#region src/sys/node/logger/index.d.ts
4
3
  /**
5
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-BlgRcMMi.mjs";
1
+ import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-BQR4L-TG.mjs";
2
2
  export { createNodeLogger, createNodeSys, setupNodeProcess };
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1,5 +1,5 @@
1
- import { l as createWorkerMessageHandler } from "../../compiler-BEGofLCO.mjs";
2
- import { t as createNodeSys } from "../../node-BlgRcMMi.mjs";
1
+ import { l as createWorkerMessageHandler } from "../../compiler-BbS9TDF_.mjs";
2
+ import { t as createNodeSys } from "../../node-BQR4L-TG.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
@@ -42,7 +42,10 @@ const initNodeWorkerThread = (process, msgHandler) => {
42
42
  errorHandler(-1, e);
43
43
  });
44
44
  };
45
- const msgHandler = createWorkerMessageHandler(createNodeSys({ process }));
45
+ //#endregion
46
+ //#region src/sys/node/worker.ts
47
+ const nodeSys = createNodeSys({ process });
48
+ const msgHandler = createWorkerMessageHandler(nodeSys);
46
49
  initNodeWorkerThread(process, msgHandler);
47
50
  //#endregion
48
51
  export {};
@@ -1,7 +1,7 @@
1
- import { Ar as Config, B as ComponentCompilerMeta, Dt as HostRef, E as CompilerCtx, Et as HostElement, Nt as Module, Qn as Compiler, Qr as LoadConfigInit, Rt as NewSpecPageOptions, Vr as Diagnostic, a as BuildCtx, aa as UnvalidatedConfig, cn as RuntimeRef, da as ErrorHandler, ei as LogLevel, ga as UserBuildConditionals, mt as ComponentRuntimeMeta, oa as ValidatedConfig, pa as RafCallback, pn as SpecPage, ri as LoggerTimeSpan, ti as Logger, yr as CompilerSystem } from "../index-F3IidHM1.mjs";
2
- import { a as h, b as Env, d as getMode, g as getElement, h as createEvent, i as Host, m as Fragment, o as forceUpdate, p as Mixin, s as getRenderingRef, v as getAssetPath, y as setAssetPath } from "../index-3fu7WQs4.mjs";
1
+ import { $r as LoadConfigInit, Ar as Config, B as ComponentCompilerMeta, Dt as HostRef, E as CompilerCtx, Et as HostElement, Nt as Module, Qn as Compiler, Rt as NewSpecPageOptions, Sa as UserBuildConditionals, Vr as Diagnostic, a as BuildCtx, ca as UnvalidatedConfig, cn as RuntimeRef, ha as ErrorHandler, ii as LoggerTimeSpan, la as ValidatedConfig, mt as ComponentRuntimeMeta, ni as Logger, pn as SpecPage, ti as LogLevel, va as RafCallback, yr as CompilerSystem } from "../index-BHj3EBl2.mjs";
2
+ import { _ as Env, a as h, d as getMode, h as getElement, i as Host, m as createEvent, o as forceUpdate, p as Fragment, s as getRenderingRef } from "../index-VK8okIiF.mjs";
3
+ import { i as setAssetPath, n as Mixin, r as getAssetPath, t as ReactiveControllerHost } from "../reactive-controller-BdCpSAQP.mjs";
3
4
  import { Mock } from "vitest";
4
-
5
5
  //#region src/testing/testing-logger.d.ts
6
6
  declare class TestingLogger implements Logger {
7
7
  private isEnabled;
@@ -251,11 +251,6 @@ interface ConsoleMocker {
251
251
  };
252
252
  teardownConsoleMocks: () => void;
253
253
  }
254
- /**
255
- * the callback that `withSilentWarn` expects to receive. Basically receives a mock
256
- * as its argument and returns a `Promise`, the value of which is returned by `withSilentWarn`
257
- * as well.
258
- */
259
254
  //#endregion
260
255
  //#region src/testing/platform/testing-build.d.ts
261
256
  declare const Build: UserBuildConditionals;
@@ -300,4 +295,4 @@ declare function readTask(cb: RafCallback): void;
300
295
  //#region src/testing/platform/index.d.ts
301
296
  declare const setMode: (handler: (elm: any) => string | undefined | null) => void;
302
297
  //#endregion
303
- export { Build, type CreateTestCompilerOptions, Env, Fragment, Host, Mixin, type PreparedTestCompiler, type SpecPage, type TestCompilerResult, createEvent, createTestCompiler, createTestingSystem, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, h, mockBuildCtx, mockCompilerCtx, mockCompilerSystem, mockComponentMeta, mockConfig, mockDocument, mockLoadConfigInit, mockLogger, mockModule, mockValidatedConfig, mockWindow, newSpecPage, prepareTestCompiler, readTask, registerHost, registerInstance, setAssetPath, setErrorHandler, setMode, setupConsoleMocker, shuffleArray, writeTask };
298
+ export { Build, type CreateTestCompilerOptions, Env, Fragment, Host, Mixin, type PreparedTestCompiler, ReactiveControllerHost, type SpecPage, type TestCompilerResult, createEvent, createTestCompiler, createTestingSystem, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, h, mockBuildCtx, mockCompilerCtx, mockCompilerSystem, mockComponentMeta, mockConfig, mockDocument, mockLoadConfigInit, mockLogger, mockModule, mockValidatedConfig, mockWindow, newSpecPage, prepareTestCompiler, readTask, registerHost, registerInstance, setAssetPath, setErrorHandler, setMode, setupConsoleMocker, shuffleArray, writeTask };
@@ -1,8 +1,9 @@
1
- import { A as HYDRATE_ID, C as setAssetPath, D as DEFAULT_DOC_DATA, F as reWireGetterSetter, M as STENCIL_DOC_DATA, P as getHostRef$1, S as getAssetPath, X as Env, Y as BUILD, _ as insertBefore, b as getElement, c as Fragment, g as getRenderingRef, h as forceUpdate, j as NODE_TYPE, k as HYDRATE_CHILD_ID, l as bootstrapLazy, m as h, p as Host, s as Mixin, u as getMode, v as renderVdom, y as createEvent } from "../client-CvcvHKz4.mjs";
2
- import { L as EVENT_FLAGS, h as noop, w as CMP_FLAGS } from "../regular-expression-CFVJOTUh.mjs";
3
- import { b as getBuildFeatures, c as createWorkerContext, h as Cache, i as createSystem, o as loadConfig, p as createInMemoryFs, s as createCompiler, v as BuildContext } from "../compiler-BEGofLCO.mjs";
4
- import { wt as formatLazyBundleRuntimeMeta } from "../validation-CtaOJgnM.mjs";
5
- import { o as buildEvents } from "../node-BlgRcMMi.mjs";
1
+ import { A as HYDRATE_ID, C as setAssetPath, D as DEFAULT_DOC_DATA, F as reWireGetterSetter, L as BUILD, M as STENCIL_DOC_DATA, P as getHostRef$1, R as Env, S as getAssetPath, _ as insertBefore, b as getElement, c as Mixin, g as getRenderingRef, h as forceUpdate, j as NODE_TYPE, k as HYDRATE_CHILD_ID, l as bootstrapLazy, m as h, p as Host, s as ReactiveControllerHost, u as getMode, v as renderVdom, y as createEvent } from "../client-D1MsT-Rp.mjs";
2
+ import { R as EVENT_FLAGS, h as noop, w as CMP_FLAGS } from "../regular-expression-XqU5zmPp.mjs";
3
+ import { t as Fragment } from "../fragment-Di1hWOC8.mjs";
4
+ import { b as getBuildFeatures, c as createWorkerContext, h as Cache, i as createSystem, o as loadConfig, p as createInMemoryFs, s as createCompiler, v as BuildContext } from "../compiler-BbS9TDF_.mjs";
5
+ import { C as formatLazyBundleRuntimeMeta } from "../validation-Dd3g77T5.mjs";
6
+ import { o as buildEvents } from "../node-BQR4L-TG.mjs";
6
7
  import fs from "node:fs";
7
8
  import nodePath from "node:path";
8
9
  import { fileURLToPath } from "node:url";
@@ -229,6 +230,7 @@ const mockComponentMeta = (overrides = {}) => ({
229
230
  hasWatchCallback: false,
230
231
  htmlAttrNames: [],
231
232
  htmlParts: [],
233
+ htmlSlots: [],
232
234
  htmlTagNames: [],
233
235
  internal: false,
234
236
  isCollectionDependency: false,
@@ -270,7 +272,10 @@ function mockValidatedConfig(overrides = {}) {
270
272
  cacheDir: ".stencil",
271
273
  devMode: true,
272
274
  devServer: {},
273
- compat: {},
275
+ compat: {
276
+ suppressPublicNameWarnings: false,
277
+ suppressEventNameWarnings: false
278
+ },
274
279
  fsNamespace: "testing",
275
280
  hydratedFlag: null,
276
281
  logLevel: "info",
@@ -284,8 +289,6 @@ function mockValidatedConfig(overrides = {}) {
284
289
  sourceMap: true,
285
290
  srcDir: "/src",
286
291
  srcIndexHtml: "src/index.html",
287
- suppressReservedPublicNameWarnings: false,
288
- suppressReservedEventNameWarnings: false,
289
292
  sys: createTestingSystem(),
290
293
  transformAliasedImportPaths: true,
291
294
  rolldownConfig: {},
@@ -310,7 +313,10 @@ function mockConfig(overrides = {}) {
310
313
  bundles: null,
311
314
  devMode: true,
312
315
  enableCache: false,
313
- compat: {},
316
+ compat: {
317
+ suppressPublicNameWarnings: false,
318
+ suppressEventNameWarnings: false
319
+ },
314
320
  globalScript: null,
315
321
  logger: new TestingLogger(),
316
322
  maxConcurrentWorkers: 0,
@@ -325,8 +331,6 @@ function mockConfig(overrides = {}) {
325
331
  },
326
332
  rootDir,
327
333
  sourceMap: true,
328
- suppressReservedPublicNameWarnings: false,
329
- suppressReservedEventNameWarnings: false,
330
334
  sys,
331
335
  validateTypes: false,
332
336
  ...overrides
@@ -401,7 +405,8 @@ function mockCompilerCtx(config) {
401
405
  }
402
406
  function mockBuildCtx(config, compilerCtx) {
403
407
  const validatedConfig = config || mockValidatedConfig();
404
- return new BuildContext(validatedConfig, compilerCtx || mockCompilerCtx(validatedConfig));
408
+ const validatedCompilerCtx = compilerCtx || mockCompilerCtx(validatedConfig);
409
+ return new BuildContext(validatedConfig, validatedCompilerCtx);
405
410
  }
406
411
  function mockCache(config, compilerCtx) {
407
412
  config.enableCache = true;
@@ -453,6 +458,7 @@ const mockModule = (mod = {}) => ({
453
458
  htmlAttrNames: [],
454
459
  htmlTagNames: [],
455
460
  htmlParts: [],
461
+ htmlSlots: [],
456
462
  isCollectionDependency: false,
457
463
  isLegacy: false,
458
464
  jsFilePath: "",
@@ -562,18 +568,19 @@ const createPatchedSys = () => {
562
568
  const prepareTestCompiler = async (options = {}) => {
563
569
  const sys = createPatchedSys();
564
570
  const tsconfigPath = options.tsconfig ?? TESTING_TSCONFIG;
571
+ const userConfig = {
572
+ devMode: true,
573
+ sourceMap: false,
574
+ enableCache: false,
575
+ minifyJs: false,
576
+ minifyCss: false,
577
+ namespace: "Testing",
578
+ tsconfig: tsconfigPath,
579
+ ...options.config
580
+ };
565
581
  const { config: validatedConfig } = await loadConfig({
566
582
  sys,
567
- config: {
568
- devMode: true,
569
- sourceMap: false,
570
- enableCache: false,
571
- minifyJs: false,
572
- minifyCss: false,
573
- namespace: "Testing",
574
- tsconfig: tsconfigPath,
575
- ...options.config
576
- }
583
+ config: userConfig
577
584
  });
578
585
  return {
579
586
  _validatedConfig: validatedConfig,
@@ -613,18 +620,19 @@ const createTestCompiler = async (options = {}) => {
613
620
  } else {
614
621
  const sys = createPatchedSys();
615
622
  tsconfigPath = options.tsconfig ?? TESTING_TSCONFIG;
623
+ const userConfig = {
624
+ devMode: true,
625
+ sourceMap: false,
626
+ enableCache: false,
627
+ minifyJs: false,
628
+ minifyCss: false,
629
+ namespace: "Testing",
630
+ tsconfig: tsconfigPath,
631
+ ...options.config
632
+ };
616
633
  const { config } = await loadConfig({
617
634
  sys,
618
- config: {
619
- devMode: true,
620
- sourceMap: false,
621
- enableCache: false,
622
- minifyJs: false,
623
- minifyCss: false,
624
- namespace: "Testing",
625
- tsconfig: tsconfigPath,
626
- ...options.config
627
- }
635
+ config: userConfig
628
636
  });
629
637
  validatedConfig = config;
630
638
  }
@@ -1106,7 +1114,8 @@ const insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, in
1106
1114
  const nodeName = parentNode?.nodeName;
1107
1115
  if (nodeName !== "STYLE" && nodeName !== "SCRIPT") {
1108
1116
  const textNodeId = `t.${childId}`;
1109
- insertBefore(parentNode, doc.createComment(textNodeId), childElm);
1117
+ const commentBeforeTextNode = doc.createComment(textNodeId);
1118
+ insertBefore(parentNode, commentBeforeTextNode, childElm);
1110
1119
  }
1111
1120
  } else if (childElm.nodeType === NODE_TYPE.CommentNode) {
1112
1121
  if (childElm["s-sr"]) childElm.nodeValue = `s.${childId}.${childElm["s-sn"] || ""}`;
@@ -1221,7 +1230,13 @@ async function newSpecPage(opts) {
1221
1230
  /**
1222
1231
  * just pass through functional components that don't have styles nor any other metadata
1223
1232
  */
1224
- if (Cstr.COMPILER_META == null) return formatLazyBundleRuntimeMeta(`fc.${generateRandBundleId()}`, []);
1233
+ if (Cstr.COMPILER_META == null) {
1234
+ /**
1235
+ * the bundleId can be arbitrary, but must be unique
1236
+ */
1237
+ const arbitraryBundleId = `fc.${generateRandBundleId()}`;
1238
+ return formatLazyBundleRuntimeMeta(arbitraryBundleId, []);
1239
+ }
1225
1240
  cmpTags.add(Cstr.COMPILER_META.tagName);
1226
1241
  Cstr.isProxied = false;
1227
1242
  proxyComponentLifeCycles(Cstr);
@@ -1239,7 +1254,8 @@ async function newSpecPage(opts) {
1239
1254
  registerModule(bundleId, Cstr);
1240
1255
  return formatLazyBundleRuntimeMeta(bundleId, [Cstr.COMPILER_META]);
1241
1256
  });
1242
- const cmpBuild = getBuildFeatures(opts.components.filter((Cstr) => Cstr.COMPILER_META != null).map((Cstr) => Cstr.COMPILER_META));
1257
+ const cmpCompilerMeta = opts.components.filter((Cstr) => Cstr.COMPILER_META != null).map((Cstr) => Cstr.COMPILER_META);
1258
+ const cmpBuild = getBuildFeatures(cmpCompilerMeta);
1243
1259
  if (opts.strictBuild) Object.assign(BUILD, cmpBuild);
1244
1260
  else Object.keys(cmpBuild).forEach((key) => {
1245
1261
  if (cmpBuild[key] === true) BUILD[key] = true;
@@ -1270,17 +1286,19 @@ async function newSpecPage(opts) {
1270
1286
  for (const [, cmps] of lazyBundles) for (const cmp of cmps) if (cmp[0] & CMP_FLAGS.shadowDomEncapsulation) cmp[0] |= CMP_FLAGS.shadowNeedsScopedCss;
1271
1287
  }
1272
1288
  bootstrapLazy(lazyBundles);
1273
- if (typeof opts.template === "function") renderVdom({
1274
- $ancestorComponent$: void 0,
1275
- $flags$: 0,
1276
- $modeName$: void 0,
1277
- $cmpMeta$: {
1289
+ if (typeof opts.template === "function") {
1290
+ const ref = {
1291
+ $ancestorComponent$: void 0,
1278
1292
  $flags$: 0,
1279
- $tagName$: "body"
1280
- },
1281
- $hostElement$: page.body
1282
- }, opts.template());
1283
- else if (typeof opts.html === "string") page.body.innerHTML = opts.html;
1293
+ $modeName$: void 0,
1294
+ $cmpMeta$: {
1295
+ $flags$: 0,
1296
+ $tagName$: "body"
1297
+ },
1298
+ $hostElement$: page.body
1299
+ };
1300
+ renderVdom(ref, opts.template());
1301
+ } else if (typeof opts.html === "string") page.body.innerHTML = opts.html;
1284
1302
  if (opts.flushQueue !== false) await page.waitForChanges();
1285
1303
  let rootComponent = null;
1286
1304
  Object.defineProperty(page, "root", { get() {
@@ -1474,4 +1492,4 @@ function setupConsoleMocker() {
1474
1492
  };
1475
1493
  }
1476
1494
  //#endregion
1477
- export { Build, Env, Fragment, Host, Mixin, createEvent, createTestCompiler, createTestingSystem, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, h, mockBuildCtx, mockCompilerCtx, mockCompilerSystem, mockComponentMeta, mockConfig, mockDocument, mockLoadConfigInit, mockLogger, mockModule, mockValidatedConfig, mockWindow, newSpecPage, prepareTestCompiler, readTask, registerHost, registerInstance, setAssetPath, setErrorHandler, setMode, setupConsoleMocker, shuffleArray, writeTask };
1495
+ export { Build, Env, Fragment, Host, Mixin, ReactiveControllerHost, createEvent, createTestCompiler, createTestingSystem, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, h, mockBuildCtx, mockCompilerCtx, mockCompilerSystem, mockComponentMeta, mockConfig, mockDocument, mockLoadConfigInit, mockLogger, mockModule, mockValidatedConfig, mockWindow, newSpecPage, prepareTestCompiler, readTask, registerHost, registerInstance, setAssetPath, setErrorHandler, setMode, setupConsoleMocker, shuffleArray, writeTask };