@lwrjs/module-bundler 0.22.1 → 0.22.7-alpha.6
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.
|
@@ -2,10 +2,8 @@ import { amdBundler } from './utils/amd-common.js';
|
|
|
2
2
|
import { minifyJavascript, parseJavascript } from './utils/esbuild-utils.js';
|
|
3
3
|
import { createIntegrityHash } from '@lwrjs/shared-utils';
|
|
4
4
|
export default class AmdBundlerProvider {
|
|
5
|
-
name = 'amd-bundle-provider';
|
|
6
|
-
config;
|
|
7
|
-
moduleRegistry;
|
|
8
5
|
constructor(options, { config, moduleRegistry }) {
|
|
6
|
+
this.name = 'amd-bundle-provider';
|
|
9
7
|
this.config = config;
|
|
10
8
|
this.moduleRegistry = moduleRegistry;
|
|
11
9
|
}
|
|
@@ -5,10 +5,8 @@ import { minifyJavascript } from './utils/esbuild-utils.js';
|
|
|
5
5
|
import { overrideBundleConfig } from './utils/bundle-common.js';
|
|
6
6
|
import { PROTOCOL_HTTP, PROTOCOL_HTTPS, createIntegrityHash } from '@lwrjs/shared-utils';
|
|
7
7
|
export default class EsmBundlerProvider {
|
|
8
|
-
name = 'esm-bundle-provider';
|
|
9
|
-
config;
|
|
10
|
-
moduleRegistry;
|
|
11
8
|
constructor(_options, { config, moduleRegistry }) {
|
|
9
|
+
this.name = 'esm-bundle-provider';
|
|
12
10
|
this.config = config;
|
|
13
11
|
this.moduleRegistry = moduleRegistry;
|
|
14
12
|
}
|
package/build/es/index.js
CHANGED
|
@@ -5,27 +5,24 @@ import { signBundle, getCacheKeyFromJson, InflightTasks, TaskPool, isLambdaEnv,
|
|
|
5
5
|
import { getTracer, BundleSpan, cacheCountStore } from '@lwrjs/instrumentation';
|
|
6
6
|
const TASK_POOL = new TaskPool();
|
|
7
7
|
export class LwrModuleBundler {
|
|
8
|
-
moduleRegistry;
|
|
9
|
-
appObserver;
|
|
10
|
-
cache = new LRUCache({
|
|
11
|
-
max: parseInt(process.env.BUNDLE_CACHE_SIZE ?? '500', 10),
|
|
12
|
-
dispose: (_value, key) => {
|
|
13
|
-
if (isLambdaEnv()) {
|
|
14
|
-
logger.warn(`Bundle evicted from cache: "${key}"`);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
logger.verbose(`Bundle evicted from cache: "${key}"`);
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
providers = [];
|
|
22
|
-
transformers = [];
|
|
23
|
-
bundleConfig;
|
|
24
|
-
// Pending bundle definitions are tracked to prevent concurrent resolution of the same bundle.
|
|
25
|
-
// Subsequent requests for the same bundle will await the original promise.
|
|
26
|
-
// Cache entries will be removed once the bundle is resolved.
|
|
27
|
-
inflightBundleDefinitions = new InflightTasks();
|
|
28
8
|
constructor(config, globalConfig) {
|
|
9
|
+
this.cache = new LRUCache({
|
|
10
|
+
max: parseInt(process.env.BUNDLE_CACHE_SIZE ?? '500', 10),
|
|
11
|
+
dispose: (_value, key) => {
|
|
12
|
+
if (isLambdaEnv()) {
|
|
13
|
+
logger.warn(`Bundle evicted from cache: "${key}"`);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
logger.verbose(`Bundle evicted from cache: "${key}"`);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
this.providers = [];
|
|
21
|
+
this.transformers = [];
|
|
22
|
+
// Pending bundle definitions are tracked to prevent concurrent resolution of the same bundle.
|
|
23
|
+
// Subsequent requests for the same bundle will await the original promise.
|
|
24
|
+
// Cache entries will be removed once the bundle is resolved.
|
|
25
|
+
this.inflightBundleDefinitions = new InflightTasks();
|
|
29
26
|
this.moduleRegistry = config.moduleRegistry;
|
|
30
27
|
this.appObserver = config.appObserver;
|
|
31
28
|
// Freeze the bundle config to make sure it is not modified
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.22.
|
|
7
|
+
"version": "0.22.7-alpha.6",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"build/**/*.d.ts"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@lwrjs/diagnostics": "0.22.
|
|
47
|
-
"@lwrjs/instrumentation": "0.22.
|
|
48
|
-
"@lwrjs/shared-utils": "0.22.
|
|
46
|
+
"@lwrjs/diagnostics": "0.22.7-alpha.6",
|
|
47
|
+
"@lwrjs/instrumentation": "0.22.7-alpha.6",
|
|
48
|
+
"@lwrjs/shared-utils": "0.22.7-alpha.6",
|
|
49
49
|
"@rollup/plugin-replace": "^5.0.7",
|
|
50
50
|
"lru-cache": "^10.4.3",
|
|
51
51
|
"rollup": "^2.79.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@lwrjs/types": "0.22.
|
|
54
|
+
"@lwrjs/types": "0.22.7-alpha.6",
|
|
55
55
|
"jest": "29.7.0",
|
|
56
56
|
"ts-jest": "^29.2.6"
|
|
57
57
|
},
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"volta": {
|
|
65
65
|
"extends": "../../../package.json"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "26945a25c6387c4a0b76eb7707bab6cf726bf357"
|
|
68
68
|
}
|