@stencil/core 4.28.2-dev.1742410675.302a004 → 4.28.2-dev.1742446911.37ac3fc
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/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +7 -10
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +4 -156
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +16 -158
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.d.ts +0 -12
- package/internal/hydrate/runner.js +1 -365
- package/internal/package.json +1 -1
- package/internal/testing/index.js +3 -155
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +38 -38
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +2 -3
- package/testing/package.json +1 -1
package/internal/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal",
|
|
3
|
-
"version": "4.28.2-dev.
|
|
3
|
+
"version": "4.28.2-dev.1742446911.37ac3fc",
|
|
4
4
|
"description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -384,30 +384,6 @@ var import_app_data19 = require("@stencil/core/internal/app-data");
|
|
|
384
384
|
// src/utils/constants.ts
|
|
385
385
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
386
386
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
387
|
-
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
388
|
-
PrimitiveType2["Undefined"] = "undefined";
|
|
389
|
-
PrimitiveType2["Null"] = "null";
|
|
390
|
-
PrimitiveType2["String"] = "string";
|
|
391
|
-
PrimitiveType2["Number"] = "number";
|
|
392
|
-
PrimitiveType2["SpecialNumber"] = "number";
|
|
393
|
-
PrimitiveType2["Boolean"] = "boolean";
|
|
394
|
-
PrimitiveType2["BigInt"] = "bigint";
|
|
395
|
-
return PrimitiveType2;
|
|
396
|
-
})(PrimitiveType || {});
|
|
397
|
-
var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
|
|
398
|
-
NonPrimitiveType2["Array"] = "array";
|
|
399
|
-
NonPrimitiveType2["Date"] = "date";
|
|
400
|
-
NonPrimitiveType2["Map"] = "map";
|
|
401
|
-
NonPrimitiveType2["Object"] = "object";
|
|
402
|
-
NonPrimitiveType2["RegularExpression"] = "regexp";
|
|
403
|
-
NonPrimitiveType2["Set"] = "set";
|
|
404
|
-
NonPrimitiveType2["Channel"] = "channel";
|
|
405
|
-
NonPrimitiveType2["Symbol"] = "symbol";
|
|
406
|
-
return NonPrimitiveType2;
|
|
407
|
-
})(NonPrimitiveType || {});
|
|
408
|
-
var TYPE_CONSTANT = "type";
|
|
409
|
-
var VALUE_CONSTANT = "value";
|
|
410
|
-
var SERIALIZED_PREFIX = "serialized:";
|
|
411
387
|
|
|
412
388
|
// src/utils/helpers.ts
|
|
413
389
|
var isDef = (v) => v != null && v !== void 0;
|
|
@@ -427,101 +403,6 @@ var escapeRegExpSpecialCharacters = (text) => {
|
|
|
427
403
|
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
428
404
|
};
|
|
429
405
|
|
|
430
|
-
// src/utils/remote-value.ts
|
|
431
|
-
var RemoteValue = class _RemoteValue {
|
|
432
|
-
/**
|
|
433
|
-
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
434
|
-
*
|
|
435
|
-
* @param serialized The serialized LocalValue object
|
|
436
|
-
* @returns The original JavaScript value/object
|
|
437
|
-
*/
|
|
438
|
-
static fromLocalValue(serialized) {
|
|
439
|
-
const type = serialized[TYPE_CONSTANT];
|
|
440
|
-
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
441
|
-
switch (type) {
|
|
442
|
-
case "string" /* String */:
|
|
443
|
-
return value;
|
|
444
|
-
case "boolean" /* Boolean */:
|
|
445
|
-
return value;
|
|
446
|
-
case "bigint" /* BigInt */:
|
|
447
|
-
return BigInt(value);
|
|
448
|
-
case "undefined" /* Undefined */:
|
|
449
|
-
return void 0;
|
|
450
|
-
case "null" /* Null */:
|
|
451
|
-
return null;
|
|
452
|
-
case "number" /* Number */:
|
|
453
|
-
if (value === "NaN") return NaN;
|
|
454
|
-
if (value === "-0") return -0;
|
|
455
|
-
if (value === "Infinity") return Infinity;
|
|
456
|
-
if (value === "-Infinity") return -Infinity;
|
|
457
|
-
return value;
|
|
458
|
-
case "array" /* Array */:
|
|
459
|
-
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
460
|
-
case "date" /* Date */:
|
|
461
|
-
return new Date(value);
|
|
462
|
-
case "map" /* Map */:
|
|
463
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
464
|
-
for (const [key, val] of value) {
|
|
465
|
-
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
466
|
-
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
467
|
-
map2.set(deserializedKey, deserializedValue);
|
|
468
|
-
}
|
|
469
|
-
return map2;
|
|
470
|
-
case "object" /* Object */:
|
|
471
|
-
const obj = {};
|
|
472
|
-
for (const [key, val] of value) {
|
|
473
|
-
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
474
|
-
}
|
|
475
|
-
return obj;
|
|
476
|
-
case "regexp" /* RegularExpression */:
|
|
477
|
-
const { pattern, flags } = value;
|
|
478
|
-
return new RegExp(pattern, flags);
|
|
479
|
-
case "set" /* Set */:
|
|
480
|
-
const set = /* @__PURE__ */ new Set();
|
|
481
|
-
for (const item of value) {
|
|
482
|
-
set.add(_RemoteValue.fromLocalValue(item));
|
|
483
|
-
}
|
|
484
|
-
return set;
|
|
485
|
-
case "symbol" /* Symbol */:
|
|
486
|
-
return Symbol(value);
|
|
487
|
-
default:
|
|
488
|
-
throw new Error(`Unsupported type: ${type}`);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* Utility method to deserialize multiple LocalValues at once
|
|
493
|
-
*
|
|
494
|
-
* @param serializedValues Array of serialized LocalValue objects
|
|
495
|
-
* @returns Array of deserialized JavaScript values
|
|
496
|
-
*/
|
|
497
|
-
static fromLocalValueArray(serializedValues) {
|
|
498
|
-
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
502
|
-
*
|
|
503
|
-
* @param obj Object to verify
|
|
504
|
-
* @returns boolean indicating if the object has LocalValue structure
|
|
505
|
-
*/
|
|
506
|
-
static isLocalValueObject(obj) {
|
|
507
|
-
if (typeof obj !== "object" || obj === null) {
|
|
508
|
-
return false;
|
|
509
|
-
}
|
|
510
|
-
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
511
|
-
return false;
|
|
512
|
-
}
|
|
513
|
-
const type = obj[TYPE_CONSTANT];
|
|
514
|
-
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
515
|
-
if (!hasTypeProperty) {
|
|
516
|
-
return false;
|
|
517
|
-
}
|
|
518
|
-
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
519
|
-
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
520
|
-
}
|
|
521
|
-
return true;
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
|
|
525
406
|
// src/utils/result.ts
|
|
526
407
|
var result_exports = {};
|
|
527
408
|
__export(result_exports, {
|
|
@@ -571,14 +452,6 @@ var unwrapErr = (result) => {
|
|
|
571
452
|
}
|
|
572
453
|
};
|
|
573
454
|
|
|
574
|
-
// src/utils/serialize.ts
|
|
575
|
-
function deserializeProperty(value) {
|
|
576
|
-
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
577
|
-
return value;
|
|
578
|
-
}
|
|
579
|
-
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
580
|
-
}
|
|
581
|
-
|
|
582
455
|
// src/utils/util.ts
|
|
583
456
|
var lowerPathParam = (fn) => (p) => fn(p.toLowerCase());
|
|
584
457
|
var isDtsFile = lowerPathParam((p) => p.endsWith(".d.ts") || p.endsWith(".d.mts") || p.endsWith(".d.cts"));
|
|
@@ -1373,7 +1246,6 @@ var validateInputProperties = (inputElm) => {
|
|
|
1373
1246
|
|
|
1374
1247
|
// src/runtime/client-hydrate.ts
|
|
1375
1248
|
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1376
|
-
var _a;
|
|
1377
1249
|
const endHydrate = createTime("hydrateClient", tagName);
|
|
1378
1250
|
const shadowRoot = hostElm.shadowRoot;
|
|
1379
1251
|
const childRenderNodes = [];
|
|
@@ -1382,18 +1254,6 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1382
1254
|
const shadowRootNodes = import_app_data5.BUILD.shadowDom && shadowRoot ? [] : null;
|
|
1383
1255
|
const vnode = newVNode(tagName, null);
|
|
1384
1256
|
vnode.$elm$ = hostElm;
|
|
1385
|
-
vnode.$attrs$ = {};
|
|
1386
|
-
const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
|
|
1387
|
-
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
1388
|
-
var _a2;
|
|
1389
|
-
if (!(memberFlags & 31 /* Prop */)) {
|
|
1390
|
-
return;
|
|
1391
|
-
}
|
|
1392
|
-
const attributeName = metaAttributeName || memberName;
|
|
1393
|
-
const attrPropVal = parsePropertyValue(hostElm.getAttribute(attributeName), memberFlags);
|
|
1394
|
-
vnode.$attrs$[memberName] = attrPropVal;
|
|
1395
|
-
(_a2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a2.set(memberName, attrPropVal);
|
|
1396
|
-
});
|
|
1397
1257
|
let scopeId2;
|
|
1398
1258
|
if (import_app_data5.BUILD.scoped) {
|
|
1399
1259
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -2146,25 +2006,17 @@ var import_app_data14 = require("@stencil/core/internal/app-data");
|
|
|
2146
2006
|
// src/runtime/parse-property-value.ts
|
|
2147
2007
|
var import_app_data6 = require("@stencil/core/internal/app-data");
|
|
2148
2008
|
var parsePropertyValue = (propValue, propType) => {
|
|
2149
|
-
if (import_app_data6.BUILD.hydrateClientSide && isComplexType(propValue) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
2150
|
-
try {
|
|
2151
|
-
return JSON.parse(propValue);
|
|
2152
|
-
} catch (e) {
|
|
2153
|
-
}
|
|
2154
|
-
}
|
|
2155
|
-
if (import_app_data6.BUILD.hydrateClientSide && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
2156
|
-
return deserializeProperty(propValue);
|
|
2157
|
-
}
|
|
2158
2009
|
if (propValue != null && !isComplexType(propValue)) {
|
|
2159
2010
|
if (import_app_data6.BUILD.propBoolean && propType & 4 /* Boolean */) {
|
|
2160
2011
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
2161
2012
|
}
|
|
2162
2013
|
if (import_app_data6.BUILD.propNumber && propType & 2 /* Number */) {
|
|
2163
|
-
return
|
|
2014
|
+
return parseFloat(propValue);
|
|
2164
2015
|
}
|
|
2165
2016
|
if (import_app_data6.BUILD.propString && propType & 1 /* String */) {
|
|
2166
2017
|
return String(propValue);
|
|
2167
2018
|
}
|
|
2019
|
+
return propValue;
|
|
2168
2020
|
}
|
|
2169
2021
|
return propValue;
|
|
2170
2022
|
};
|
|
@@ -2934,11 +2786,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
2934
2786
|
const hostElm = hostRef.$hostElement$;
|
|
2935
2787
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2936
2788
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
2937
|
-
const
|
|
2938
|
-
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
2939
|
-
if (!isHostElement) {
|
|
2940
|
-
rootVnode.$attrs$ = oldVNode.$attrs$;
|
|
2941
|
-
}
|
|
2789
|
+
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
2942
2790
|
hostTagName = hostElm.tagName;
|
|
2943
2791
|
if (import_app_data12.BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
2944
2792
|
throw new Error(`The <Host> must be the single root component.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/testing",
|
|
3
|
-
"version": "4.28.2-dev.
|
|
3
|
+
"version": "4.28.2-dev.1742446911.37ac3fc",
|
|
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
|
package/mock-doc/index.cjs
CHANGED
package/mock-doc/index.js
CHANGED
package/mock-doc/package.json
CHANGED
package/package.json
CHANGED
package/screenshot/index.js
CHANGED
package/screenshot/package.json
CHANGED