@stencil/core 5.0.0-alpha.27 → 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.
- package/dist/app-data/index.d.ts +1 -1
- package/dist/{client-CvcvHKz4.mjs → client-D1MsT-Rp.mjs} +373 -238
- package/dist/compiler/index.d.mts +2 -3
- package/dist/compiler/index.mjs +3 -3
- package/dist/compiler/utils/index.d.mts +272 -2
- package/dist/compiler/utils/index.mjs +4 -3
- package/dist/{compiler-D43Ied7R.mjs → compiler-BbS9TDF_.mjs} +1845 -1118
- package/dist/declarations/stencil-ext-modules.d.ts +5 -5
- package/dist/declarations/stencil-public-compiler.d.ts +108 -40
- package/dist/declarations/stencil-public-docs.d.ts +9 -0
- package/dist/declarations/stencil-public-runtime.d.ts +81 -6
- package/dist/fragment-Di1hWOC8.mjs +4 -0
- package/dist/{index-F3IidHM1.d.mts → index-BHj3EBl2.d.mts} +395 -312
- package/dist/{index-xAkMgLX_.d.ts → index-D2PAsXxx.d.ts} +133 -9
- package/dist/index-VK8okIiF.d.mts +108 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +91 -2
- package/dist/jsx-runtime.mjs +2 -1
- package/dist/{node-DKVq_Ud0.mjs → node-BQR4L-TG.mjs} +60 -58
- package/dist/reactive-controller-BdCpSAQP.d.mts +13 -0
- package/dist/{regular-expression-CFVJOTUh.mjs → regular-expression-XqU5zmPp.mjs} +20 -3
- package/dist/{chunk-z9aeyW2b.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
- package/dist/runtime/client/lazy.js +411 -165
- package/dist/runtime/client/runtime.d.ts +136 -9
- package/dist/runtime/client/runtime.js +411 -165
- package/dist/runtime/index.d.ts +5 -3
- package/dist/runtime/index.js +410 -163
- package/dist/runtime/server/index.d.mts +80 -8
- package/dist/runtime/server/index.mjs +333 -158
- package/dist/runtime/server/runner.d.mts +3 -0
- package/dist/runtime/server/runner.mjs +232 -308
- package/dist/signals/index.d.ts +2 -0
- package/dist/sys/node/index.d.mts +1 -2
- package/dist/sys/node/index.mjs +1 -1
- package/dist/sys/node/worker.d.mts +1 -1
- package/dist/sys/node/worker.mjs +6 -3
- package/dist/testing/index.d.mts +4 -9
- package/dist/testing/index.mjs +74 -56
- package/dist/util-BIa-iHnt.mjs +724 -0
- package/dist/validation-Dd3g77T5.mjs +778 -0
- package/package.json +27 -27
- package/dist/index-3fu7WQs4.d.mts +0 -205
- package/dist/validation-ByxKj8bC.mjs +0 -1458
- /package/{LICENSE.md → LICENSE} +0 -0
package/dist/signals/index.d.ts
CHANGED
|
@@ -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
|
package/dist/sys/node/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-
|
|
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 {}
|
package/dist/sys/node/worker.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as createWorkerMessageHandler } from "../../compiler-
|
|
2
|
-
import { t as createNodeSys } from "../../node-
|
|
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
|
-
|
|
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 {};
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -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,
|
|
2
|
-
import {
|
|
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 };
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
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,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
-
import
|
|
8
|
+
import nodePath from "node:path";
|
|
8
9
|
import { fileURLToPath } from "node:url";
|
|
9
|
-
import path
|
|
10
|
+
import path from "path";
|
|
10
11
|
import { MockWindow, setupGlobal } from "@stencil/mock-doc";
|
|
11
12
|
import { createHash } from "crypto";
|
|
12
13
|
import { afterAll, vi } from "vitest";
|
|
@@ -88,7 +89,7 @@ const createTestingSystem = () => {
|
|
|
88
89
|
let diskReads = 0;
|
|
89
90
|
let diskWrites = 0;
|
|
90
91
|
const sys = createSystem();
|
|
91
|
-
sys.platformPath = path
|
|
92
|
+
sys.platformPath = path;
|
|
92
93
|
sys.generateContentHash = (content, length) => {
|
|
93
94
|
let hash = createHash("sha1").update(content).digest("hex").toLowerCase();
|
|
94
95
|
if (typeof length === "number") hash = hash.slice(0, length);
|
|
@@ -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,
|
|
@@ -264,13 +266,16 @@ const mockComponentMeta = (overrides = {}) => ({
|
|
|
264
266
|
*/
|
|
265
267
|
function mockValidatedConfig(overrides = {}) {
|
|
266
268
|
const baseConfig = mockConfig(overrides);
|
|
267
|
-
const rootDir =
|
|
269
|
+
const rootDir = nodePath.resolve("/");
|
|
268
270
|
return {
|
|
269
271
|
...baseConfig,
|
|
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",
|
|
@@ -279,13 +284,11 @@ function mockValidatedConfig(overrides = {}) {
|
|
|
279
284
|
minifyJs: false,
|
|
280
285
|
namespace: "Testing",
|
|
281
286
|
outputTargets: baseConfig.outputTargets ?? [],
|
|
282
|
-
packageJsonFilePath:
|
|
287
|
+
packageJsonFilePath: nodePath.join(rootDir, "package.json"),
|
|
283
288
|
rootDir,
|
|
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: {},
|
|
@@ -300,7 +303,7 @@ function mockValidatedConfig(overrides = {}) {
|
|
|
300
303
|
* @returns the mock Stencil configuration
|
|
301
304
|
*/
|
|
302
305
|
function mockConfig(overrides = {}) {
|
|
303
|
-
const rootDir =
|
|
306
|
+
const rootDir = nodePath.resolve("/");
|
|
304
307
|
let { sys } = overrides;
|
|
305
308
|
if (!sys) sys = createTestingSystem();
|
|
306
309
|
sys.getCurrentDirectory = () => rootDir;
|
|
@@ -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
|
-
|
|
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: "",
|
|
@@ -482,8 +488,8 @@ const mockModule = (mod = {}) => ({
|
|
|
482
488
|
});
|
|
483
489
|
//#endregion
|
|
484
490
|
//#region src/testing/create-test-compiler.ts
|
|
485
|
-
const __dirname =
|
|
486
|
-
const TESTING_TSCONFIG =
|
|
491
|
+
const __dirname = nodePath.dirname(fileURLToPath(import.meta.url));
|
|
492
|
+
const TESTING_TSCONFIG = nodePath.resolve(__dirname, "fixtures/tsconfig.testing.json");
|
|
487
493
|
/**
|
|
488
494
|
* Builds a patched sys that falls through to real disk for TypeScript lib files.
|
|
489
495
|
*
|
|
@@ -538,7 +544,7 @@ const createPatchedSys = () => {
|
|
|
538
544
|
return mem;
|
|
539
545
|
}
|
|
540
546
|
};
|
|
541
|
-
sys.getCompilerExecutingPath = () =>
|
|
547
|
+
sys.getCompilerExecutingPath = () => nodePath.resolve(__dirname, "../../dist/compiler/index.mjs");
|
|
542
548
|
return sys;
|
|
543
549
|
};
|
|
544
550
|
/**
|
|
@@ -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
|
}
|
|
@@ -634,7 +642,7 @@ const createTestCompiler = async (options = {}) => {
|
|
|
634
642
|
...tsconfigObj,
|
|
635
643
|
include: [validatedConfig.srcDir]
|
|
636
644
|
}));
|
|
637
|
-
await compiler.fs.writeFile(
|
|
645
|
+
await compiler.fs.writeFile(nodePath.join(validatedConfig.srcDir, "components.d.ts"), "");
|
|
638
646
|
return {
|
|
639
647
|
compiler,
|
|
640
648
|
config: validatedConfig,
|
|
@@ -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
|
-
|
|
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)
|
|
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
|
|
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")
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
$modeName$: void 0,
|
|
1277
|
-
$cmpMeta$: {
|
|
1289
|
+
if (typeof opts.template === "function") {
|
|
1290
|
+
const ref = {
|
|
1291
|
+
$ancestorComponent$: void 0,
|
|
1278
1292
|
$flags$: 0,
|
|
1279
|
-
$
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
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 };
|