@stencil/core 4.37.1 → 4.38.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.
- package/cli/index.cjs +2 -2
- package/cli/index.js +2 -2
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +337 -169
- 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 +3 -3
- package/internal/app-data/index.cjs +1 -1
- package/internal/app-data/index.js +1 -1
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +95 -46
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +116 -64
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.d.ts +2 -0
- package/internal/hydrate/runner.js +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-core/index.d.ts +2 -0
- package/internal/stencil-private.d.ts +33 -8
- package/internal/stencil-public-compiler.d.ts +5 -0
- package/internal/stencil-public-runtime.d.ts +16 -2
- package/internal/testing/index.js +91 -44
- 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 +2 -2
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +34 -34
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +22 -12
- package/testing/package.json +1 -1
package/compiler/stencil.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Compiler v4.
|
|
2
|
+
Stencil Compiler v4.38.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
"use strict";
|
|
5
5
|
var __create = Object.create;
|
|
@@ -2330,7 +2330,7 @@ var require_typescript_5_5_4_bundle_cache_min = __commonJS({
|
|
|
2330
2330
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
2331
2331
|
and limitations under the License.
|
|
2332
2332
|
***************************************************************************** */
|
|
2333
|
-
var
|
|
2333
|
+
var ts72 = {};
|
|
2334
2334
|
((module3) => {
|
|
2335
2335
|
"use strict";
|
|
2336
2336
|
var _a2;
|
|
@@ -207851,9 +207851,9 @@ ${e.message}`;
|
|
|
207851
207851
|
};
|
|
207852
207852
|
}
|
|
207853
207853
|
})({ get exports() {
|
|
207854
|
-
return
|
|
207854
|
+
return ts72;
|
|
207855
207855
|
}, set exports(v) {
|
|
207856
|
-
|
|
207856
|
+
ts72 = v;
|
|
207857
207857
|
if (typeof module2 !== "undefined" && module2.exports) {
|
|
207858
207858
|
module2.exports = v;
|
|
207859
207859
|
}
|
|
@@ -232664,17 +232664,17 @@ __export(index_exports, {
|
|
|
232664
232664
|
optimizeJs: () => optimizeJs,
|
|
232665
232665
|
transpile: () => transpile,
|
|
232666
232666
|
transpileSync: () => transpileSync,
|
|
232667
|
-
ts: () =>
|
|
232667
|
+
ts: () => import_typescript71.default,
|
|
232668
232668
|
validateConfig: () => validateConfig,
|
|
232669
232669
|
vermoji: () => vermoji,
|
|
232670
232670
|
version: () => version,
|
|
232671
232671
|
versions: () => versions
|
|
232672
232672
|
});
|
|
232673
232673
|
module.exports = __toCommonJS(index_exports);
|
|
232674
|
-
var
|
|
232674
|
+
var import_typescript71 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
232675
232675
|
|
|
232676
232676
|
// src/version.ts
|
|
232677
|
-
var buildId = "
|
|
232677
|
+
var buildId = "1759440611";
|
|
232678
232678
|
var minfyJsId = "terser5.37.0_7";
|
|
232679
232679
|
var optimizeCssId = "autoprefixer10.4.19_postcss8.5.3_7";
|
|
232680
232680
|
var parse5Version = "7.2.1";
|
|
@@ -232682,8 +232682,8 @@ var rollupVersion = "4.34.9";
|
|
|
232682
232682
|
var jqueryVersion = "4.0.0-pre";
|
|
232683
232683
|
var terserVersion = "5.37.0";
|
|
232684
232684
|
var typescriptVersion = "5.5.4";
|
|
232685
|
-
var vermoji = "\u{
|
|
232686
|
-
var version = "4.
|
|
232685
|
+
var vermoji = "\u{1F3BF}";
|
|
232686
|
+
var version = "4.38.0";
|
|
232687
232687
|
var versions = {
|
|
232688
232688
|
stencil: version,
|
|
232689
232689
|
parse5: parse5Version,
|
|
@@ -232760,13 +232760,17 @@ var formatComponentRuntimeMeta = (compilerMeta, includeMethods) => {
|
|
|
232760
232760
|
}
|
|
232761
232761
|
const members = formatComponentRuntimeMembers(compilerMeta, includeMethods);
|
|
232762
232762
|
const hostListeners = formatHostListeners(compilerMeta);
|
|
232763
|
-
const watchers =
|
|
232763
|
+
const watchers = formatComponentRuntimeReactiveHandlers(compilerMeta, "watchers");
|
|
232764
|
+
const serializers = formatComponentRuntimeReactiveHandlers(compilerMeta, "serializers");
|
|
232765
|
+
const deserializers = formatComponentRuntimeReactiveHandlers(compilerMeta, "deserializers");
|
|
232764
232766
|
return trimFalsy([
|
|
232765
232767
|
flags,
|
|
232766
232768
|
compilerMeta.tagName,
|
|
232767
232769
|
Object.keys(members).length > 0 ? members : void 0,
|
|
232768
232770
|
hostListeners.length > 0 ? hostListeners : void 0,
|
|
232769
|
-
Object.keys(watchers).length > 0 ? watchers : void 0
|
|
232771
|
+
Object.keys(watchers).length > 0 ? watchers : void 0,
|
|
232772
|
+
Object.keys(serializers).length > 0 ? serializers : void 0,
|
|
232773
|
+
Object.keys(deserializers).length > 0 ? deserializers : void 0
|
|
232770
232774
|
]);
|
|
232771
232775
|
};
|
|
232772
232776
|
var stringifyRuntimeData = (data) => {
|
|
@@ -232776,13 +232780,14 @@ var stringifyRuntimeData = (data) => {
|
|
|
232776
232780
|
}
|
|
232777
232781
|
return json2;
|
|
232778
232782
|
};
|
|
232779
|
-
var
|
|
232780
|
-
|
|
232781
|
-
|
|
232782
|
-
|
|
232783
|
-
|
|
232783
|
+
var formatComponentRuntimeReactiveHandlers = (compilerMeta, decorator3) => {
|
|
232784
|
+
var _a2;
|
|
232785
|
+
const handlers = {};
|
|
232786
|
+
(_a2 = compilerMeta[decorator3]) == null ? void 0 : _a2.forEach(({ propName, methodName }) => {
|
|
232787
|
+
var _a3;
|
|
232788
|
+
handlers[propName] = [...(_a3 = handlers[propName]) != null ? _a3 : [], methodName];
|
|
232784
232789
|
});
|
|
232785
|
-
return
|
|
232790
|
+
return handlers;
|
|
232786
232791
|
};
|
|
232787
232792
|
var formatComponentRuntimeMembers = (compilerMeta, includeMethods = true) => {
|
|
232788
232793
|
return {
|
|
@@ -233772,7 +233777,7 @@ var BUILD = {
|
|
|
233772
233777
|
vdomRender: true,
|
|
233773
233778
|
vdomStyle: true,
|
|
233774
233779
|
vdomText: true,
|
|
233775
|
-
|
|
233780
|
+
propChangeCallback: true,
|
|
233776
233781
|
taskQueue: true,
|
|
233777
233782
|
hotModuleReplacement: false,
|
|
233778
233783
|
isDebug: false,
|
|
@@ -234463,7 +234468,7 @@ var validateComponentTag = (tag) => {
|
|
|
234463
234468
|
};
|
|
234464
234469
|
|
|
234465
234470
|
// src/compiler/compiler.ts
|
|
234466
|
-
var
|
|
234471
|
+
var import_typescript67 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
234467
234472
|
|
|
234468
234473
|
// src/compiler/build/compiler-ctx.ts
|
|
234469
234474
|
var import_path4 = require("path");
|
|
@@ -236503,6 +236508,7 @@ var STATIC_GETTERS_TO_REMOVE = [
|
|
|
236503
236508
|
// step through to the `ComponentCompilerMeta` phase, but we want to keep the
|
|
236504
236509
|
// `formAssociated` prop that we also set at the same time.
|
|
236505
236510
|
"attachInternalsMemberName",
|
|
236511
|
+
"deserializers",
|
|
236506
236512
|
"elementRef",
|
|
236507
236513
|
"encapsulation",
|
|
236508
236514
|
"events",
|
|
@@ -236511,6 +236517,7 @@ var STATIC_GETTERS_TO_REMOVE = [
|
|
|
236511
236517
|
"methods",
|
|
236512
236518
|
"originalStyleUrls",
|
|
236513
236519
|
"properties",
|
|
236520
|
+
"serializers",
|
|
236514
236521
|
"states",
|
|
236515
236522
|
"style",
|
|
236516
236523
|
"styleMode",
|
|
@@ -237220,7 +237227,7 @@ var retrieveTsModifiers = (node) => {
|
|
|
237220
237227
|
};
|
|
237221
237228
|
function foundSuper(constructorBodyStatements) {
|
|
237222
237229
|
return constructorBodyStatements == null ? void 0 : constructorBodyStatements.find(
|
|
237223
|
-
(s) => import_typescript9.default.isExpressionStatement(s) && import_typescript9.default.isCallExpression(s.expression) && s.expression.expression.kind === import_typescript9.default.SyntaxKind.SuperKeyword
|
|
237230
|
+
(s) => import_typescript9.default.isExpressionStatement(s) && import_typescript9.default.isCallExpression(s.expression) && (s.expression.expression.kind === import_typescript9.default.SyntaxKind.SuperKeyword || import_typescript9.default.isIdentifier(s.expression.expression) && s.expression.expression.escapedText === "super")
|
|
237224
237231
|
);
|
|
237225
237232
|
}
|
|
237226
237233
|
var updateConstructor = (classNode, classMembers, statements, parameters, includeFalseArg) => {
|
|
@@ -253610,15 +253617,15 @@ var syntheticRender = (moduleFile, hasRender) => {
|
|
|
253610
253617
|
};
|
|
253611
253618
|
var INTERNAL_RENDER = "__stencil_render";
|
|
253612
253619
|
|
|
253613
|
-
// src/compiler/transformers/
|
|
253614
|
-
var
|
|
253615
|
-
if (cmp.
|
|
253620
|
+
// src/compiler/transformers/reactive-handler-meta-transform.ts
|
|
253621
|
+
var addReactivePropHandlers = (classMembers, cmp, decorator3) => {
|
|
253622
|
+
if (cmp[decorator3].length > 0) {
|
|
253616
253623
|
const watcherObj = {};
|
|
253617
|
-
cmp.
|
|
253624
|
+
cmp[decorator3].forEach(({ propName, methodName }) => {
|
|
253618
253625
|
watcherObj[propName] = watcherObj[propName] || [];
|
|
253619
253626
|
watcherObj[propName].push(methodName);
|
|
253620
253627
|
});
|
|
253621
|
-
classMembers.push(createStaticGetter(
|
|
253628
|
+
classMembers.push(createStaticGetter(decorator3, convertValueToLiteral(watcherObj)));
|
|
253622
253629
|
}
|
|
253623
253630
|
};
|
|
253624
253631
|
|
|
@@ -253977,7 +253984,9 @@ var updateNativeHostComponentMembers = (transformOpts, classNode, moduleFile, cm
|
|
|
253977
253984
|
updateNativeConstructor(classMembers, moduleFile, cmp, classNode);
|
|
253978
253985
|
addNativeConnectedCallback(classMembers, cmp);
|
|
253979
253986
|
addNativeElementGetter(classMembers, cmp);
|
|
253980
|
-
|
|
253987
|
+
addReactivePropHandlers(classMembers, cmp, "watchers");
|
|
253988
|
+
addReactivePropHandlers(classMembers, cmp, "serializers");
|
|
253989
|
+
addReactivePropHandlers(classMembers, cmp, "deserializers");
|
|
253981
253990
|
if (cmp.isPlain) {
|
|
253982
253991
|
addNativeComponentMeta(classMembers, cmp);
|
|
253983
253992
|
}
|
|
@@ -254202,6 +254211,7 @@ var getBuildFeatures = (cmps) => {
|
|
|
254202
254211
|
const f = {
|
|
254203
254212
|
allRenderFn: cmps.every((c) => c.hasRenderFn),
|
|
254204
254213
|
formAssociated: cmps.some((c) => c.formAssociated),
|
|
254214
|
+
deserializer: cmps.some((c) => c.hasDeserializer),
|
|
254205
254215
|
element: cmps.some((c) => c.hasElement),
|
|
254206
254216
|
event: cmps.some((c) => c.hasEvent),
|
|
254207
254217
|
hasRenderFn: cmps.some((c) => c.hasRenderFn),
|
|
@@ -254217,14 +254227,16 @@ var getBuildFeatures = (cmps) => {
|
|
|
254217
254227
|
method: cmps.some((c) => c.hasMethod),
|
|
254218
254228
|
mode: cmps.some((c) => c.hasMode),
|
|
254219
254229
|
modernPropertyDecls: cmps.some((c) => c.hasModernPropertyDecls),
|
|
254220
|
-
observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback),
|
|
254230
|
+
observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback || c.hasDeserializer),
|
|
254221
254231
|
prop: cmps.some((c) => c.hasProp),
|
|
254222
254232
|
propBoolean: cmps.some((c) => c.hasPropBoolean),
|
|
254233
|
+
propChangeCallback: cmps.some((c) => c.hasWatchCallback || c.hasDeserializer || c.hasSerializer),
|
|
254223
254234
|
propNumber: cmps.some((c) => c.hasPropNumber),
|
|
254224
254235
|
propString: cmps.some((c) => c.hasPropString),
|
|
254225
254236
|
propMutable: cmps.some((c) => c.hasPropMutable),
|
|
254226
|
-
reflect: cmps.some((c) => c.hasReflect),
|
|
254237
|
+
reflect: cmps.some((c) => c.hasReflect || c.hasSerializer),
|
|
254227
254238
|
scoped: cmps.some((c) => c.encapsulation === "scoped"),
|
|
254239
|
+
serializer: cmps.some((c) => c.hasSerializer),
|
|
254228
254240
|
shadowDom,
|
|
254229
254241
|
shadowDelegatesFocus: shadowDom && cmps.some((c) => c.shadowDelegatesFocus),
|
|
254230
254242
|
slot,
|
|
@@ -254244,7 +254256,6 @@ var getBuildFeatures = (cmps) => {
|
|
|
254244
254256
|
vdomRender: cmps.some((c) => c.hasVdomRender),
|
|
254245
254257
|
vdomStyle: cmps.some((c) => c.hasVdomStyle),
|
|
254246
254258
|
vdomText: cmps.some((c) => c.hasVdomText),
|
|
254247
|
-
watchCallback: cmps.some((c) => c.hasWatchCallback),
|
|
254248
254259
|
taskQueue: true
|
|
254249
254260
|
};
|
|
254250
254261
|
f.vdomAttribute = f.vdomAttribute || f.reflect;
|
|
@@ -254610,7 +254621,9 @@ var updateHydrateHostComponentMembers = (classNode, moduleFile, cmp) => {
|
|
|
254610
254621
|
const classMembers = removeStaticMetaProperties(classNode);
|
|
254611
254622
|
updateLazyComponentConstructor(classMembers, classNode, moduleFile, cmp);
|
|
254612
254623
|
addLazyElementGetter(classMembers, moduleFile, cmp);
|
|
254613
|
-
|
|
254624
|
+
addReactivePropHandlers(classMembers, cmp, "watchers");
|
|
254625
|
+
addReactivePropHandlers(classMembers, cmp, "serializers");
|
|
254626
|
+
addReactivePropHandlers(classMembers, cmp, "deserializers");
|
|
254614
254627
|
addHydrateRuntimeCmpMeta(classMembers, cmp);
|
|
254615
254628
|
transformHostData(classMembers, moduleFile);
|
|
254616
254629
|
return classMembers;
|
|
@@ -255278,7 +255291,9 @@ var updateLazyComponentMembers = (transformOpts, styleStatements, classNode, mod
|
|
|
255278
255291
|
const classMembers = removeStaticMetaProperties(classNode);
|
|
255279
255292
|
updateLazyComponentConstructor(classMembers, classNode, moduleFile, cmp);
|
|
255280
255293
|
addLazyElementGetter(classMembers, moduleFile, cmp);
|
|
255281
|
-
|
|
255294
|
+
addReactivePropHandlers(classMembers, cmp, "watchers");
|
|
255295
|
+
addReactivePropHandlers(classMembers, cmp, "serializers");
|
|
255296
|
+
addReactivePropHandlers(classMembers, cmp, "deserializers");
|
|
255282
255297
|
transformHostData(classMembers, moduleFile);
|
|
255283
255298
|
if (transformOpts.style === "static") {
|
|
255284
255299
|
addStaticStylePropertyToClass(styleStatements, cmp);
|
|
@@ -257501,6 +257516,7 @@ var validateConfig = (userConfig = {}, bootstrapConfig) => {
|
|
|
257501
257516
|
setBooleanConfig(validatedConfig, "autoprefixCss", null, validatedConfig.buildEs5);
|
|
257502
257517
|
setBooleanConfig(validatedConfig, "validateTypes", null, !validatedConfig._isTesting);
|
|
257503
257518
|
setBooleanConfig(validatedConfig, "allowInlineScripts", null, true);
|
|
257519
|
+
setBooleanConfig(validatedConfig, "suppressReservedPublicNameWarnings", null, false);
|
|
257504
257520
|
if (!isString(validatedConfig.taskQueue)) {
|
|
257505
257521
|
validatedConfig.taskQueue = "async";
|
|
257506
257522
|
}
|
|
@@ -260379,7 +260395,7 @@ function attrNameToString(attr) {
|
|
|
260379
260395
|
}
|
|
260380
260396
|
|
|
260381
260397
|
// src/compiler/transformers/decorators-to-static/convert-decorators.ts
|
|
260382
|
-
var
|
|
260398
|
+
var import_typescript55 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
260383
260399
|
|
|
260384
260400
|
// src/compiler/transformers/decorators-to-static/attach-internals.ts
|
|
260385
260401
|
var import_typescript43 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
@@ -260612,6 +260628,8 @@ var findTagNode = (propName, node) => {
|
|
|
260612
260628
|
// src/compiler/transformers/decorators-to-static/decorators-constants.ts
|
|
260613
260629
|
var STENCIL_DECORATORS = [
|
|
260614
260630
|
"AttachInternals",
|
|
260631
|
+
"AttrDeserialize",
|
|
260632
|
+
"PropSerialize",
|
|
260615
260633
|
"Component",
|
|
260616
260634
|
"Element",
|
|
260617
260635
|
"Event",
|
|
@@ -260624,6 +260642,8 @@ var STENCIL_DECORATORS = [
|
|
|
260624
260642
|
var CLASS_DECORATORS_TO_REMOVE = ["Component"];
|
|
260625
260643
|
var MEMBER_DECORATORS_TO_REMOVE = [
|
|
260626
260644
|
"AttachInternals",
|
|
260645
|
+
"AttrDeserialize",
|
|
260646
|
+
"PropSerialize",
|
|
260627
260647
|
"Element",
|
|
260628
260648
|
"Event",
|
|
260629
260649
|
"Listen",
|
|
@@ -261120,7 +261140,10 @@ var PASSIVE_TRUE_DEFAULTS = /* @__PURE__ */ new Set([
|
|
|
261120
261140
|
var import_typescript50 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261121
261141
|
|
|
261122
261142
|
// src/compiler/transformers/reserved-public-members.ts
|
|
261123
|
-
var validatePublicName = (diagnostics, memberName, decorator3, memberType, node) => {
|
|
261143
|
+
var validatePublicName = (config, diagnostics, memberName, decorator3, memberType, node) => {
|
|
261144
|
+
if (config.suppressReservedPublicNameWarnings) {
|
|
261145
|
+
return;
|
|
261146
|
+
}
|
|
261124
261147
|
if (RESERVED_PUBLIC_MEMBERS.has(memberName.toLowerCase())) {
|
|
261125
261148
|
const warn = buildWarn(diagnostics);
|
|
261126
261149
|
warn.messageText = [
|
|
@@ -261434,7 +261457,7 @@ var parseMethodDecorator = (config, diagnostics, tsSourceFile, typeChecker, prog
|
|
|
261434
261457
|
err2.messageText = 'Methods decorated with the @Method() decorator cannot be "private" nor "protected". More info: https://stenciljs.com/docs/methods';
|
|
261435
261458
|
augmentDiagnosticWithNode(err2, retrieveTsModifiers(method)[0]);
|
|
261436
261459
|
}
|
|
261437
|
-
validatePublicName(diagnostics, methodName, "@Method()", "method", method.name);
|
|
261460
|
+
validatePublicName(config, diagnostics, methodName, "@Method()", "method", method.name);
|
|
261438
261461
|
const methodMeta = {
|
|
261439
261462
|
complexType: {
|
|
261440
261463
|
signature: signatureString,
|
|
@@ -261476,13 +261499,25 @@ var validateMethods = (diagnostics, members) => {
|
|
|
261476
261499
|
|
|
261477
261500
|
// src/compiler/transformers/decorators-to-static/prop-decorator.ts
|
|
261478
261501
|
var import_typescript51 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261479
|
-
var propDecoratorsToStatic = (diagnostics, decoratedProps, typeChecker, program3, newMembers, decoratorName) => {
|
|
261480
|
-
const properties = decoratedProps.filter((prop) => import_typescript51.default.isPropertyDeclaration(prop) || import_typescript51.default.isGetAccessor(prop)).map(
|
|
261502
|
+
var propDecoratorsToStatic = (config, diagnostics, decoratedProps, typeChecker, program3, newMembers, decoratorName, serializers, deserializers) => {
|
|
261503
|
+
const properties = decoratedProps.filter((prop) => import_typescript51.default.isPropertyDeclaration(prop) || import_typescript51.default.isGetAccessor(prop)).map(
|
|
261504
|
+
(prop) => parsePropDecorator(
|
|
261505
|
+
config,
|
|
261506
|
+
diagnostics,
|
|
261507
|
+
typeChecker,
|
|
261508
|
+
program3,
|
|
261509
|
+
prop,
|
|
261510
|
+
decoratorName,
|
|
261511
|
+
newMembers,
|
|
261512
|
+
serializers,
|
|
261513
|
+
deserializers
|
|
261514
|
+
)
|
|
261515
|
+
).filter((prop) => prop != null);
|
|
261481
261516
|
if (properties.length > 0) {
|
|
261482
261517
|
newMembers.push(createStaticGetter("properties", import_typescript51.default.factory.createObjectLiteralExpression(properties, true)));
|
|
261483
261518
|
}
|
|
261484
261519
|
};
|
|
261485
|
-
var parsePropDecorator = (diagnostics, typeChecker, program3, prop, decoratorName, newMembers) => {
|
|
261520
|
+
var parsePropDecorator = (config, diagnostics, typeChecker, program3, prop, decoratorName, newMembers, serializers, deserializers) => {
|
|
261486
261521
|
var _a2, _b;
|
|
261487
261522
|
const propDecorator = (_a2 = retrieveTsDecorators(prop)) == null ? void 0 : _a2.find(isDecoratorNamed(decoratorName));
|
|
261488
261523
|
if (propDecorator == null) {
|
|
@@ -261501,7 +261536,7 @@ var parsePropDecorator = (diagnostics, typeChecker, program3, prop, decoratorNam
|
|
|
261501
261536
|
warn.messageText = `The @Prop() name "${propName}" looks like an event. Please use the "@Event()" decorator to expose events instead, not properties or methods.`;
|
|
261502
261537
|
augmentDiagnosticWithNode(warn, prop.name);
|
|
261503
261538
|
} else {
|
|
261504
|
-
validatePublicName(diagnostics, propName, "@Prop()", "prop", prop.name);
|
|
261539
|
+
validatePublicName(config, diagnostics, propName, "@Prop()", "prop", prop.name);
|
|
261505
261540
|
}
|
|
261506
261541
|
const symbol = typeChecker.getSymbolAtLocation(prop.name);
|
|
261507
261542
|
const type = typeChecker.getTypeAtLocation(prop);
|
|
@@ -261509,7 +261544,6 @@ var parsePropDecorator = (diagnostics, typeChecker, program3, prop, decoratorNam
|
|
|
261509
261544
|
const foundSetter = import_typescript51.default.isGetAccessor(prop) ? findSetter(propName, newMembers) : null;
|
|
261510
261545
|
const propMeta = {
|
|
261511
261546
|
type: typeStr,
|
|
261512
|
-
attribute: getAttributeName(propName, propOptions),
|
|
261513
261547
|
mutable: !!propOptions.mutable,
|
|
261514
261548
|
complexType: getComplexType2(typeChecker, prop, type, program3),
|
|
261515
261549
|
required: prop.exclamationToken !== void 0 && propName !== "mode",
|
|
@@ -261521,8 +261555,14 @@ var parsePropDecorator = (diagnostics, typeChecker, program3, prop, decoratorNam
|
|
|
261521
261555
|
if (ogPropName && ogPropName !== propName) {
|
|
261522
261556
|
propMeta.ogPropName = ogPropName;
|
|
261523
261557
|
}
|
|
261524
|
-
|
|
261525
|
-
|
|
261558
|
+
const foundSerializer = !!serializers.find((s) => s.propName === propName);
|
|
261559
|
+
const foundDeserializer = !!deserializers.find((s) => s.propName === propName);
|
|
261560
|
+
if (typeStr !== "unknown" || foundSerializer) {
|
|
261561
|
+
const explicitReflect = getReflect(diagnostics, propDecorator, propOptions);
|
|
261562
|
+
propMeta.reflect = explicitReflect === null ? foundSerializer : explicitReflect;
|
|
261563
|
+
}
|
|
261564
|
+
if (typeStr !== "unknown" || propMeta.reflect || foundDeserializer) {
|
|
261565
|
+
propMeta.attribute = getAttributeName(propName, propOptions);
|
|
261526
261566
|
}
|
|
261527
261567
|
if (import_typescript51.default.isPropertyDeclaration(prop) && prop.initializer) {
|
|
261528
261568
|
propMeta.defaultValue = prop.initializer.getText();
|
|
@@ -261570,7 +261610,7 @@ var getReflect = (diagnostics, propDecorator, propOptions) => {
|
|
|
261570
261610
|
augmentDiagnosticWithNode(err2, propDecorator);
|
|
261571
261611
|
return propOptions.reflectToAttr;
|
|
261572
261612
|
}
|
|
261573
|
-
return
|
|
261613
|
+
return null;
|
|
261574
261614
|
};
|
|
261575
261615
|
var getComplexType2 = (typeChecker, node, type, program3) => {
|
|
261576
261616
|
const nodeType = node.type;
|
|
@@ -261698,19 +261738,58 @@ var parseWatchDecorator = (typeChecker, method, decoratorName) => {
|
|
|
261698
261738
|
});
|
|
261699
261739
|
};
|
|
261700
261740
|
|
|
261741
|
+
// src/compiler/transformers/decorators-to-static/serialize-decorators.ts
|
|
261742
|
+
var import_typescript54 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261743
|
+
var serializeDecoratorsToStatic = (typeChecker, decoratedProps, newMembers, decoratorName, translateType, propDecoratorName) => {
|
|
261744
|
+
const props = decoratedProps.filter((prop) => import_typescript54.default.isPropertyDeclaration(prop) || import_typescript54.default.isGetAccessor(prop)).flatMap((prop) => {
|
|
261745
|
+
var _a2;
|
|
261746
|
+
if ((_a2 = retrieveTsDecorators(prop)) == null ? void 0 : _a2.find(isDecoratorNamed(propDecoratorName))) {
|
|
261747
|
+
const { staticName } = tsPropDeclName(prop, typeChecker);
|
|
261748
|
+
return [staticName];
|
|
261749
|
+
}
|
|
261750
|
+
return [];
|
|
261751
|
+
});
|
|
261752
|
+
const serializers = decoratedProps.filter(import_typescript54.default.isMethodDeclaration).flatMap((method) => parseSerializeDecorator(typeChecker, method, decoratorName, props));
|
|
261753
|
+
if (serializers.length > 0) {
|
|
261754
|
+
if (translateType === "PropSerialize") {
|
|
261755
|
+
newMembers.push(createStaticGetter("serializers", convertValueToLiteral(serializers)));
|
|
261756
|
+
} else {
|
|
261757
|
+
newMembers.push(createStaticGetter("deserializers", convertValueToLiteral(serializers)));
|
|
261758
|
+
}
|
|
261759
|
+
}
|
|
261760
|
+
return serializers;
|
|
261761
|
+
};
|
|
261762
|
+
var parseSerializeDecorator = (typeChecker, method, decoratorName, props) => {
|
|
261763
|
+
var _a2;
|
|
261764
|
+
const methodName = method.name.getText();
|
|
261765
|
+
const decorators = (_a2 = retrieveTsDecorators(method)) != null ? _a2 : [];
|
|
261766
|
+
return decorators.filter(isDecoratorNamed(decoratorName)).flatMap((decorator3) => {
|
|
261767
|
+
const [propName] = getDecoratorParameters(decorator3, typeChecker);
|
|
261768
|
+
if (!props.includes(propName)) {
|
|
261769
|
+
return [];
|
|
261770
|
+
}
|
|
261771
|
+
return [
|
|
261772
|
+
{
|
|
261773
|
+
propName,
|
|
261774
|
+
methodName
|
|
261775
|
+
}
|
|
261776
|
+
];
|
|
261777
|
+
});
|
|
261778
|
+
};
|
|
261779
|
+
|
|
261701
261780
|
// src/compiler/transformers/decorators-to-static/convert-decorators.ts
|
|
261702
261781
|
var convertDecoratorsToStatic = (config, diagnostics, typeChecker, program3) => {
|
|
261703
261782
|
return (transformCtx) => {
|
|
261704
261783
|
let sourceFile;
|
|
261705
261784
|
const visit2 = (node) => {
|
|
261706
|
-
if (
|
|
261785
|
+
if (import_typescript55.default.isClassDeclaration(node)) {
|
|
261707
261786
|
return visitClassDeclaration(config, diagnostics, typeChecker, program3, node, sourceFile);
|
|
261708
261787
|
}
|
|
261709
|
-
return
|
|
261788
|
+
return import_typescript55.default.visitEachChild(node, visit2, transformCtx);
|
|
261710
261789
|
};
|
|
261711
261790
|
return (tsSourceFile) => {
|
|
261712
261791
|
sourceFile = tsSourceFile;
|
|
261713
|
-
return
|
|
261792
|
+
return import_typescript55.default.visitEachChild(tsSourceFile, visit2, transformCtx);
|
|
261714
261793
|
};
|
|
261715
261794
|
};
|
|
261716
261795
|
};
|
|
@@ -261738,13 +261817,32 @@ var visitClassDeclaration = (config, diagnostics, typeChecker, program3, classNo
|
|
|
261738
261817
|
);
|
|
261739
261818
|
}
|
|
261740
261819
|
if (decoratedMembers.length > 0) {
|
|
261820
|
+
const serializers = serializeDecoratorsToStatic(
|
|
261821
|
+
typeChecker,
|
|
261822
|
+
decoratedMembers,
|
|
261823
|
+
filteredMethodsAndFields,
|
|
261824
|
+
importAliasMap.get("PropSerialize"),
|
|
261825
|
+
"PropSerialize",
|
|
261826
|
+
importAliasMap.get("Prop")
|
|
261827
|
+
);
|
|
261828
|
+
const deserializers = serializeDecoratorsToStatic(
|
|
261829
|
+
typeChecker,
|
|
261830
|
+
decoratedMembers,
|
|
261831
|
+
filteredMethodsAndFields,
|
|
261832
|
+
importAliasMap.get("AttrDeserialize"),
|
|
261833
|
+
"AttrDeserialize",
|
|
261834
|
+
importAliasMap.get("Prop")
|
|
261835
|
+
);
|
|
261741
261836
|
propDecoratorsToStatic(
|
|
261837
|
+
config,
|
|
261742
261838
|
diagnostics,
|
|
261743
261839
|
decoratedMembers,
|
|
261744
261840
|
typeChecker,
|
|
261745
261841
|
program3,
|
|
261746
261842
|
filteredMethodsAndFields,
|
|
261747
|
-
importAliasMap.get("Prop")
|
|
261843
|
+
importAliasMap.get("Prop"),
|
|
261844
|
+
serializers,
|
|
261845
|
+
deserializers
|
|
261748
261846
|
);
|
|
261749
261847
|
stateDecoratorsToStatic(decoratedMembers, filteredMethodsAndFields, typeChecker, importAliasMap.get("State"));
|
|
261750
261848
|
eventDecoratorsToStatic(
|
|
@@ -261785,7 +261883,7 @@ var visitClassDeclaration = (config, diagnostics, typeChecker, program3, classNo
|
|
|
261785
261883
|
validateMethods(diagnostics, classMembers);
|
|
261786
261884
|
const currentDecorators = retrieveTsDecorators(classNode);
|
|
261787
261885
|
const updatedClassFields = updateConstructor(classNode, filteredMethodsAndFields, []);
|
|
261788
|
-
return
|
|
261886
|
+
return import_typescript55.default.factory.updateClassDeclaration(
|
|
261789
261887
|
classNode,
|
|
261790
261888
|
[
|
|
261791
261889
|
...(_b = filterDecorators(
|
|
@@ -261809,8 +261907,8 @@ var removeStencilMethodDecorators = (classMembers, diagnostics, importAliasMap)
|
|
|
261809
261907
|
MEMBER_DECORATORS_TO_REMOVE.map((decorator3) => importAliasMap.get(decorator3))
|
|
261810
261908
|
);
|
|
261811
261909
|
if (currentDecorators !== newDecorators) {
|
|
261812
|
-
if (
|
|
261813
|
-
return
|
|
261910
|
+
if (import_typescript55.default.isMethodDeclaration(member2)) {
|
|
261911
|
+
return import_typescript55.default.factory.updateMethodDeclaration(
|
|
261814
261912
|
member2,
|
|
261815
261913
|
[...newDecorators != null ? newDecorators : [], ...(_a2 = retrieveTsModifiers(member2)) != null ? _a2 : []],
|
|
261816
261914
|
member2.asteriskToken,
|
|
@@ -261821,8 +261919,8 @@ var removeStencilMethodDecorators = (classMembers, diagnostics, importAliasMap)
|
|
|
261821
261919
|
member2.type,
|
|
261822
261920
|
member2.body
|
|
261823
261921
|
);
|
|
261824
|
-
} else if (
|
|
261825
|
-
return
|
|
261922
|
+
} else if (import_typescript55.default.isGetAccessor(member2)) {
|
|
261923
|
+
return import_typescript55.default.factory.updateGetAccessorDeclaration(
|
|
261826
261924
|
member2,
|
|
261827
261925
|
[...newDecorators != null ? newDecorators : [], ...(_b = retrieveTsModifiers(member2)) != null ? _b : []],
|
|
261828
261926
|
member2.name,
|
|
@@ -261830,13 +261928,13 @@ var removeStencilMethodDecorators = (classMembers, diagnostics, importAliasMap)
|
|
|
261830
261928
|
member2.type,
|
|
261831
261929
|
member2.body
|
|
261832
261930
|
);
|
|
261833
|
-
} else if (
|
|
261931
|
+
} else if (import_typescript55.default.isSetAccessor(member2)) {
|
|
261834
261932
|
const err2 = buildError(diagnostics);
|
|
261835
261933
|
err2.messageText = "A get accessor should be decorated before a set accessor";
|
|
261836
261934
|
augmentDiagnosticWithNode(err2, member2);
|
|
261837
|
-
} else if (
|
|
261935
|
+
} else if (import_typescript55.default.isPropertyDeclaration(member2)) {
|
|
261838
261936
|
const modifiers = retrieveTsModifiers(member2);
|
|
261839
|
-
return
|
|
261937
|
+
return import_typescript55.default.factory.updatePropertyDeclaration(
|
|
261840
261938
|
member2,
|
|
261841
261939
|
[...newDecorators != null ? newDecorators : [], ...modifiers != null ? modifiers : []],
|
|
261842
261940
|
member2.name,
|
|
@@ -261856,13 +261954,13 @@ var removeStencilMethodDecorators = (classMembers, diagnostics, importAliasMap)
|
|
|
261856
261954
|
var filterDecorators = (decorators, excludeList) => {
|
|
261857
261955
|
if (decorators) {
|
|
261858
261956
|
const updatedDecoratorList = decorators.filter((dec) => {
|
|
261859
|
-
const decoratorName =
|
|
261957
|
+
const decoratorName = import_typescript55.default.isCallExpression(dec.expression) && import_typescript55.default.isIdentifier(dec.expression.expression) && dec.expression.expression.text;
|
|
261860
261958
|
return typeof decoratorName === "boolean" || !excludeList.includes(decoratorName);
|
|
261861
261959
|
});
|
|
261862
261960
|
if (updatedDecoratorList.length === 0) {
|
|
261863
261961
|
return void 0;
|
|
261864
261962
|
} else if (updatedDecoratorList.length !== decorators.length) {
|
|
261865
|
-
return
|
|
261963
|
+
return import_typescript55.default.factory.createNodeArray(updatedDecoratorList);
|
|
261866
261964
|
}
|
|
261867
261965
|
}
|
|
261868
261966
|
return decorators;
|
|
@@ -261870,22 +261968,22 @@ var filterDecorators = (decorators, excludeList) => {
|
|
|
261870
261968
|
|
|
261871
261969
|
// src/compiler/transformers/static-to-meta/parse-static.ts
|
|
261872
261970
|
var import_path51 = require("path");
|
|
261873
|
-
var
|
|
261971
|
+
var import_typescript64 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261874
261972
|
|
|
261875
261973
|
// src/compiler/transformers/static-to-meta/call-expression.ts
|
|
261876
|
-
var
|
|
261974
|
+
var import_typescript57 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261877
261975
|
|
|
261878
261976
|
// src/compiler/transformers/static-to-meta/vdom.ts
|
|
261879
|
-
var
|
|
261977
|
+
var import_typescript56 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261880
261978
|
var gatherVdomMeta = (m, args) => {
|
|
261881
261979
|
m.hasVdomRender = true;
|
|
261882
261980
|
const hTag = args[0];
|
|
261883
|
-
if (!
|
|
261981
|
+
if (!import_typescript56.default.isStringLiteral(hTag) && (!import_typescript56.default.isIdentifier(hTag) || hTag.text !== "Host")) {
|
|
261884
261982
|
m.hasVdomFunctional = true;
|
|
261885
261983
|
}
|
|
261886
261984
|
if (args.length > 1) {
|
|
261887
261985
|
const objectLiteral = args[1];
|
|
261888
|
-
if (
|
|
261986
|
+
if (import_typescript56.default.isCallExpression(objectLiteral) || import_typescript56.default.isIdentifier(objectLiteral)) {
|
|
261889
261987
|
m.hasVdomAttribute = true;
|
|
261890
261988
|
m.hasVdomClass = true;
|
|
261891
261989
|
m.hasVdomKey = true;
|
|
@@ -261894,10 +261992,10 @@ var gatherVdomMeta = (m, args) => {
|
|
|
261894
261992
|
m.hasVdomRef = true;
|
|
261895
261993
|
m.hasVdomStyle = true;
|
|
261896
261994
|
m.hasVdomXlink = true;
|
|
261897
|
-
} else if (
|
|
261995
|
+
} else if (import_typescript56.default.isObjectLiteralExpression(objectLiteral)) {
|
|
261898
261996
|
objectLiteral.properties.forEach((prop) => {
|
|
261899
261997
|
m.hasVdomAttribute = true;
|
|
261900
|
-
if (
|
|
261998
|
+
if (import_typescript56.default.isSpreadAssignment(prop) || import_typescript56.default.isComputedPropertyName(prop.name)) {
|
|
261901
261999
|
m.hasVdomClass = true;
|
|
261902
262000
|
m.hasVdomKey = true;
|
|
261903
262001
|
m.hasVdomListener = true;
|
|
@@ -261923,8 +262021,8 @@ var gatherVdomMeta = (m, args) => {
|
|
|
261923
262021
|
} else {
|
|
261924
262022
|
m.hasVdomPropOrAttr = true;
|
|
261925
262023
|
}
|
|
261926
|
-
|
|
261927
|
-
if (attrName === "part" &&
|
|
262024
|
+
import_typescript56.default.SyntaxKind.StringLiteral;
|
|
262025
|
+
if (attrName === "part" && import_typescript56.default.isPropertyAssignment(prop) && import_typescript56.default.isStringLiteral(prop.initializer)) {
|
|
261928
262026
|
m.htmlParts.push(
|
|
261929
262027
|
...prop.initializer.text.toLowerCase().split(" ").filter((part) => part.length > 0)
|
|
261930
262028
|
);
|
|
@@ -261937,7 +262035,7 @@ var gatherVdomMeta = (m, args) => {
|
|
|
261937
262035
|
if (!m.hasVdomText) {
|
|
261938
262036
|
for (let i = 2; i < args.length; i++) {
|
|
261939
262037
|
const arg = args[i];
|
|
261940
|
-
if (!
|
|
262038
|
+
if (!import_typescript56.default.isCallExpression(arg) || !import_typescript56.default.isIdentifier(arg.expression) || arg.expression.text !== "h") {
|
|
261941
262039
|
m.hasVdomText = true;
|
|
261942
262040
|
break;
|
|
261943
262041
|
}
|
|
@@ -261948,11 +262046,11 @@ var gatherVdomMeta = (m, args) => {
|
|
|
261948
262046
|
// src/compiler/transformers/static-to-meta/call-expression.ts
|
|
261949
262047
|
var parseCallExpression = (m, node) => {
|
|
261950
262048
|
if (node.arguments != null && node.arguments.length > 0) {
|
|
261951
|
-
if (
|
|
262049
|
+
if (import_typescript57.default.isIdentifier(node.expression)) {
|
|
261952
262050
|
visitCallExpressionArgs(m, node.expression, node.arguments);
|
|
261953
|
-
} else if (
|
|
262051
|
+
} else if (import_typescript57.default.isPropertyAccessExpression(node.expression)) {
|
|
261954
262052
|
const n3 = node.expression.name;
|
|
261955
|
-
if (
|
|
262053
|
+
if (import_typescript57.default.isIdentifier(n3) && n3) {
|
|
261956
262054
|
visitCallExpressionArgs(m, n3, node.arguments);
|
|
261957
262055
|
}
|
|
261958
262056
|
}
|
|
@@ -261969,7 +262067,7 @@ var visitCallExpressionArgs = (m, callExpressionName, args) => {
|
|
|
261969
262067
|
visitCallExpressionArg(m, args[1]);
|
|
261970
262068
|
} else if (fnName === "require" && args.length > 0 && m.originalImports) {
|
|
261971
262069
|
const arg = args[0];
|
|
261972
|
-
if (
|
|
262070
|
+
if (import_typescript57.default.isStringLiteral(arg)) {
|
|
261973
262071
|
if (!m.originalImports.includes(arg.text)) {
|
|
261974
262072
|
m.originalImports.push(arg.text);
|
|
261975
262073
|
}
|
|
@@ -261977,7 +262075,7 @@ var visitCallExpressionArgs = (m, callExpressionName, args) => {
|
|
|
261977
262075
|
}
|
|
261978
262076
|
};
|
|
261979
262077
|
var visitCallExpressionArg = (m, arg) => {
|
|
261980
|
-
if (
|
|
262078
|
+
if (import_typescript57.default.isStringLiteral(arg)) {
|
|
261981
262079
|
let tag = arg.text;
|
|
261982
262080
|
if (typeof tag === "string") {
|
|
261983
262081
|
tag = tag.toLowerCase();
|
|
@@ -261991,15 +262089,15 @@ var visitCallExpressionArg = (m, arg) => {
|
|
|
261991
262089
|
|
|
261992
262090
|
// src/compiler/transformers/static-to-meta/component.ts
|
|
261993
262091
|
var import_path47 = require("path");
|
|
261994
|
-
var
|
|
262092
|
+
var import_typescript61 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261995
262093
|
|
|
261996
262094
|
// src/compiler/transformers/add-component-meta-static.ts
|
|
261997
|
-
var
|
|
262095
|
+
var import_typescript58 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261998
262096
|
var addComponentMetaStatic = (cmpNode, cmpMeta) => {
|
|
261999
262097
|
const publicCompilerMeta = getPublicCompilerMeta(cmpMeta);
|
|
262000
262098
|
const cmpMetaStaticProp = createStaticGetter("COMPILER_META", convertValueToLiteral(publicCompilerMeta));
|
|
262001
262099
|
const classMembers = [...cmpNode.members, cmpMetaStaticProp];
|
|
262002
|
-
return
|
|
262100
|
+
return import_typescript58.default.factory.updateClassDeclaration(
|
|
262003
262101
|
cmpNode,
|
|
262004
262102
|
retrieveModifierLike(cmpNode),
|
|
262005
262103
|
cmpNode.name,
|
|
@@ -262039,6 +262137,12 @@ var setComponentBuildConditionals = (cmpMeta) => {
|
|
|
262039
262137
|
if (cmpMeta.watchers.length > 0) {
|
|
262040
262138
|
cmpMeta.hasWatchCallback = true;
|
|
262041
262139
|
}
|
|
262140
|
+
if (cmpMeta.serializers.length > 0) {
|
|
262141
|
+
cmpMeta.hasSerializer = true;
|
|
262142
|
+
}
|
|
262143
|
+
if (cmpMeta.deserializers.length > 0) {
|
|
262144
|
+
cmpMeta.hasDeserializer = true;
|
|
262145
|
+
}
|
|
262042
262146
|
if (cmpMeta.methods.length > 0) {
|
|
262043
262147
|
cmpMeta.hasMethod = true;
|
|
262044
262148
|
}
|
|
@@ -262064,7 +262168,7 @@ var setComponentBuildConditionals = (cmpMeta) => {
|
|
|
262064
262168
|
};
|
|
262065
262169
|
|
|
262066
262170
|
// src/compiler/transformers/detect-modern-prop-decls.ts
|
|
262067
|
-
var
|
|
262171
|
+
var import_typescript59 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262068
262172
|
var detectModernPropDeclarations = (classNode) => {
|
|
262069
262173
|
const parsedProps = getStaticValue(classNode.members, "properties");
|
|
262070
262174
|
const parsedStates = getStaticValue(classNode.members, "states");
|
|
@@ -262076,7 +262180,7 @@ var detectModernPropDeclarations = (classNode) => {
|
|
|
262076
262180
|
for (const [propName, meta] of members) {
|
|
262077
262181
|
const dynamicPropName = meta.ogPropName || "";
|
|
262078
262182
|
const prop = classNode.members.find((m) => {
|
|
262079
|
-
return
|
|
262183
|
+
return import_typescript59.default.isPropertyDeclaration(m) && (import_typescript59.default.isComputedPropertyName(m.name) && m.name.expression.getText() === dynamicPropName || m.name.getText() === propName);
|
|
262080
262184
|
});
|
|
262081
262185
|
if (!prop) continue;
|
|
262082
262186
|
hasModernPropertyDecls = true;
|
|
@@ -262273,7 +262377,7 @@ var parseStyleIdentifier = (parsedStyle, modeName) => {
|
|
|
262273
262377
|
};
|
|
262274
262378
|
|
|
262275
262379
|
// src/compiler/transformers/static-to-meta/class-extension.ts
|
|
262276
|
-
var
|
|
262380
|
+
var import_typescript60 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262277
262381
|
|
|
262278
262382
|
// src/compiler/transformers/static-to-meta/events.ts
|
|
262279
262383
|
var parseStaticEvents = (staticMembers) => {
|
|
@@ -262393,6 +262497,20 @@ var parseStaticWatchers = (staticMembers) => {
|
|
|
262393
262497
|
});
|
|
262394
262498
|
};
|
|
262395
262499
|
|
|
262500
|
+
// src/compiler/transformers/static-to-meta/serializers.ts
|
|
262501
|
+
var parseStaticSerializers = (staticMembers, translateType) => {
|
|
262502
|
+
const parsedSerializers = getStaticValue(staticMembers, translateType);
|
|
262503
|
+
if (!parsedSerializers || parsedSerializers.length === 0) {
|
|
262504
|
+
return [];
|
|
262505
|
+
}
|
|
262506
|
+
return parsedSerializers.map((parsedSerial) => {
|
|
262507
|
+
return {
|
|
262508
|
+
propName: parsedSerial.propName,
|
|
262509
|
+
methodName: parsedSerial.methodName
|
|
262510
|
+
};
|
|
262511
|
+
});
|
|
262512
|
+
};
|
|
262513
|
+
|
|
262396
262514
|
// src/compiler/transformers/static-to-meta/class-extension.ts
|
|
262397
262515
|
var deDupeMembers = (dedupeMembers, staticMembers) => {
|
|
262398
262516
|
return dedupeMembers.filter(
|
|
@@ -262407,11 +262525,11 @@ var deDupeMembers = (dedupeMembers, staticMembers) => {
|
|
|
262407
262525
|
function findClassWalk(node, name) {
|
|
262408
262526
|
var _a2;
|
|
262409
262527
|
if (!node) return void 0;
|
|
262410
|
-
if (node &&
|
|
262528
|
+
if (node && import_typescript60.default.isClassDeclaration(node) && (!name || ((_a2 = node.name) == null ? void 0 : _a2.text) === name)) {
|
|
262411
262529
|
return node;
|
|
262412
262530
|
}
|
|
262413
262531
|
let found2;
|
|
262414
|
-
|
|
262532
|
+
import_typescript60.default.forEachChild(node, (child) => {
|
|
262415
262533
|
if (found2) return;
|
|
262416
262534
|
const result2 = findClassWalk(child, name);
|
|
262417
262535
|
if (result2) found2 = result2;
|
|
@@ -262421,15 +262539,15 @@ function findClassWalk(node, name) {
|
|
|
262421
262539
|
function matchesNamedDeclaration(name) {
|
|
262422
262540
|
return function(stmt) {
|
|
262423
262541
|
var _a2, _b;
|
|
262424
|
-
if (
|
|
262542
|
+
if (import_typescript60.default.isClassDeclaration(stmt) && ((_a2 = stmt.name) == null ? void 0 : _a2.text) === name) {
|
|
262425
262543
|
return true;
|
|
262426
262544
|
}
|
|
262427
|
-
if (
|
|
262545
|
+
if (import_typescript60.default.isFunctionDeclaration(stmt) && ((_b = stmt.name) == null ? void 0 : _b.text) === name) {
|
|
262428
262546
|
return true;
|
|
262429
262547
|
}
|
|
262430
|
-
if (
|
|
262548
|
+
if (import_typescript60.default.isVariableStatement(stmt)) {
|
|
262431
262549
|
for (const decl of stmt.declarationList.declarations) {
|
|
262432
|
-
if (
|
|
262550
|
+
if (import_typescript60.default.isIdentifier(decl.name) && decl.name.text === name) {
|
|
262433
262551
|
return true;
|
|
262434
262552
|
}
|
|
262435
262553
|
}
|
|
@@ -262437,18 +262555,18 @@ function matchesNamedDeclaration(name) {
|
|
|
262437
262555
|
return false;
|
|
262438
262556
|
};
|
|
262439
262557
|
}
|
|
262440
|
-
function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, typeChecker, buildCtx) {
|
|
262558
|
+
function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, typeChecker, buildCtx, ogModule) {
|
|
262441
262559
|
const hasHeritageClauses = classDeclaration3.heritageClauses;
|
|
262442
262560
|
if (!(hasHeritageClauses == null ? void 0 : hasHeritageClauses.length)) return dependentClasses;
|
|
262443
|
-
const extendsClause = hasHeritageClauses.find((clause) => clause.token ===
|
|
262561
|
+
const extendsClause = hasHeritageClauses.find((clause) => clause.token === import_typescript60.default.SyntaxKind.ExtendsKeyword);
|
|
262444
262562
|
if (!extendsClause) return dependentClasses;
|
|
262445
262563
|
let classIdentifiers = [];
|
|
262446
262564
|
let foundClassDeclaration;
|
|
262447
262565
|
let keepLooking = true;
|
|
262448
262566
|
extendsClause.types.forEach((type) => {
|
|
262449
|
-
if (
|
|
262450
|
-
classIdentifiers = type.expression.arguments.filter(
|
|
262451
|
-
} else if (
|
|
262567
|
+
if (import_typescript60.default.isExpressionWithTypeArguments(type) && import_typescript60.default.isCallExpression(type.expression) && type.expression.expression.getText() === "Mixin") {
|
|
262568
|
+
classIdentifiers = type.expression.arguments.filter(import_typescript60.default.isIdentifier);
|
|
262569
|
+
} else if (import_typescript60.default.isIdentifier(type.expression)) {
|
|
262452
262570
|
classIdentifiers = [type.expression];
|
|
262453
262571
|
}
|
|
262454
262572
|
});
|
|
@@ -262457,7 +262575,7 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262457
262575
|
try {
|
|
262458
262576
|
const symbol = typeChecker.getSymbolAtLocation(extendee);
|
|
262459
262577
|
const aliasedSymbol = symbol ? typeChecker.getAliasedSymbol(symbol) : void 0;
|
|
262460
|
-
foundClassDeclaration = (_a2 = aliasedSymbol == null ? void 0 : aliasedSymbol.declarations) == null ? void 0 : _a2.find(
|
|
262578
|
+
foundClassDeclaration = (_a2 = aliasedSymbol == null ? void 0 : aliasedSymbol.declarations) == null ? void 0 : _a2.find(import_typescript60.default.isClassDeclaration);
|
|
262461
262579
|
if (!foundClassDeclaration) {
|
|
262462
262580
|
const node = (_b = aliasedSymbol == null ? void 0 : aliasedSymbol.declarations) == null ? void 0 : _b[0];
|
|
262463
262581
|
foundClassDeclaration = findClassWalk(node);
|
|
@@ -262471,16 +262589,22 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262471
262589
|
if (sourceClass) {
|
|
262472
262590
|
dependentClasses.push({ classNode: sourceClass, fileName: source.fileName });
|
|
262473
262591
|
if (keepLooking) {
|
|
262474
|
-
buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx);
|
|
262592
|
+
buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx, ogModule);
|
|
262475
262593
|
}
|
|
262476
262594
|
}
|
|
262477
262595
|
}
|
|
262478
262596
|
}
|
|
262479
262597
|
} catch (_e) {
|
|
262480
|
-
|
|
262598
|
+
let currentSource = classDeclaration3.getSourceFile();
|
|
262599
|
+
let matchedStatement;
|
|
262600
|
+
if (!currentSource) {
|
|
262601
|
+
currentSource = ogModule == null ? void 0 : ogModule.staticSourceFile;
|
|
262602
|
+
matchedStatement = findClassWalk(currentSource, extendee.getText());
|
|
262603
|
+
} else {
|
|
262604
|
+
matchedStatement = currentSource.statements.find(matchesNamedDeclaration(extendee.getText()));
|
|
262605
|
+
}
|
|
262481
262606
|
if (!currentSource) return;
|
|
262482
|
-
|
|
262483
|
-
if (matchedStatement && import_typescript59.default.isClassDeclaration(matchedStatement)) {
|
|
262607
|
+
if (matchedStatement && import_typescript60.default.isClassDeclaration(matchedStatement)) {
|
|
262484
262608
|
foundClassDeclaration = matchedStatement;
|
|
262485
262609
|
} else if (matchedStatement) {
|
|
262486
262610
|
foundClassDeclaration = findClassWalk(matchedStatement);
|
|
@@ -262489,14 +262613,14 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262489
262613
|
if (foundClassDeclaration && !dependentClasses.some((dc) => dc.classNode === foundClassDeclaration)) {
|
|
262490
262614
|
dependentClasses.push({ classNode: foundClassDeclaration, fileName: currentSource.fileName });
|
|
262491
262615
|
if (keepLooking) {
|
|
262492
|
-
buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx);
|
|
262616
|
+
buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx, ogModule);
|
|
262493
262617
|
}
|
|
262494
262618
|
return;
|
|
262495
262619
|
}
|
|
262496
|
-
const importStatements = currentSource.statements.filter(
|
|
262620
|
+
const importStatements = currentSource.statements.filter(import_typescript60.default.isImportDeclaration);
|
|
262497
262621
|
importStatements.forEach((statement) => {
|
|
262498
262622
|
var _a3, _b2, _c2;
|
|
262499
|
-
if (((_a3 = statement.importClause) == null ? void 0 : _a3.namedBindings) &&
|
|
262623
|
+
if (((_a3 = statement.importClause) == null ? void 0 : _a3.namedBindings) && import_typescript60.default.isNamedImports((_b2 = statement.importClause) == null ? void 0 : _b2.namedBindings)) {
|
|
262500
262624
|
(_c2 = statement.importClause) == null ? void 0 : _c2.namedBindings.elements.forEach((element) => {
|
|
262501
262625
|
var _a4;
|
|
262502
262626
|
if (element.name.getText() === extendee.getText()) {
|
|
@@ -262512,7 +262636,7 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262512
262636
|
const matchedStatement2 = (foundModule == null ? void 0 : foundModule.staticSourceFile).statements.find(
|
|
262513
262637
|
matchesNamedDeclaration(className)
|
|
262514
262638
|
);
|
|
262515
|
-
foundClassDeclaration = matchedStatement2 ?
|
|
262639
|
+
foundClassDeclaration = matchedStatement2 ? import_typescript60.default.isClassDeclaration(matchedStatement2) ? matchedStatement2 : void 0 : void 0;
|
|
262516
262640
|
if (!foundClassDeclaration && matchedStatement2) {
|
|
262517
262641
|
foundClassDeclaration = findClassWalk(matchedStatement2);
|
|
262518
262642
|
keepLooking = false;
|
|
@@ -262520,7 +262644,14 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262520
262644
|
if (foundClassDeclaration && !dependentClasses.some((dc) => dc.classNode === foundClassDeclaration)) {
|
|
262521
262645
|
dependentClasses.push({ classNode: foundClassDeclaration, fileName: currentSource.fileName });
|
|
262522
262646
|
if (keepLooking) {
|
|
262523
|
-
buildExtendsTree(
|
|
262647
|
+
buildExtendsTree(
|
|
262648
|
+
compilerCtx,
|
|
262649
|
+
foundClassDeclaration,
|
|
262650
|
+
dependentClasses,
|
|
262651
|
+
typeChecker,
|
|
262652
|
+
buildCtx,
|
|
262653
|
+
ogModule
|
|
262654
|
+
);
|
|
262524
262655
|
}
|
|
262525
262656
|
return;
|
|
262526
262657
|
}
|
|
@@ -262533,8 +262664,8 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262533
262664
|
});
|
|
262534
262665
|
return dependentClasses;
|
|
262535
262666
|
}
|
|
262536
|
-
function mergeExtendedClassMeta(compilerCtx, typeChecker, buildCtx, cmpNode, staticMembers) {
|
|
262537
|
-
const tree = buildExtendsTree(compilerCtx, cmpNode, [], typeChecker, buildCtx);
|
|
262667
|
+
function mergeExtendedClassMeta(compilerCtx, typeChecker, buildCtx, cmpNode, staticMembers, moduleFile) {
|
|
262668
|
+
const tree = buildExtendsTree(compilerCtx, cmpNode, [], typeChecker, buildCtx, moduleFile);
|
|
262538
262669
|
let hasMixin = false;
|
|
262539
262670
|
let doesExtend = false;
|
|
262540
262671
|
let properties = parseStaticProps(staticMembers);
|
|
@@ -262543,36 +262674,59 @@ function mergeExtendedClassMeta(compilerCtx, typeChecker, buildCtx, cmpNode, sta
|
|
|
262543
262674
|
let listeners = parseStaticListeners(staticMembers);
|
|
262544
262675
|
let events = parseStaticEvents(staticMembers);
|
|
262545
262676
|
let watchers = parseStaticWatchers(staticMembers);
|
|
262546
|
-
let classMethods = cmpNode.members.filter(
|
|
262677
|
+
let classMethods = cmpNode.members.filter(import_typescript60.default.isMethodDeclaration);
|
|
262678
|
+
let serializers = parseStaticSerializers(staticMembers, "serializers");
|
|
262679
|
+
let deserializers = parseStaticSerializers(staticMembers, "deserializers");
|
|
262547
262680
|
tree.forEach((extendedClass) => {
|
|
262548
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
262681
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
262549
262682
|
const extendedStaticMembers = extendedClass.classNode.members.filter(isStaticGetter);
|
|
262550
262683
|
const mixinProps = (_a2 = parseStaticProps(extendedStaticMembers)) != null ? _a2 : [];
|
|
262551
262684
|
const mixinStates = (_b = parseStaticStates(extendedStaticMembers)) != null ? _b : [];
|
|
262552
262685
|
const mixinMethods = (_c = parseStaticMethods(extendedStaticMembers)) != null ? _c : [];
|
|
262553
|
-
const
|
|
262686
|
+
const mixinEvents = (_d = parseStaticEvents(extendedStaticMembers)) != null ? _d : [];
|
|
262687
|
+
const isMixin = mixinProps.length > 0 || mixinStates.length > 0 || mixinMethods.length > 0 || mixinEvents.length > 0;
|
|
262554
262688
|
const module2 = compilerCtx.moduleMap.get(extendedClass.fileName);
|
|
262555
262689
|
if (!module2) return;
|
|
262556
262690
|
module2.isMixin = isMixin;
|
|
262557
262691
|
module2.isExtended = true;
|
|
262558
262692
|
doesExtend = true;
|
|
262559
|
-
if (
|
|
262693
|
+
if ((mixinProps.length > 0 || mixinStates.length > 0) && !detectModernPropDeclarations(extendedClass.classNode)) {
|
|
262560
262694
|
const err2 = buildWarn(buildCtx.diagnostics);
|
|
262561
|
-
const target = (
|
|
262695
|
+
const target = (_e = buildCtx.config.tsCompilerOptions) == null ? void 0 : _e.target;
|
|
262562
262696
|
err2.messageText = `Component classes can only extend from other Stencil decorated base classes when targetting more modern JavaScript (ES2022 and above).
|
|
262563
|
-
${target ? `Your current TypeScript configuration is set to target \`${
|
|
262697
|
+
${target ? `Your current TypeScript configuration is set to target \`${import_typescript60.default.ScriptTarget[target]}\`.` : ""} Please amend your tsconfig.json.`;
|
|
262564
262698
|
if (!buildCtx.config._isTesting) augmentDiagnosticWithNode(err2, extendedClass.classNode);
|
|
262565
262699
|
}
|
|
262566
262700
|
properties = [...deDupeMembers(mixinProps, properties), ...properties];
|
|
262567
262701
|
states = [...deDupeMembers(mixinStates, states), ...states];
|
|
262568
262702
|
methods = [...deDupeMembers(mixinMethods, methods), ...methods];
|
|
262569
|
-
|
|
262570
|
-
|
|
262703
|
+
events = [...deDupeMembers(mixinEvents, events), ...events];
|
|
262704
|
+
listeners = [...deDupeMembers((_f = parseStaticListeners(extendedStaticMembers)) != null ? _f : [], listeners), ...listeners];
|
|
262571
262705
|
watchers = [...deDupeMembers((_g = parseStaticWatchers(extendedStaticMembers)) != null ? _g : [], watchers), ...watchers];
|
|
262572
|
-
|
|
262706
|
+
serializers = [
|
|
262707
|
+
...deDupeMembers((_h = parseStaticSerializers(extendedStaticMembers, "serializers")) != null ? _h : [], serializers),
|
|
262708
|
+
...serializers
|
|
262709
|
+
];
|
|
262710
|
+
deserializers = [
|
|
262711
|
+
...deDupeMembers((_i = parseStaticSerializers(extendedStaticMembers, "deserializers")) != null ? _i : [], deserializers),
|
|
262712
|
+
...deserializers
|
|
262713
|
+
];
|
|
262714
|
+
classMethods = [...classMethods, ...(_j = extendedClass.classNode.members.filter(import_typescript60.default.isMethodDeclaration)) != null ? _j : []];
|
|
262573
262715
|
if (isMixin) hasMixin = true;
|
|
262574
262716
|
});
|
|
262575
|
-
return {
|
|
262717
|
+
return {
|
|
262718
|
+
hasMixin,
|
|
262719
|
+
doesExtend,
|
|
262720
|
+
properties,
|
|
262721
|
+
states,
|
|
262722
|
+
methods,
|
|
262723
|
+
listeners,
|
|
262724
|
+
events,
|
|
262725
|
+
watchers,
|
|
262726
|
+
classMethods,
|
|
262727
|
+
serializers,
|
|
262728
|
+
deserializers
|
|
262729
|
+
};
|
|
262576
262730
|
}
|
|
262577
262731
|
|
|
262578
262732
|
// src/compiler/transformers/static-to-meta/component.ts
|
|
@@ -262592,13 +262746,18 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, b
|
|
|
262592
262746
|
if (tagName == null) {
|
|
262593
262747
|
return cmpNode;
|
|
262594
262748
|
}
|
|
262595
|
-
const {
|
|
262596
|
-
|
|
262597
|
-
|
|
262598
|
-
|
|
262599
|
-
|
|
262600
|
-
|
|
262601
|
-
|
|
262749
|
+
const {
|
|
262750
|
+
doesExtend,
|
|
262751
|
+
properties,
|
|
262752
|
+
states,
|
|
262753
|
+
methods,
|
|
262754
|
+
listeners,
|
|
262755
|
+
events,
|
|
262756
|
+
watchers,
|
|
262757
|
+
classMethods,
|
|
262758
|
+
serializers,
|
|
262759
|
+
deserializers
|
|
262760
|
+
} = mergeExtendedClassMeta(compilerCtx, typeChecker, buildCtx, cmpNode, staticMembers, moduleFile);
|
|
262602
262761
|
const symbol = typeChecker ? typeChecker.getSymbolAtLocation(cmpNode.name) : void 0;
|
|
262603
262762
|
const docs = serializeSymbol(typeChecker, symbol);
|
|
262604
262763
|
const isCollectionDependency = moduleFile.isCollectionDependency;
|
|
@@ -262629,6 +262788,8 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, b
|
|
|
262629
262788
|
jsFilePath: moduleFile.jsFilePath,
|
|
262630
262789
|
sourceFilePath: moduleFile.sourceFilePath,
|
|
262631
262790
|
sourceMapPath: moduleFile.sourceMapPath,
|
|
262791
|
+
serializers,
|
|
262792
|
+
deserializers,
|
|
262632
262793
|
hasAttributeChangedCallbackFn: false,
|
|
262633
262794
|
hasComponentWillLoadFn: false,
|
|
262634
262795
|
hasComponentDidLoadFn: false,
|
|
@@ -262638,6 +262799,7 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, b
|
|
|
262638
262799
|
hasComponentWillRenderFn: false,
|
|
262639
262800
|
hasComponentDidRenderFn: false,
|
|
262640
262801
|
hasConnectedCallbackFn: false,
|
|
262802
|
+
hasDeserializer: false,
|
|
262641
262803
|
hasDisconnectedCallbackFn: false,
|
|
262642
262804
|
hasElement: false,
|
|
262643
262805
|
hasEvent: false,
|
|
@@ -262660,6 +262822,7 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, b
|
|
|
262660
262822
|
hasPropMutable: false,
|
|
262661
262823
|
hasReflect: false,
|
|
262662
262824
|
hasRenderFn: false,
|
|
262825
|
+
hasSerializer: false,
|
|
262663
262826
|
hasState: false,
|
|
262664
262827
|
hasStyle: false,
|
|
262665
262828
|
hasVdomAttribute: false,
|
|
@@ -262687,17 +262850,18 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, b
|
|
|
262687
262850
|
};
|
|
262688
262851
|
const visitComponentChildNode = (node, buildCtx2) => {
|
|
262689
262852
|
validateComponentMembers(node, buildCtx2);
|
|
262690
|
-
if (
|
|
262853
|
+
if (import_typescript61.default.isCallExpression(node)) {
|
|
262691
262854
|
parseCallExpression(cmp, node);
|
|
262692
|
-
} else if (
|
|
262855
|
+
} else if (import_typescript61.default.isStringLiteral(node)) {
|
|
262693
262856
|
parseStringLiteral(cmp, node);
|
|
262694
262857
|
}
|
|
262695
262858
|
node.forEachChild((child) => visitComponentChildNode(child, buildCtx2));
|
|
262696
262859
|
};
|
|
262697
262860
|
visitComponentChildNode(cmpNode, buildCtx);
|
|
262698
262861
|
parseClassMethods(classMethods, cmp);
|
|
262699
|
-
|
|
262700
|
-
|
|
262862
|
+
if (!moduleFile.isCollectionDependency) {
|
|
262863
|
+
cmp.hasModernPropertyDecls = detectModernPropDeclarations(cmpNode);
|
|
262864
|
+
}
|
|
262701
262865
|
cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
|
|
262702
262866
|
cmp.htmlTagNames = unique(cmp.htmlTagNames);
|
|
262703
262867
|
cmp.potentialCmpRefs = unique(cmp.potentialCmpRefs);
|
|
@@ -262718,15 +262882,15 @@ var validateComponentMembers = (node, buildCtx) => {
|
|
|
262718
262882
|
/**
|
|
262719
262883
|
* the component has a getter called "shadowRoot"
|
|
262720
262884
|
*/
|
|
262721
|
-
|
|
262885
|
+
import_typescript61.default.isGetAccessorDeclaration(node) && import_typescript61.default.isIdentifier(node.name) && typeof node.name.escapedText === "string" && BLACKLISTED_COMPONENT_METHODS.includes(node.name.escapedText) && /**
|
|
262722
262886
|
* the parent node is a class declaration
|
|
262723
262887
|
*/
|
|
262724
|
-
node.parent &&
|
|
262888
|
+
node.parent && import_typescript61.default.isClassDeclaration(node.parent)
|
|
262725
262889
|
) {
|
|
262726
262890
|
const propName = node.name.escapedText;
|
|
262727
|
-
const decorator3 =
|
|
262728
|
-
if (
|
|
262729
|
-
(prop) =>
|
|
262891
|
+
const decorator3 = import_typescript61.default.getDecorators(node.parent)[0];
|
|
262892
|
+
if (import_typescript61.default.isCallExpression(decorator3.expression) && decorator3.expression.arguments.length === 1 && import_typescript61.default.isObjectLiteralExpression(decorator3.expression.arguments[0]) && decorator3.expression.arguments[0].properties.some(
|
|
262893
|
+
(prop) => import_typescript61.default.isPropertyAssignment(prop) && prop.name.getText() === "tag"
|
|
262730
262894
|
)) {
|
|
262731
262895
|
const componentName = node.parent.name.getText();
|
|
262732
262896
|
const err2 = buildWarn(buildCtx.diagnostics);
|
|
@@ -262772,7 +262936,7 @@ var parseAssetsDirs = (staticMembers, componentFilePath) => {
|
|
|
262772
262936
|
|
|
262773
262937
|
// src/compiler/transformers/static-to-meta/import.ts
|
|
262774
262938
|
var import_path50 = require("path");
|
|
262775
|
-
var
|
|
262939
|
+
var import_typescript63 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262776
262940
|
|
|
262777
262941
|
// src/compiler/transformers/collections/add-external-import.ts
|
|
262778
262942
|
var import_path49 = require("path");
|
|
@@ -262781,7 +262945,7 @@ var import_path49 = require("path");
|
|
|
262781
262945
|
var import_path48 = require("path");
|
|
262782
262946
|
|
|
262783
262947
|
// src/compiler/transformers/collections/parse-collection-components.ts
|
|
262784
|
-
var
|
|
262948
|
+
var import_typescript62 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262785
262949
|
var parseCollectionComponents = (config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection) => {
|
|
262786
262950
|
if (collectionManifest.entries) {
|
|
262787
262951
|
collectionManifest.entries.forEach((entryPath) => {
|
|
@@ -262792,7 +262956,7 @@ var parseCollectionComponents = (config, compilerCtx, buildCtx, collectionDir, c
|
|
|
262792
262956
|
};
|
|
262793
262957
|
var transpileCollectionModule = (config, compilerCtx, buildCtx, collection, inputFileName) => {
|
|
262794
262958
|
const sourceText = compilerCtx.fs.readFileSync(inputFileName);
|
|
262795
|
-
const sourceFile =
|
|
262959
|
+
const sourceFile = import_typescript62.default.createSourceFile(inputFileName, sourceText, import_typescript62.default.ScriptTarget.ES2017, true, import_typescript62.default.ScriptKind.JS);
|
|
262796
262960
|
return updateModule(config, compilerCtx, buildCtx, sourceFile, sourceText, inputFileName, void 0, collection);
|
|
262797
262961
|
};
|
|
262798
262962
|
|
|
@@ -262940,7 +263104,7 @@ var addExternalImport = (config, compilerCtx, buildCtx, moduleFile, containingFi
|
|
|
262940
263104
|
|
|
262941
263105
|
// src/compiler/transformers/static-to-meta/import.ts
|
|
262942
263106
|
var parseModuleImport = (config, compilerCtx, buildCtx, moduleFile, dirPath, importNode, resolveCollections) => {
|
|
262943
|
-
if (importNode.moduleSpecifier &&
|
|
263107
|
+
if (importNode.moduleSpecifier && import_typescript63.default.isStringLiteral(importNode.moduleSpecifier)) {
|
|
262944
263108
|
let importPath = importNode.moduleSpecifier.text;
|
|
262945
263109
|
if (!moduleFile.originalImports.includes(importPath)) {
|
|
262946
263110
|
moduleFile.originalImports.push(importPath);
|
|
@@ -262988,15 +263152,15 @@ var updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText,
|
|
|
262988
263152
|
compilerCtx.moduleMap.set(moduleFileKey, moduleFile);
|
|
262989
263153
|
compilerCtx.changedModules.add(moduleFile.sourceFilePath);
|
|
262990
263154
|
const visitNode = (node) => {
|
|
262991
|
-
if (
|
|
263155
|
+
if (import_typescript64.default.isClassDeclaration(node)) {
|
|
262992
263156
|
parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, buildCtx, void 0);
|
|
262993
263157
|
return;
|
|
262994
|
-
} else if (
|
|
263158
|
+
} else if (import_typescript64.default.isImportDeclaration(node)) {
|
|
262995
263159
|
parseModuleImport(config, compilerCtx, buildCtx, moduleFile, srcDirPath, node, true);
|
|
262996
263160
|
return;
|
|
262997
|
-
} else if (
|
|
263161
|
+
} else if (import_typescript64.default.isCallExpression(node)) {
|
|
262998
263162
|
parseCallExpression(moduleFile, node);
|
|
262999
|
-
} else if (
|
|
263163
|
+
} else if (import_typescript64.default.isStringLiteral(node)) {
|
|
263000
263164
|
parseStringLiteral(moduleFile, node);
|
|
263001
263165
|
}
|
|
263002
263166
|
node.forEachChild(visitNode);
|
|
@@ -263008,12 +263172,12 @@ var updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText,
|
|
|
263008
263172
|
}
|
|
263009
263173
|
visitNode(tsSourceFile);
|
|
263010
263174
|
if (moduleFile.cmps.length > 0) {
|
|
263011
|
-
moduleFile.staticSourceFile =
|
|
263175
|
+
moduleFile.staticSourceFile = import_typescript64.default.createSourceFile(
|
|
263012
263176
|
sourceFilePath,
|
|
263013
263177
|
sourceFileText,
|
|
263014
263178
|
tsSourceFile.languageVersion,
|
|
263015
263179
|
true,
|
|
263016
|
-
|
|
263180
|
+
import_typescript64.default.ScriptKind.JS
|
|
263017
263181
|
);
|
|
263018
263182
|
}
|
|
263019
263183
|
return moduleFile;
|
|
@@ -264257,14 +264421,14 @@ var isWatchIgnorePath = (config, path7) => {
|
|
|
264257
264421
|
};
|
|
264258
264422
|
|
|
264259
264423
|
// src/compiler/transpile/create-watch-program.ts
|
|
264260
|
-
var
|
|
264424
|
+
var import_typescript65 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
264261
264425
|
var createTsWatchProgram = async (config, buildCallback) => {
|
|
264262
264426
|
let isRunning = false;
|
|
264263
264427
|
let lastTsBuilder;
|
|
264264
264428
|
let timeoutId;
|
|
264265
264429
|
const optionsToExtend = getTsOptionsToExtend(config);
|
|
264266
264430
|
const tsWatchSys = {
|
|
264267
|
-
...
|
|
264431
|
+
...import_typescript65.default.sys,
|
|
264268
264432
|
/**
|
|
264269
264433
|
* Override the default `setTimeout` implementation in the {@link ts.System}. The reasoning
|
|
264270
264434
|
* behind this change is not explicitly clear, but this appears to be related to debouncing
|
|
@@ -264292,7 +264456,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
264292
264456
|
}
|
|
264293
264457
|
};
|
|
264294
264458
|
config.sys.addDestroy(() => tsWatchSys.clearTimeout(timeoutId));
|
|
264295
|
-
const tsWatchHost =
|
|
264459
|
+
const tsWatchHost = import_typescript65.default.createWatchCompilerHost(
|
|
264296
264460
|
// Use the TS config from the Stencil project
|
|
264297
264461
|
config.tsconfig,
|
|
264298
264462
|
optionsToExtend,
|
|
@@ -264300,7 +264464,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
264300
264464
|
// We use the `createEmitAndSemanticDiagnosticsBuilderProgram` as opposed to the
|
|
264301
264465
|
// `createSemanticDiagnosticsBuilderProgram` because we need our program to emit
|
|
264302
264466
|
// output files in addition to checking for errors
|
|
264303
|
-
|
|
264467
|
+
import_typescript65.default.createEmitAndSemanticDiagnosticsBuilderProgram,
|
|
264304
264468
|
// Add a callback to log out diagnostics as the program runs
|
|
264305
264469
|
(reportDiagnostic) => {
|
|
264306
264470
|
config.logger.debug("watch reportDiagnostic:" + reportDiagnostic.messageText);
|
|
@@ -264327,7 +264491,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
264327
264491
|
// Create the watch builder program instance and make it available on the
|
|
264328
264492
|
// returned object. This provides us an easy way to teardown the program
|
|
264329
264493
|
// down-the-road.
|
|
264330
|
-
program:
|
|
264494
|
+
program: import_typescript65.default.createWatchProgram(tsWatchHost),
|
|
264331
264495
|
// This will be called via a callback on the watch build whenever a file
|
|
264332
264496
|
// change is detected
|
|
264333
264497
|
rebuild: () => {
|
|
@@ -266384,7 +266548,7 @@ var extname9 = (str) => {
|
|
|
266384
266548
|
var SKIP_EXT = /* @__PURE__ */ new Set(["zip", "rar", "tar", "gz", "bz2", "png", "jpeg", "jpg", "gif", "pdf", "tiff", "psd"]);
|
|
266385
266549
|
|
|
266386
266550
|
// src/compiler/sys/node-require.ts
|
|
266387
|
-
var
|
|
266551
|
+
var import_typescript66 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
266388
266552
|
var nodeRequire = (id) => {
|
|
266389
266553
|
const results = {
|
|
266390
266554
|
module: void 0,
|
|
@@ -266399,13 +266563,13 @@ var nodeRequire = (id) => {
|
|
|
266399
266563
|
require.extensions[".ts"] = (module2, fileName) => {
|
|
266400
266564
|
let sourceText = fs2.readFileSync(fileName, "utf8");
|
|
266401
266565
|
if (fileName.endsWith(".ts")) {
|
|
266402
|
-
const tsResults =
|
|
266566
|
+
const tsResults = import_typescript66.default.transpileModule(sourceText, {
|
|
266403
266567
|
fileName,
|
|
266404
266568
|
compilerOptions: {
|
|
266405
|
-
module:
|
|
266406
|
-
moduleResolution:
|
|
266569
|
+
module: import_typescript66.default.ModuleKind.CommonJS,
|
|
266570
|
+
moduleResolution: import_typescript66.default.ModuleResolutionKind.NodeJs,
|
|
266407
266571
|
esModuleInterop: true,
|
|
266408
|
-
target:
|
|
266572
|
+
target: import_typescript66.default.ScriptTarget.ES2017,
|
|
266409
266573
|
allowJs: true
|
|
266410
266574
|
}
|
|
266411
266575
|
});
|
|
@@ -267207,7 +267371,7 @@ var createCompiler = async (userConfig) => {
|
|
|
267207
267371
|
const sys = config.sys;
|
|
267208
267372
|
const compilerCtx = new CompilerContext();
|
|
267209
267373
|
if (isFunction(config.sys.setupCompiler)) {
|
|
267210
|
-
config.sys.setupCompiler({ ts:
|
|
267374
|
+
config.sys.setupCompiler({ ts: import_typescript67.default });
|
|
267211
267375
|
}
|
|
267212
267376
|
compilerCtx.fs = createInMemoryFs(sys);
|
|
267213
267377
|
compilerCtx.cache = new Cache(config, createInMemoryFs(sys));
|
|
@@ -267241,7 +267405,7 @@ var import_path63 = require("path");
|
|
|
267241
267405
|
|
|
267242
267406
|
// src/compiler/sys/typescript/typescript-config.ts
|
|
267243
267407
|
var import_path62 = require("path");
|
|
267244
|
-
var
|
|
267408
|
+
var import_typescript68 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
267245
267409
|
var validateTsConfig = async (config, sys, init) => {
|
|
267246
267410
|
var _a2;
|
|
267247
267411
|
const tsconfig = {
|
|
@@ -267263,7 +267427,7 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
267263
267427
|
} else {
|
|
267264
267428
|
tsconfig.path = readTsConfig.path;
|
|
267265
267429
|
const host = {
|
|
267266
|
-
...
|
|
267430
|
+
...import_typescript68.default.sys,
|
|
267267
267431
|
readFile: (p) => {
|
|
267268
267432
|
if (p === tsconfig.path) {
|
|
267269
267433
|
return readTsConfig.content;
|
|
@@ -267274,7 +267438,7 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
267274
267438
|
fileExists: (p) => sys.accessSync(p),
|
|
267275
267439
|
onUnRecoverableConfigFileDiagnostic: (e) => console.error(e)
|
|
267276
267440
|
};
|
|
267277
|
-
const results =
|
|
267441
|
+
const results = import_typescript68.default.getParsedCommandLineOfConfigFile(tsconfig.path, {}, host);
|
|
267278
267442
|
if (results === void 0) {
|
|
267279
267443
|
throw "Encountered an error reading tsconfig!";
|
|
267280
267444
|
}
|
|
@@ -267318,12 +267482,12 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
267318
267482
|
}
|
|
267319
267483
|
if (results.options) {
|
|
267320
267484
|
tsconfig.compilerOptions = results.options;
|
|
267321
|
-
const target = (_a2 = tsconfig.compilerOptions.target) != null ? _a2 :
|
|
267322
|
-
if ([
|
|
267485
|
+
const target = (_a2 = tsconfig.compilerOptions.target) != null ? _a2 : import_typescript68.default.ScriptTarget.ES5;
|
|
267486
|
+
if ([import_typescript68.default.ScriptTarget.ES3, import_typescript68.default.ScriptTarget.ES5, import_typescript68.default.ScriptTarget.ES2015, import_typescript68.default.ScriptTarget.ES2016].includes(target)) {
|
|
267323
267487
|
const warn = buildWarn(tsconfig.diagnostics);
|
|
267324
267488
|
warn.messageText = `To improve bundling, it is always recommended to set the tsconfig.json \u201Ctarget\u201D setting to "es2017". Note that the compiler will automatically handle transpilation for ES5-only browsers.`;
|
|
267325
267489
|
}
|
|
267326
|
-
if (tsconfig.compilerOptions.module !==
|
|
267490
|
+
if (tsconfig.compilerOptions.module !== import_typescript68.default.ModuleKind.ESNext && !config._isTesting) {
|
|
267327
267491
|
const warn = buildWarn(tsconfig.diagnostics);
|
|
267328
267492
|
warn.messageText = `To improve bundling, it is always recommended to set the tsconfig.json \u201Cmodule\u201D setting to \u201Cesnext\u201D. Note that the compiler will automatically handle bundling both modern and legacy builds.`;
|
|
267329
267493
|
}
|
|
@@ -268720,26 +268884,26 @@ var VALID_TARGET = /* @__PURE__ */ new Set(["latest", "esnext", "es2020", "es201
|
|
|
268720
268884
|
|
|
268721
268885
|
// src/compiler/transpile/transpile-module.ts
|
|
268722
268886
|
var import_sys_api_node5 = require("../sys/node/index.js");
|
|
268723
|
-
var
|
|
268887
|
+
var import_typescript70 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
268724
268888
|
|
|
268725
268889
|
// src/compiler/transformers/static-to-meta/visitor.ts
|
|
268726
268890
|
var import_path67 = require("path");
|
|
268727
|
-
var
|
|
268891
|
+
var import_typescript69 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
268728
268892
|
var convertStaticToMeta = (config, compilerCtx, buildCtx, typeChecker, collection, transformOpts) => {
|
|
268729
268893
|
return (transformCtx) => {
|
|
268730
268894
|
let dirPath;
|
|
268731
268895
|
let moduleFile;
|
|
268732
268896
|
const visitNode = (node) => {
|
|
268733
|
-
if (
|
|
268897
|
+
if (import_typescript69.default.isClassDeclaration(node)) {
|
|
268734
268898
|
return parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, buildCtx, transformOpts);
|
|
268735
|
-
} else if (
|
|
268899
|
+
} else if (import_typescript69.default.isImportDeclaration(node)) {
|
|
268736
268900
|
parseModuleImport(config, compilerCtx, buildCtx, moduleFile, dirPath, node, !transformOpts.isolatedModules);
|
|
268737
|
-
} else if (
|
|
268901
|
+
} else if (import_typescript69.default.isCallExpression(node)) {
|
|
268738
268902
|
parseCallExpression(moduleFile, node);
|
|
268739
|
-
} else if (
|
|
268903
|
+
} else if (import_typescript69.default.isStringLiteral(node)) {
|
|
268740
268904
|
parseStringLiteral(moduleFile, node);
|
|
268741
268905
|
}
|
|
268742
|
-
return
|
|
268906
|
+
return import_typescript69.default.visitEachChild(node, visitNode, transformCtx);
|
|
268743
268907
|
};
|
|
268744
268908
|
return (tsSourceFile) => {
|
|
268745
268909
|
dirPath = (0, import_path67.dirname)(tsSourceFile.fileName);
|
|
@@ -268753,6 +268917,10 @@ var convertStaticToMeta = (config, compilerCtx, buildCtx, typeChecker, collectio
|
|
|
268753
268917
|
moduleFile.isCollectionDependency = false;
|
|
268754
268918
|
moduleFile.collectionName = null;
|
|
268755
268919
|
}
|
|
268920
|
+
if (!moduleFile.staticSourceFile) {
|
|
268921
|
+
moduleFile.staticSourceFile = tsSourceFile;
|
|
268922
|
+
moduleFile.staticSourceFileText = tsSourceFile.getFullText();
|
|
268923
|
+
}
|
|
268756
268924
|
return visitNode(tsSourceFile);
|
|
268757
268925
|
};
|
|
268758
268926
|
};
|
|
@@ -268785,13 +268953,13 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268785
268953
|
moduleFile: null
|
|
268786
268954
|
};
|
|
268787
268955
|
if (transformOpts.module === "cjs") {
|
|
268788
|
-
tsCompilerOptions.module =
|
|
268956
|
+
tsCompilerOptions.module = import_typescript70.default.ModuleKind.CommonJS;
|
|
268789
268957
|
} else {
|
|
268790
|
-
tsCompilerOptions.module =
|
|
268958
|
+
tsCompilerOptions.module = import_typescript70.default.ModuleKind.ESNext;
|
|
268791
268959
|
}
|
|
268792
268960
|
tsCompilerOptions.target = getScriptTargetKind(transformOpts);
|
|
268793
268961
|
if ((sourceFilePath.endsWith(".tsx") || sourceFilePath.endsWith(".jsx")) && tsCompilerOptions.jsx == null) {
|
|
268794
|
-
tsCompilerOptions.jsx =
|
|
268962
|
+
tsCompilerOptions.jsx = import_typescript70.default.JsxEmit.React;
|
|
268795
268963
|
}
|
|
268796
268964
|
if (tsCompilerOptions.jsx != null && !isString(tsCompilerOptions.jsxFactory)) {
|
|
268797
268965
|
tsCompilerOptions.jsxFactory = "h";
|
|
@@ -268802,7 +268970,7 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268802
268970
|
if (tsCompilerOptions.paths && !isString(tsCompilerOptions.baseUrl)) {
|
|
268803
268971
|
tsCompilerOptions.baseUrl = ".";
|
|
268804
268972
|
}
|
|
268805
|
-
const sourceFile =
|
|
268973
|
+
const sourceFile = import_typescript70.default.createSourceFile(sourceFilePath, input, tsCompilerOptions.target);
|
|
268806
268974
|
const compilerHost = {
|
|
268807
268975
|
getSourceFile: (fileName) => {
|
|
268808
268976
|
return normalizePath(fileName) === normalizePath(sourceFilePath) ? sourceFile : void 0;
|
|
@@ -268818,13 +268986,13 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268818
268986
|
useCaseSensitiveFileNames: () => false,
|
|
268819
268987
|
getCanonicalFileName: (fileName) => fileName,
|
|
268820
268988
|
getCurrentDirectory: () => transformOpts.currentDirectory || process.cwd(),
|
|
268821
|
-
getNewLine: () =>
|
|
268989
|
+
getNewLine: () => import_typescript70.default.sys.newLine || "\n",
|
|
268822
268990
|
fileExists: (fileName) => normalizePath(fileName) === normalizePath(sourceFilePath),
|
|
268823
268991
|
readFile: () => "",
|
|
268824
268992
|
directoryExists: () => true,
|
|
268825
268993
|
getDirectories: () => []
|
|
268826
268994
|
};
|
|
268827
|
-
const program3 =
|
|
268995
|
+
const program3 = import_typescript70.default.createProgram([sourceFilePath], tsCompilerOptions, compilerHost);
|
|
268828
268996
|
const typeChecker = program3.getTypeChecker();
|
|
268829
268997
|
const transformers = {
|
|
268830
268998
|
before: [
|
|
@@ -268856,10 +269024,10 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268856
269024
|
};
|
|
268857
269025
|
var getScriptTargetKind = (transformOpts) => {
|
|
268858
269026
|
const target = transformOpts.target && transformOpts.target.toUpperCase();
|
|
268859
|
-
if (isNumber(
|
|
268860
|
-
return
|
|
269027
|
+
if (isNumber(import_typescript70.default.ScriptTarget[target])) {
|
|
269028
|
+
return import_typescript70.default.ScriptTarget[target];
|
|
268861
269029
|
}
|
|
268862
|
-
return
|
|
269030
|
+
return import_typescript70.default.ScriptTarget.Latest;
|
|
268863
269031
|
};
|
|
268864
269032
|
|
|
268865
269033
|
// src/compiler/transpile.ts
|