@lwc/babel-plugin-component 8.22.5 → 8.23.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/constants.d.ts +2 -1
- package/dist/index.cjs.js +14 -8
- package/dist/index.js +14 -8
- package/dist/types.d.ts +1 -0
- package/package.json +3 -3
package/dist/constants.d.ts
CHANGED
|
@@ -23,5 +23,6 @@ declare const TEMPLATE_KEY = "tmpl";
|
|
|
23
23
|
declare const COMPONENT_NAME_KEY = "sel";
|
|
24
24
|
declare const API_VERSION_KEY = "apiVersion";
|
|
25
25
|
declare const COMPONENT_CLASS_ID = "__lwc_component_class_internal";
|
|
26
|
-
|
|
26
|
+
declare const SYNTHETIC_ELEMENT_INTERNALS_KEY = "enableSyntheticElementInternals";
|
|
27
|
+
export { DECORATOR_TYPES, 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, SYNTHETIC_ELEMENT_INTERNALS_KEY, };
|
|
27
28
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/index.cjs.js
CHANGED
|
@@ -41,6 +41,7 @@ const TEMPLATE_KEY = 'tmpl';
|
|
|
41
41
|
const COMPONENT_NAME_KEY = 'sel';
|
|
42
42
|
const API_VERSION_KEY = 'apiVersion';
|
|
43
43
|
const COMPONENT_CLASS_ID = '__lwc_component_class_internal';
|
|
44
|
+
const SYNTHETIC_ELEMENT_INTERNALS_KEY = 'enableSyntheticElementInternals';
|
|
44
45
|
|
|
45
46
|
/*
|
|
46
47
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
@@ -95,15 +96,20 @@ function component ({ types: t }) {
|
|
|
95
96
|
// sel: 'x-foo',
|
|
96
97
|
// apiVersion: '58'
|
|
97
98
|
// })
|
|
99
|
+
const properties = [
|
|
100
|
+
t.objectProperty(t.identifier(TEMPLATE_KEY), templateIdentifier),
|
|
101
|
+
t.objectProperty(t.identifier(COMPONENT_NAME_KEY), componentRegisteredName),
|
|
102
|
+
// It's important that, at this point, we have an APIVersion rather than just a number.
|
|
103
|
+
// The client needs to trust the server that it's providing an actual known API version
|
|
104
|
+
t.objectProperty(t.identifier(API_VERSION_KEY), t.numericLiteral(apiVersion)),
|
|
105
|
+
];
|
|
106
|
+
// Only include enableSyntheticElementInternals if set to true
|
|
107
|
+
if (state.opts.enableSyntheticElementInternals === true) {
|
|
108
|
+
properties.push(t.objectProperty(t.identifier(SYNTHETIC_ELEMENT_INTERNALS_KEY), t.booleanLiteral(true)));
|
|
109
|
+
}
|
|
98
110
|
const registerComponentExpression = t.callExpression(registerComponentId, [
|
|
99
111
|
node,
|
|
100
|
-
t.objectExpression(
|
|
101
|
-
t.objectProperty(t.identifier(TEMPLATE_KEY), templateIdentifier),
|
|
102
|
-
t.objectProperty(t.identifier(COMPONENT_NAME_KEY), componentRegisteredName),
|
|
103
|
-
// It's important that, at this point, we have an APIVersion rather than just a number.
|
|
104
|
-
// The client needs to trust the server that it's providing an actual known API version
|
|
105
|
-
t.objectProperty(t.identifier(API_VERSION_KEY), t.numericLiteral(apiVersion)),
|
|
106
|
-
]),
|
|
112
|
+
t.objectExpression(properties),
|
|
107
113
|
]);
|
|
108
114
|
// Example:
|
|
109
115
|
// const __lwc_component_class_internal = registerComponent(cmp, ...);
|
|
@@ -1267,5 +1273,5 @@ function LwcClassTransform(api) {
|
|
|
1267
1273
|
}
|
|
1268
1274
|
|
|
1269
1275
|
exports.default = LwcClassTransform;
|
|
1270
|
-
/** version: 8.
|
|
1276
|
+
/** version: 8.23.0 */
|
|
1271
1277
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ const TEMPLATE_KEY = 'tmpl';
|
|
|
37
37
|
const COMPONENT_NAME_KEY = 'sel';
|
|
38
38
|
const API_VERSION_KEY = 'apiVersion';
|
|
39
39
|
const COMPONENT_CLASS_ID = '__lwc_component_class_internal';
|
|
40
|
+
const SYNTHETIC_ELEMENT_INTERNALS_KEY = 'enableSyntheticElementInternals';
|
|
40
41
|
|
|
41
42
|
/*
|
|
42
43
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
@@ -91,15 +92,20 @@ function component ({ types: t }) {
|
|
|
91
92
|
// sel: 'x-foo',
|
|
92
93
|
// apiVersion: '58'
|
|
93
94
|
// })
|
|
95
|
+
const properties = [
|
|
96
|
+
t.objectProperty(t.identifier(TEMPLATE_KEY), templateIdentifier),
|
|
97
|
+
t.objectProperty(t.identifier(COMPONENT_NAME_KEY), componentRegisteredName),
|
|
98
|
+
// It's important that, at this point, we have an APIVersion rather than just a number.
|
|
99
|
+
// The client needs to trust the server that it's providing an actual known API version
|
|
100
|
+
t.objectProperty(t.identifier(API_VERSION_KEY), t.numericLiteral(apiVersion)),
|
|
101
|
+
];
|
|
102
|
+
// Only include enableSyntheticElementInternals if set to true
|
|
103
|
+
if (state.opts.enableSyntheticElementInternals === true) {
|
|
104
|
+
properties.push(t.objectProperty(t.identifier(SYNTHETIC_ELEMENT_INTERNALS_KEY), t.booleanLiteral(true)));
|
|
105
|
+
}
|
|
94
106
|
const registerComponentExpression = t.callExpression(registerComponentId, [
|
|
95
107
|
node,
|
|
96
|
-
t.objectExpression(
|
|
97
|
-
t.objectProperty(t.identifier(TEMPLATE_KEY), templateIdentifier),
|
|
98
|
-
t.objectProperty(t.identifier(COMPONENT_NAME_KEY), componentRegisteredName),
|
|
99
|
-
// It's important that, at this point, we have an APIVersion rather than just a number.
|
|
100
|
-
// The client needs to trust the server that it's providing an actual known API version
|
|
101
|
-
t.objectProperty(t.identifier(API_VERSION_KEY), t.numericLiteral(apiVersion)),
|
|
102
|
-
]),
|
|
108
|
+
t.objectExpression(properties),
|
|
103
109
|
]);
|
|
104
110
|
// Example:
|
|
105
111
|
// const __lwc_component_class_internal = registerComponent(cmp, ...);
|
|
@@ -1263,5 +1269,5 @@ function LwcClassTransform(api) {
|
|
|
1263
1269
|
}
|
|
1264
1270
|
|
|
1265
1271
|
export { LwcClassTransform as default };
|
|
1266
|
-
/** version: 8.
|
|
1272
|
+
/** version: 8.23.0 */
|
|
1267
1273
|
//# sourceMappingURL=index.js.map
|
package/dist/types.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface LwcBabelPluginOptions {
|
|
|
13
13
|
name: string;
|
|
14
14
|
instrumentation?: InstrumentationObject;
|
|
15
15
|
apiVersion?: number;
|
|
16
|
+
enableSyntheticElementInternals?: boolean;
|
|
16
17
|
}
|
|
17
18
|
export interface LwcBabelPluginPass extends PluginPass {
|
|
18
19
|
opts: LwcBabelPluginOptions;
|
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.
|
|
7
|
+
"version": "8.23.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.27.1",
|
|
50
|
-
"@lwc/errors": "8.
|
|
51
|
-
"@lwc/shared": "8.
|
|
50
|
+
"@lwc/errors": "8.23.0",
|
|
51
|
+
"@lwc/shared": "8.23.0",
|
|
52
52
|
"line-column": "~1.0.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|