@lwc/ssr-compiler 8.28.2 → 9.0.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/compile-js/types.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/shared.d.ts +1 -3
- package/package.json +11 -7
- package/dist/index.cjs.js +0 -2720
|
@@ -40,7 +40,7 @@ export interface ComponentMetaState {
|
|
|
40
40
|
/** indicates whether the LightningElement has any wired props */
|
|
41
41
|
wireAdapters: WireAdapter[];
|
|
42
42
|
/** dynamic imports configuration */
|
|
43
|
-
|
|
43
|
+
dynamicImports: ComponentTransformOptions['dynamicImports'];
|
|
44
44
|
/** imports to add to the top of the program after parsing */
|
|
45
45
|
importManager: ImportManager;
|
|
46
46
|
/** identifiers starting with __lwc that we added */
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { parse as parse$1 } from 'node:path';
|
|
|
12
12
|
import { generateScopeTokens, bindExpression, toPropertyName, kebabcaseToCamelcase, parse as parse$2 } from '@lwc/template-compiler';
|
|
13
13
|
import { builders as builders$1 } from 'estree-toolkit/dist/builders';
|
|
14
14
|
import { isValidES3Identifier } from '@babel/types';
|
|
15
|
-
import { inspect } from 'util';
|
|
15
|
+
import { inspect } from 'node:util';
|
|
16
16
|
|
|
17
17
|
/*
|
|
18
18
|
* Copyright (c) 2024, salesforce.com, inc.
|
|
@@ -992,17 +992,17 @@ const visitors = {
|
|
|
992
992
|
removeDecoratorImport(path);
|
|
993
993
|
},
|
|
994
994
|
ImportExpression(path, state) {
|
|
995
|
-
const {
|
|
996
|
-
if (!
|
|
997
|
-
// if no `
|
|
995
|
+
const { dynamicImports, importManager } = state;
|
|
996
|
+
if (!dynamicImports) {
|
|
997
|
+
// if no `dynamicImports` config, then leave dynamic `import()`s as-is
|
|
998
998
|
return;
|
|
999
999
|
}
|
|
1000
|
-
if (
|
|
1000
|
+
if (dynamicImports.strictSpecifier) {
|
|
1001
1001
|
if (!is.literal(path.node?.source) || typeof path.node.source.value !== 'string') {
|
|
1002
1002
|
throw generateError(path.node, LWCClassErrors.INVALID_DYNAMIC_IMPORT_SOURCE_STRICT, is.literal(path.node?.source) ? String(path.node.source.value) : 'undefined');
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
1005
|
-
const loader =
|
|
1005
|
+
const loader = dynamicImports.loader;
|
|
1006
1006
|
if (!loader) {
|
|
1007
1007
|
// if no `loader` defined, then leave dynamic `import()`s as-is
|
|
1008
1008
|
return;
|
|
@@ -1210,7 +1210,7 @@ function compileJS(src, filename, tagName, options, compilationMode) {
|
|
|
1210
1210
|
publicProperties: new Map(),
|
|
1211
1211
|
privateProperties: new Set(),
|
|
1212
1212
|
wireAdapters: [],
|
|
1213
|
-
|
|
1213
|
+
dynamicImports: options.dynamicImports,
|
|
1214
1214
|
importManager: new ImportManager(),
|
|
1215
1215
|
trustedLwcIdentifiers: new WeakSet(),
|
|
1216
1216
|
};
|
|
@@ -2711,5 +2711,5 @@ function compileTemplateForSSR(src, filename, options, mode = DEFAULT_SSR_MODE)
|
|
|
2711
2711
|
}
|
|
2712
2712
|
|
|
2713
2713
|
export { compileComponentForSSR, compileTemplateForSSR };
|
|
2714
|
-
/** version:
|
|
2714
|
+
/** version: 9.0.0 */
|
|
2715
2715
|
//# sourceMappingURL=index.js.map
|
package/dist/shared.d.ts
CHANGED
|
@@ -2,7 +2,5 @@ import type { LwcBabelPluginOptions } from '@lwc/babel-plugin-component';
|
|
|
2
2
|
import type { Config as TemplateCompilerConfig } from '@lwc/template-compiler';
|
|
3
3
|
export type Expression = string;
|
|
4
4
|
export type TemplateTransformOptions = Pick<TemplateCompilerConfig, 'name' | 'namespace'>;
|
|
5
|
-
export type ComponentTransformOptions = Partial<Pick<LwcBabelPluginOptions, 'name' | 'namespace'
|
|
6
|
-
experimentalDynamicComponent?: LwcBabelPluginOptions['dynamicImports'];
|
|
7
|
-
};
|
|
5
|
+
export type ComponentTransformOptions = Partial<Pick<LwcBabelPluginOptions, 'name' | 'namespace' | 'dynamicImports'>>;
|
|
8
6
|
//# sourceMappingURL=shared.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/ssr-compiler",
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "9.0.0",
|
|
8
8
|
"description": "Compile component for use during server-side rendering",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"compiler",
|
|
@@ -21,13 +21,17 @@
|
|
|
21
21
|
"url": "https://github.com/salesforce/lwc/issues"
|
|
22
22
|
},
|
|
23
23
|
"license": "MIT",
|
|
24
|
+
"type": "module",
|
|
24
25
|
"publishConfig": {
|
|
25
26
|
"access": "public"
|
|
26
27
|
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=16.6.0"
|
|
30
|
+
},
|
|
27
31
|
"volta": {
|
|
28
32
|
"extends": "../../../package.json"
|
|
29
33
|
},
|
|
30
|
-
"main": "dist/index.
|
|
34
|
+
"main": "dist/index.js",
|
|
31
35
|
"module": "dist/index.js",
|
|
32
36
|
"types": "dist/index.d.ts",
|
|
33
37
|
"files": [
|
|
@@ -49,17 +53,17 @@
|
|
|
49
53
|
},
|
|
50
54
|
"dependencies": {
|
|
51
55
|
"@babel/types": "7.28.6",
|
|
52
|
-
"@lwc/errors": "
|
|
53
|
-
"@lwc/shared": "
|
|
54
|
-
"@lwc/template-compiler": "
|
|
56
|
+
"@lwc/errors": "9.0.0",
|
|
57
|
+
"@lwc/shared": "9.0.0",
|
|
58
|
+
"@lwc/template-compiler": "9.0.0",
|
|
55
59
|
"acorn": "8.15.0",
|
|
56
60
|
"astring": "^1.9.0",
|
|
57
61
|
"estree-toolkit": "^1.7.13",
|
|
58
62
|
"immer": "^11.1.3",
|
|
59
|
-
"meriyah": "^
|
|
63
|
+
"meriyah": "^7.0.0"
|
|
60
64
|
},
|
|
61
65
|
"devDependencies": {
|
|
62
|
-
"@lwc/babel-plugin-component": "
|
|
66
|
+
"@lwc/babel-plugin-component": "9.0.0",
|
|
63
67
|
"@types/estree": "^1.0.8"
|
|
64
68
|
}
|
|
65
69
|
}
|