@lwc/babel-plugin-component 8.12.6 → 8.12.7-alpha.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/dist/compiler-version-number.d.ts +0 -1
- package/dist/component.d.ts +0 -1
- package/dist/constants.d.ts +0 -1
- package/dist/decorators/api/index.d.ts +0 -1
- package/dist/decorators/api/shared.d.ts +0 -1
- package/dist/decorators/api/transform.d.ts +0 -1
- package/dist/decorators/api/validate.d.ts +0 -1
- package/dist/decorators/index.d.ts +0 -1
- package/dist/decorators/track/index.d.ts +0 -1
- package/dist/decorators/types.d.ts +0 -1
- package/dist/decorators/wire/index.d.ts +0 -1
- package/dist/decorators/wire/shared.d.ts +0 -1
- package/dist/decorators/wire/transform.d.ts +0 -1
- package/dist/decorators/wire/validate.d.ts +0 -1
- package/dist/dedupe-imports.d.ts +0 -1
- package/dist/dynamic-imports.d.ts +0 -1
- package/dist/index.cjs.js +22 -31
- package/dist/index.d.ts +0 -1
- package/dist/index.js +22 -31
- package/dist/scope-css-imports.d.ts +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/utils.d.ts +0 -1
- package/package.json +4 -4
package/dist/component.d.ts
CHANGED
package/dist/constants.d.ts
CHANGED
|
@@ -26,4 +26,3 @@ declare const COMPONENT_NAME_KEY = "sel";
|
|
|
26
26
|
declare const API_VERSION_KEY = "apiVersion";
|
|
27
27
|
declare const COMPONENT_CLASS_ID = "__lwc_component_class_internal";
|
|
28
28
|
export { AMBIGUOUS_PROP_SET, DECORATOR_TYPES, DISALLOWED_PROP_SET, LWC_PACKAGE_ALIAS, LWC_PACKAGE_EXPORTS, LWC_COMPONENT_PROPERTIES, REGISTER_COMPONENT_ID, REGISTER_DECORATORS_ID, TEMPLATE_KEY, COMPONENT_NAME_KEY, API_VERSION_KEY, COMPONENT_CLASS_ID, };
|
|
29
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -3,4 +3,3 @@ import type { DecoratorMeta } from '../index';
|
|
|
3
3
|
import type { BabelTypes } from '../../types';
|
|
4
4
|
import type { ClassBodyItem } from '../types';
|
|
5
5
|
export default function transform(t: BabelTypes, decoratorMetas: DecoratorMeta[], classBodyItems: NodePath<ClassBodyItem>[]): types.ObjectProperty[];
|
|
6
|
-
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -21,4 +21,3 @@ declare function removeImportedDecoratorSpecifiers(engineImportSpecifiers: {
|
|
|
21
21
|
}[]): void;
|
|
22
22
|
declare function decorators({ types: t }: BabelAPI): Visitor<LwcBabelPluginPass>;
|
|
23
23
|
export { decorators, removeImportedDecoratorSpecifiers, validateImportedLwcDecoratorUsage };
|
|
24
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -16,4 +16,3 @@ export type BindingOptions = {
|
|
|
16
16
|
};
|
|
17
17
|
export type ClassBodyItem = types.ClassMethod | types.ClassPrivateMethod | types.ClassProperty | types.ClassPrivateProperty | types.ClassAccessorProperty | types.StaticBlock;
|
|
18
18
|
export type LwcDecoratorName = 'api' | 'track' | 'wire';
|
|
19
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -2,4 +2,3 @@ import type { types } from '@babel/core';
|
|
|
2
2
|
import type { DecoratorMeta } from '../index';
|
|
3
3
|
import type { BabelTypes } from '../../types';
|
|
4
4
|
export default function transform(t: BabelTypes, decoratorMetas: DecoratorMeta[]): types.ObjectProperty[];
|
|
5
|
-
//# sourceMappingURL=transform.d.ts.map
|
package/dist/dedupe-imports.d.ts
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -474,47 +474,38 @@ function validateWireId(id, path, state) {
|
|
|
474
474
|
errorInfo: errors.DecoratorErrors.ADAPTER_SHOULD_BE_FIRST_PARAMETER,
|
|
475
475
|
}, state);
|
|
476
476
|
}
|
|
477
|
-
|
|
478
|
-
if (id.isIdentifier()) {
|
|
479
|
-
|
|
480
|
-
|
|
477
|
+
const isMemberExpression = id.isMemberExpression();
|
|
478
|
+
if (!id.isIdentifier() && !isMemberExpression) {
|
|
479
|
+
throw generateError(id, {
|
|
480
|
+
errorInfo: errors.DecoratorErrors.FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER,
|
|
481
|
+
}, state);
|
|
481
482
|
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
errorInfo: errors.DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_COMPUTED_PROPS,
|
|
487
|
-
}, state);
|
|
488
|
-
}
|
|
489
|
-
const object = id.get('object');
|
|
490
|
-
if (object.isIdentifier()) {
|
|
491
|
-
// @wire(adapter.foo)
|
|
492
|
-
adapter = object;
|
|
493
|
-
}
|
|
494
|
-
else {
|
|
495
|
-
// @wire(adapter.foo.bar)
|
|
496
|
-
throw generateError(id, {
|
|
497
|
-
errorInfo: errors.DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_NESTED_MEMBER_EXRESSIONS,
|
|
498
|
-
}, state);
|
|
499
|
-
}
|
|
483
|
+
if (id.isMemberExpression({ computed: true })) {
|
|
484
|
+
throw generateError(id, {
|
|
485
|
+
errorInfo: errors.DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_COMPUTED_PROPS,
|
|
486
|
+
}, state);
|
|
500
487
|
}
|
|
501
|
-
|
|
502
|
-
|
|
488
|
+
// TODO [#3444]: improve member expression computed typechecking
|
|
489
|
+
// @ts-expect-error type narrowing incorrectly reduces id to `never`
|
|
490
|
+
if (isMemberExpression && !id.get('object').isIdentifier()) {
|
|
503
491
|
throw generateError(id, {
|
|
504
|
-
errorInfo: errors.DecoratorErrors.
|
|
492
|
+
errorInfo: errors.DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_NESTED_MEMBER_EXRESSIONS,
|
|
505
493
|
}, state);
|
|
506
494
|
}
|
|
495
|
+
// TODO [#3444]: improve member expression computed typechecking
|
|
507
496
|
// Ensure wire adapter is imported (check for member expression or identifier)
|
|
508
|
-
|
|
509
|
-
|
|
497
|
+
// @ts-expect-error type narrowing incorrectly reduces id to `never`
|
|
498
|
+
const wireBinding = isMemberExpression ? id.node.object.name : id.node.name;
|
|
499
|
+
if (!path.scope.getBinding(wireBinding)) {
|
|
510
500
|
throw generateError(id, {
|
|
511
501
|
errorInfo: errors.DecoratorErrors.WIRE_ADAPTER_SHOULD_BE_IMPORTED,
|
|
512
|
-
messageArgs: [
|
|
502
|
+
messageArgs: [id.node.name],
|
|
513
503
|
}, state);
|
|
514
504
|
}
|
|
515
505
|
// ensure wire adapter is a first parameter
|
|
516
|
-
if (
|
|
517
|
-
!
|
|
506
|
+
if (wireBinding &&
|
|
507
|
+
!path.scope.getBinding(wireBinding).path.isImportSpecifier() &&
|
|
508
|
+
!path.scope.getBinding(wireBinding).path.isImportDefaultSpecifier()) {
|
|
518
509
|
throw generateError(id, {
|
|
519
510
|
errorInfo: errors.DecoratorErrors.IMPORTED_FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER,
|
|
520
511
|
}, state);
|
|
@@ -1285,5 +1276,5 @@ function LwcClassTransform(api) {
|
|
|
1285
1276
|
}
|
|
1286
1277
|
|
|
1287
1278
|
exports.default = LwcClassTransform;
|
|
1288
|
-
/** version: 8.12.
|
|
1279
|
+
/** version: 8.12.2 */
|
|
1289
1280
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -470,47 +470,38 @@ function validateWireId(id, path, state) {
|
|
|
470
470
|
errorInfo: DecoratorErrors.ADAPTER_SHOULD_BE_FIRST_PARAMETER,
|
|
471
471
|
}, state);
|
|
472
472
|
}
|
|
473
|
-
|
|
474
|
-
if (id.isIdentifier()) {
|
|
475
|
-
|
|
476
|
-
|
|
473
|
+
const isMemberExpression = id.isMemberExpression();
|
|
474
|
+
if (!id.isIdentifier() && !isMemberExpression) {
|
|
475
|
+
throw generateError(id, {
|
|
476
|
+
errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER,
|
|
477
|
+
}, state);
|
|
477
478
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_COMPUTED_PROPS,
|
|
483
|
-
}, state);
|
|
484
|
-
}
|
|
485
|
-
const object = id.get('object');
|
|
486
|
-
if (object.isIdentifier()) {
|
|
487
|
-
// @wire(adapter.foo)
|
|
488
|
-
adapter = object;
|
|
489
|
-
}
|
|
490
|
-
else {
|
|
491
|
-
// @wire(adapter.foo.bar)
|
|
492
|
-
throw generateError(id, {
|
|
493
|
-
errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_NESTED_MEMBER_EXRESSIONS,
|
|
494
|
-
}, state);
|
|
495
|
-
}
|
|
479
|
+
if (id.isMemberExpression({ computed: true })) {
|
|
480
|
+
throw generateError(id, {
|
|
481
|
+
errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_COMPUTED_PROPS,
|
|
482
|
+
}, state);
|
|
496
483
|
}
|
|
497
|
-
|
|
498
|
-
|
|
484
|
+
// TODO [#3444]: improve member expression computed typechecking
|
|
485
|
+
// @ts-expect-error type narrowing incorrectly reduces id to `never`
|
|
486
|
+
if (isMemberExpression && !id.get('object').isIdentifier()) {
|
|
499
487
|
throw generateError(id, {
|
|
500
|
-
errorInfo: DecoratorErrors.
|
|
488
|
+
errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_NESTED_MEMBER_EXRESSIONS,
|
|
501
489
|
}, state);
|
|
502
490
|
}
|
|
491
|
+
// TODO [#3444]: improve member expression computed typechecking
|
|
503
492
|
// Ensure wire adapter is imported (check for member expression or identifier)
|
|
504
|
-
|
|
505
|
-
|
|
493
|
+
// @ts-expect-error type narrowing incorrectly reduces id to `never`
|
|
494
|
+
const wireBinding = isMemberExpression ? id.node.object.name : id.node.name;
|
|
495
|
+
if (!path.scope.getBinding(wireBinding)) {
|
|
506
496
|
throw generateError(id, {
|
|
507
497
|
errorInfo: DecoratorErrors.WIRE_ADAPTER_SHOULD_BE_IMPORTED,
|
|
508
|
-
messageArgs: [
|
|
498
|
+
messageArgs: [id.node.name],
|
|
509
499
|
}, state);
|
|
510
500
|
}
|
|
511
501
|
// ensure wire adapter is a first parameter
|
|
512
|
-
if (
|
|
513
|
-
!
|
|
502
|
+
if (wireBinding &&
|
|
503
|
+
!path.scope.getBinding(wireBinding).path.isImportSpecifier() &&
|
|
504
|
+
!path.scope.getBinding(wireBinding).path.isImportDefaultSpecifier()) {
|
|
514
505
|
throw generateError(id, {
|
|
515
506
|
errorInfo: DecoratorErrors.IMPORTED_FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER,
|
|
516
507
|
}, state);
|
|
@@ -1281,5 +1272,5 @@ function LwcClassTransform(api) {
|
|
|
1281
1272
|
}
|
|
1282
1273
|
|
|
1283
1274
|
export { LwcClassTransform as default };
|
|
1284
|
-
/** version: 8.12.
|
|
1275
|
+
/** version: 8.12.2 */
|
|
1285
1276
|
//# sourceMappingURL=index.js.map
|
package/dist/types.d.ts
CHANGED
package/dist/utils.d.ts
CHANGED
|
@@ -21,4 +21,3 @@ declare function getEngineImportSpecifiers(path: NodePath): ImportSpecifier[];
|
|
|
21
21
|
declare function generateError(source: NodePath<types.Node>, { errorInfo, messageArgs }: DecoratorErrorOptions, state: LwcBabelPluginPass): Error;
|
|
22
22
|
declare function incrementMetricCounter(metric: CompilerMetrics, state: LwcBabelPluginPass): void;
|
|
23
23
|
export { isClassMethod, isGetterClassMethod, isSetterClassMethod, generateError, getEngineImportSpecifiers, incrementMetricCounter, };
|
|
24
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"You can safely modify dependencies, devDependencies, keywords, etc., but other props will be overwritten."
|
|
5
5
|
],
|
|
6
6
|
"name": "@lwc/babel-plugin-component",
|
|
7
|
-
"version": "8.12.
|
|
7
|
+
"version": "8.12.7-alpha.0",
|
|
8
8
|
"description": "Babel plugin to transform a LWC module",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"lwc"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@babel/helper-module-imports": "7.25.9",
|
|
50
|
-
"@lwc/errors": "8.12.
|
|
51
|
-
"@lwc/shared": "8.12.
|
|
50
|
+
"@lwc/errors": "8.12.7-alpha.0",
|
|
51
|
+
"@lwc/shared": "8.12.7-alpha.0",
|
|
52
52
|
"line-column": "~1.0.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@babel/core": "^7"
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
}
|