@lwc/babel-plugin-component
Advanced tools
Comparing version 8.12.7-alpha.0 to 8.12.7
import type { Visitor } from '@babel/core'; | ||
import type { BabelAPI, LwcBabelPluginPass } from './types'; | ||
export default function compilerVersionNumber({ types: t }: BabelAPI): Visitor<LwcBabelPluginPass>; | ||
//# sourceMappingURL=compiler-version-number.d.ts.map |
import type { Visitor } from '@babel/core'; | ||
import type { BabelAPI, LwcBabelPluginPass } from './types'; | ||
export default function ({ types: t }: BabelAPI): Visitor<LwcBabelPluginPass>; | ||
//# sourceMappingURL=component.d.ts.map |
@@ -29,1 +29,2 @@ declare const AMBIGUOUS_PROP_SET: Map<string, string>; | ||
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, }; | ||
//# sourceMappingURL=constants.d.ts.map |
@@ -9,1 +9,2 @@ import validate from './validate'; | ||
export default _default; | ||
//# sourceMappingURL=index.d.ts.map |
import type { DecoratorMeta } from '../index'; | ||
declare function isApiDecorator(decorator: DecoratorMeta): boolean; | ||
export { isApiDecorator }; | ||
//# sourceMappingURL=shared.d.ts.map |
@@ -6,1 +6,2 @@ import type { types, NodePath } from '@babel/core'; | ||
export default function transform(t: BabelTypes, decoratorMetas: DecoratorMeta[], classBodyItems: NodePath<ClassBodyItem>[]): types.ObjectProperty[]; | ||
//# sourceMappingURL=transform.d.ts.map |
import type { LwcBabelPluginPass } from '../../types'; | ||
import type { DecoratorMeta } from '../index'; | ||
export default function validate(decorators: DecoratorMeta[], state: LwcBabelPluginPass): void; | ||
//# sourceMappingURL=validate.d.ts.map |
@@ -24,1 +24,2 @@ import { DECORATOR_TYPES } from '../constants'; | ||
export { decorators, removeImportedDecoratorSpecifiers, validateImportedLwcDecoratorUsage }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -11,1 +11,2 @@ import type { BabelTypes, LwcBabelPluginPass } from '../../types'; | ||
export default _default; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -19,1 +19,2 @@ import type { types, NodePath } from '@babel/core'; | ||
export type LwcDecoratorName = 'api' | 'track' | 'wire'; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -9,1 +9,2 @@ import validate from './validate'; | ||
export default _default; | ||
//# sourceMappingURL=index.d.ts.map |
import type { DecoratorMeta } from '../index'; | ||
declare function isWireDecorator(decorator: DecoratorMeta): boolean; | ||
export { isWireDecorator }; | ||
//# sourceMappingURL=shared.d.ts.map |
@@ -5,1 +5,2 @@ import type { types } from '@babel/core'; | ||
export default function transform(t: BabelTypes, decoratorMetas: DecoratorMeta[]): types.ObjectProperty[]; | ||
//# sourceMappingURL=transform.d.ts.map |
import type { LwcBabelPluginPass } from '../../types'; | ||
import type { DecoratorMeta } from '../index'; | ||
export default function validate(decorators: DecoratorMeta[], state: LwcBabelPluginPass): void; | ||
//# sourceMappingURL=validate.d.ts.map |
import type { types, NodePath } from '@babel/core'; | ||
import type { BabelAPI } from './types'; | ||
export default function ({ types: t }: BabelAPI): (path: NodePath<types.Program>) => void; | ||
//# sourceMappingURL=dedupe-imports.d.ts.map |
@@ -8,1 +8,2 @@ import type { Visitor } from '@babel/core'; | ||
export default function (): Visitor<LwcBabelPluginPass>; | ||
//# sourceMappingURL=dynamic-imports.d.ts.map |
@@ -477,34 +477,43 @@ /** | ||
} | ||
const isMemberExpression = id.isMemberExpression(); | ||
if (!id.isIdentifier() && !isMemberExpression) { | ||
throw generateError(id, { | ||
errorInfo: errors.DecoratorErrors.FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER, | ||
}, state); | ||
let adapter; | ||
if (id.isIdentifier()) { | ||
// @wire(adapter) | ||
adapter = id; | ||
} | ||
if (id.isMemberExpression({ computed: true })) { | ||
throw generateError(id, { | ||
errorInfo: errors.DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_COMPUTED_PROPS, | ||
}, state); | ||
else if (id.isMemberExpression()) { | ||
if (id.node.computed) { | ||
// @wire(adapter[computed]) | ||
throw generateError(id, { | ||
errorInfo: errors.DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_COMPUTED_PROPS, | ||
}, state); | ||
} | ||
const object = id.get('object'); | ||
if (object.isIdentifier()) { | ||
// @wire(adapter.foo) | ||
adapter = object; | ||
} | ||
else { | ||
// @wire(adapter.foo.bar) | ||
throw generateError(id, { | ||
errorInfo: errors.DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_NESTED_MEMBER_EXRESSIONS, | ||
}, state); | ||
} | ||
} | ||
// TODO [#3444]: improve member expression computed typechecking | ||
// @ts-expect-error type narrowing incorrectly reduces id to `never` | ||
if (isMemberExpression && !id.get('object').isIdentifier()) { | ||
else { | ||
// @wire(1), @wire('adapter'), @wire(function adapter() {}), etc. | ||
throw generateError(id, { | ||
errorInfo: errors.DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_NESTED_MEMBER_EXRESSIONS, | ||
errorInfo: errors.DecoratorErrors.FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER, | ||
}, state); | ||
} | ||
// TODO [#3444]: improve member expression computed typechecking | ||
// Ensure wire adapter is imported (check for member expression or identifier) | ||
// @ts-expect-error type narrowing incorrectly reduces id to `never` | ||
const wireBinding = isMemberExpression ? id.node.object.name : id.node.name; | ||
if (!path.scope.getBinding(wireBinding)) { | ||
const adapterBinding = path.scope.getBinding(adapter.node.name); | ||
if (!adapterBinding) { | ||
throw generateError(id, { | ||
errorInfo: errors.DecoratorErrors.WIRE_ADAPTER_SHOULD_BE_IMPORTED, | ||
messageArgs: [id.node.name], | ||
messageArgs: [adapter.node.name], | ||
}, state); | ||
} | ||
// ensure wire adapter is a first parameter | ||
if (wireBinding && | ||
!path.scope.getBinding(wireBinding).path.isImportSpecifier() && | ||
!path.scope.getBinding(wireBinding).path.isImportDefaultSpecifier()) { | ||
if (!adapterBinding.path.isImportSpecifier() && | ||
!adapterBinding.path.isImportDefaultSpecifier()) { | ||
throw generateError(id, { | ||
@@ -1280,3 +1289,3 @@ errorInfo: errors.DecoratorErrors.IMPORTED_FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER, | ||
exports.default = LwcClassTransform; | ||
/** version: 8.12.2 */ | ||
/** version: 8.12.7 */ | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -11,1 +11,2 @@ import type { BabelAPI, LwcBabelPluginPass } from './types'; | ||
export default function LwcClassTransform(api: BabelAPI): PluginObj<LwcBabelPluginPass>; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -473,34 +473,43 @@ /** | ||
} | ||
const isMemberExpression = id.isMemberExpression(); | ||
if (!id.isIdentifier() && !isMemberExpression) { | ||
throw generateError(id, { | ||
errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER, | ||
}, state); | ||
let adapter; | ||
if (id.isIdentifier()) { | ||
// @wire(adapter) | ||
adapter = id; | ||
} | ||
if (id.isMemberExpression({ computed: true })) { | ||
throw generateError(id, { | ||
errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_COMPUTED_PROPS, | ||
}, state); | ||
else if (id.isMemberExpression()) { | ||
if (id.node.computed) { | ||
// @wire(adapter[computed]) | ||
throw generateError(id, { | ||
errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_COMPUTED_PROPS, | ||
}, state); | ||
} | ||
const object = id.get('object'); | ||
if (object.isIdentifier()) { | ||
// @wire(adapter.foo) | ||
adapter = object; | ||
} | ||
else { | ||
// @wire(adapter.foo.bar) | ||
throw generateError(id, { | ||
errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_NESTED_MEMBER_EXRESSIONS, | ||
}, state); | ||
} | ||
} | ||
// TODO [#3444]: improve member expression computed typechecking | ||
// @ts-expect-error type narrowing incorrectly reduces id to `never` | ||
if (isMemberExpression && !id.get('object').isIdentifier()) { | ||
else { | ||
// @wire(1), @wire('adapter'), @wire(function adapter() {}), etc. | ||
throw generateError(id, { | ||
errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_CANNOT_HAVE_NESTED_MEMBER_EXRESSIONS, | ||
errorInfo: DecoratorErrors.FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER, | ||
}, state); | ||
} | ||
// TODO [#3444]: improve member expression computed typechecking | ||
// Ensure wire adapter is imported (check for member expression or identifier) | ||
// @ts-expect-error type narrowing incorrectly reduces id to `never` | ||
const wireBinding = isMemberExpression ? id.node.object.name : id.node.name; | ||
if (!path.scope.getBinding(wireBinding)) { | ||
const adapterBinding = path.scope.getBinding(adapter.node.name); | ||
if (!adapterBinding) { | ||
throw generateError(id, { | ||
errorInfo: DecoratorErrors.WIRE_ADAPTER_SHOULD_BE_IMPORTED, | ||
messageArgs: [id.node.name], | ||
messageArgs: [adapter.node.name], | ||
}, state); | ||
} | ||
// ensure wire adapter is a first parameter | ||
if (wireBinding && | ||
!path.scope.getBinding(wireBinding).path.isImportSpecifier() && | ||
!path.scope.getBinding(wireBinding).path.isImportDefaultSpecifier()) { | ||
if (!adapterBinding.path.isImportSpecifier() && | ||
!adapterBinding.path.isImportDefaultSpecifier()) { | ||
throw generateError(id, { | ||
@@ -1276,3 +1285,3 @@ errorInfo: DecoratorErrors.IMPORTED_FUNCTION_IDENTIFIER_SHOULD_BE_FIRST_PARAMETER, | ||
export { LwcClassTransform as default }; | ||
/** version: 8.12.2 */ | ||
/** version: 8.12.7 */ | ||
//# sourceMappingURL=index.js.map |
import type { NodePath } from '@babel/core'; | ||
import type { BabelAPI } from './types'; | ||
export default function ({ types: t }: BabelAPI, path: NodePath): void; | ||
//# sourceMappingURL=scope-css-imports.d.ts.map |
@@ -22,1 +22,2 @@ import type * as BabelCoreNamespace from '@babel/core'; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
@@ -14,3 +14,3 @@ import type { types, NodePath } from '@babel/core'; | ||
static?: boolean; | ||
}): boolean; | ||
}): classMethod is NodePath<types.ClassMethod>; | ||
declare function isSetterClassMethod(classMethod: NodePath<types.Node>, properties?: { | ||
@@ -20,3 +20,3 @@ kind?: string; | ||
static?: boolean; | ||
}): boolean; | ||
}): classMethod is NodePath<types.ClassMethod>; | ||
declare function getEngineImportSpecifiers(path: NodePath): ImportSpecifier[]; | ||
@@ -26,1 +26,2 @@ declare function generateError(source: NodePath<types.Node>, { errorInfo, messageArgs }: DecoratorErrorOptions, state: LwcBabelPluginPass): Error; | ||
export { isClassMethod, isGetterClassMethod, isSetterClassMethod, generateError, getEngineImportSpecifiers, incrementMetricCounter, }; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -7,3 +7,3 @@ { | ||
"name": "@lwc/babel-plugin-component", | ||
"version": "8.12.7-alpha.0", | ||
"version": "8.12.7", | ||
"description": "Babel plugin to transform a LWC module", | ||
@@ -51,4 +51,4 @@ "keywords": [ | ||
"@babel/helper-module-imports": "7.25.9", | ||
"@lwc/errors": "8.12.7-alpha.0", | ||
"@lwc/shared": "8.12.7-alpha.0", | ||
"@lwc/errors": "8.12.7", | ||
"@lwc/shared": "8.12.7", | ||
"line-column": "~1.0.2" | ||
@@ -63,2 +63,2 @@ }, | ||
} | ||
} | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
126867
2723
0
+ Added@lwc/errors@8.12.7(transitive)
+ Added@lwc/shared@8.12.7(transitive)
+ Addedelectron-to-chromium@1.5.97(transitive)
- Removed@lwc/errors@8.12.7-alpha.0(transitive)
- Removed@lwc/shared@8.12.7-alpha.0(transitive)
- Removedelectron-to-chromium@1.5.99(transitive)
Updated@lwc/errors@8.12.7
Updated@lwc/shared@8.12.7