@lwrjs/module-bundler 0.10.2 → 0.11.0-alpha.1

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.
@@ -95,7 +95,7 @@ var LwrModuleBundler = class {
95
95
  } else {
96
96
  let resolvedVersion = moduleId.version || bundleDefinition.version;
97
97
  if (!resolvedVersion) {
98
- const {version} = await this.moduleRegistry.getModuleEntry(moduleId);
98
+ const {version} = await this.moduleRegistry.getModuleEntry(moduleId, runtimeParams);
99
99
  resolvedVersion = version;
100
100
  }
101
101
  uri = String(await this.moduleRegistry.resolveModuleUri({...moduleId, version: resolvedVersion}, runtimeEnvironment, runtimeParams, signature));
@@ -76,9 +76,9 @@ async function bundle(id, moduleGraphs, minify = false, unVersionedAliases = fal
76
76
  }
77
77
  return code;
78
78
  }
79
- async function getBundleCode(rootModule, moduleGraphs, includedModules, bundleGroupsIncludedModules, dynamicImports, minify, unVersionedAliases, includeId, moduleRegistry, runtimeEnvironment, runtimeParams = {}, visitedSpecifiers) {
79
+ async function getBundleCode(rootModule, moduleGraphs, includedModules, bundleGroupsIncludedModules, dynamicImports, minify, unVersionedAliases, includeId, moduleRegistry, runtimeEnvironment, runtimeParams, visitedSpecifiers) {
80
80
  const modules = [rootModule, ...moduleGraphs.graphs[0].static];
81
- const {moduleRecord} = await moduleRegistry.getModule((0, import_shared_utils.explodeSpecifier)(rootModule));
81
+ const {moduleRecord} = await moduleRegistry.getModule((0, import_shared_utils.explodeSpecifier)(rootModule), runtimeParams);
82
82
  if (moduleRecord.importMeta) {
83
83
  for (const specifier of modules) {
84
84
  const linkedDefinition = moduleGraphs.linkedDefinitions[specifier];
@@ -32,6 +32,7 @@ var import_esbuild = __toModule(require("esbuild"));
32
32
  var import_features = __toModule(require("@lwc/features"));
33
33
  var lwcFeatureFlags = "default" in import_features.default ? import_features.default.default : import_features.default;
34
34
  var lwcFeatureFlagDefinitions = Object.fromEntries(Object.keys(lwcFeatureFlags).map((feature) => [`lwcRuntimeFlags.${feature}`, "false"]));
35
+ delete lwcFeatureFlagDefinitions["lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE"];
35
36
  var esbuild = import_esbuild.default;
36
37
  if (!import_esbuild.default) {
37
38
  try {
@@ -23,7 +23,7 @@ export declare class LwrModuleBundler implements ModuleBundler {
23
23
  * @param signature - The signature of the bundle instance being referenced
24
24
  * @returns the URI
25
25
  */
26
- resolveModuleUri(moduleId: Required<Pick<ModuleId, 'specifier' | 'version'>>, runtimeEnvironment: RuntimeEnvironment, runtimeParams?: RuntimeParams, signature?: string): Promise<string>;
26
+ resolveModuleUri(moduleId: Required<Pick<ModuleId, 'specifier' | 'version'>>, runtimeEnvironment: RuntimeEnvironment, runtimeParams: RuntimeParams, signature?: string): Promise<string>;
27
27
  getPublicApi(): PublicModuleBundler;
28
28
  }
29
29
  export {};
package/build/es/index.js CHANGED
@@ -92,7 +92,7 @@ export class LwrModuleBundler {
92
92
  let resolvedVersion = moduleId.version || bundleDefinition.version;
93
93
  // If we do not know the version, look it up.
94
94
  if (!resolvedVersion) {
95
- const { version } = await this.moduleRegistry.getModuleEntry(moduleId);
95
+ const { version } = await this.moduleRegistry.getModuleEntry(moduleId, runtimeParams);
96
96
  resolvedVersion = version;
97
97
  }
98
98
  uri = String(await this.moduleRegistry.resolveModuleUri({ ...moduleId, version: resolvedVersion }, runtimeEnvironment, runtimeParams, signature));
@@ -18,7 +18,7 @@ function includeIdFactory(graphSpecifier, external, exclude = [], requiredImport
18
18
  const moduleIsNotRoot = graphSpecifier !== moduleRef.specifier;
19
19
  if (moduleRefIsGroupie) {
20
20
  // If this is part of bundle group return false to indicate it should not be in the bundle
21
- // but add it to the requriedImports so it shows up as a static dependency of the bundle.
21
+ // but add it to the requiredImports so it shows up as a static dependency of the bundle.
22
22
  // However, skip this if the requested specifier is also part of the same group.
23
23
  if (moduleIsNotRoot && !rootModuleIsGroupie) {
24
24
  requiredImports.set(`${moduleRef.specifier}_${moduleRef.version}`, moduleRef);
@@ -27,7 +27,7 @@ function includeIdFactory(graphSpecifier, external, exclude = [], requiredImport
27
27
  }
28
28
  else if (exclude?.includes(moduleRef.specifier)) {
29
29
  // If this is a bundle exclude return false to indicate it should not be in the bundle
30
- // but add it to the requriedImports so it shows up as a static dependency of the bundle.
30
+ // but add it to the requiredImports so it shows up as a static dependency of the bundle.
31
31
  if (moduleIsNotRoot) {
32
32
  requiredImports.set(`${moduleRef.specifier}_${moduleRef.version}`, moduleRef);
33
33
  }
@@ -60,9 +60,9 @@ async function bundle(id, moduleGraphs, minify = false, unVersionedAliases = fal
60
60
  }
61
61
  return code;
62
62
  }
63
- async function getBundleCode(rootModule, moduleGraphs, includedModules, bundleGroupsIncludedModules, dynamicImports, minify, unVersionedAliases, includeId, moduleRegistry, runtimeEnvironment, runtimeParams = {}, visitedSpecifiers) {
63
+ async function getBundleCode(rootModule, moduleGraphs, includedModules, bundleGroupsIncludedModules, dynamicImports, minify, unVersionedAliases, includeId, moduleRegistry, runtimeEnvironment, runtimeParams, visitedSpecifiers) {
64
64
  const modules = [rootModule, ...moduleGraphs.graphs[0].static];
65
- const { moduleRecord } = await moduleRegistry.getModule(explodeSpecifier(rootModule));
65
+ const { moduleRecord } = await moduleRegistry.getModule(explodeSpecifier(rootModule), runtimeParams);
66
66
  // add static imports from the LinkedModuleDefinitions added during module linking
67
67
  // they're not in the ModuleGraph imports b/c those are based on raw module source
68
68
  if (moduleRecord.importMeta) {
@@ -5,6 +5,8 @@ import features from '@lwc/features';
5
5
  const lwcFeatureFlags = 'default' in features ? features.default : features;
6
6
  // Set every LWC feature flag to false, so that the unused code can be tree-shaken
7
7
  const lwcFeatureFlagDefinitions = Object.fromEntries(Object.keys(lwcFeatureFlags).map((feature) => [`lwcRuntimeFlags.${feature}`, 'false']));
8
+ // We cannot set mixed mode to false across the app; it varies by route.
9
+ delete lwcFeatureFlagDefinitions['lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE'];
8
10
  // https://github.com/evanw/esbuild/issues/706
9
11
  // Fixed in 0.11.0 but upgrading past 0.9.7 has caused breaking changes for consumers...
10
12
  // https://github.com/salesforce-experience-platform-emu/lwr/issues/1014
@@ -3,7 +3,7 @@ import type { Plugin } from 'rollup';
3
3
  export interface RollupBundlePluginOptions {
4
4
  rootModuleDef: LinkedModuleDefinition;
5
5
  runtimeEnvironment: RuntimeEnvironment;
6
- runtimeParams?: RuntimeParams;
6
+ runtimeParams: RuntimeParams;
7
7
  moduleRegistry: ModuleRegistry;
8
8
  include?: string[];
9
9
  exclude?: string[];
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.10.2",
7
+ "version": "0.11.0-alpha.1",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -47,13 +47,13 @@
47
47
  "build/**/*.d.ts"
48
48
  ],
49
49
  "dependencies": {
50
- "@lwc/features": "~2.50.0",
51
- "@lwrjs/shared-utils": "0.10.2",
50
+ "@lwc/features": "~3.1.3",
51
+ "@lwrjs/shared-utils": "0.11.0-alpha.1",
52
52
  "@rollup/plugin-replace": "^2.4.2",
53
53
  "rollup": "^2.78.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@lwrjs/types": "0.10.2",
56
+ "@lwrjs/types": "0.11.0-alpha.1",
57
57
  "jest": "^26.6.3",
58
58
  "ts-jest": "^26.5.6"
59
59
  },
@@ -66,5 +66,5 @@
66
66
  "volta": {
67
67
  "extends": "../../../package.json"
68
68
  },
69
- "gitHead": "40988dfc093a3b9dea859f1bf61a49bca1edb0c5"
69
+ "gitHead": "6a840d4694fac9f0be5c3a21707015379cbadad7"
70
70
  }