@lwrjs/view-registry 0.12.0-alpha.20 → 0.12.0-alpha.22

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.
@@ -32,6 +32,15 @@ var import_identity = __toModule(require("@lwrjs/app-service/identity"));
32
32
  var import_utils = __toModule(require("../utils.cjs"));
33
33
  var import_utils2 = __toModule(require("./utils.cjs"));
34
34
  var import_preload_utils = __toModule(require("./preload-utils.cjs"));
35
+ function includeIdFactory(bundleConfig) {
36
+ return (moduleRef) => {
37
+ const {external} = bundleConfig || {};
38
+ if (external && external[moduleRef.specifier] !== void 0) {
39
+ return false;
40
+ }
41
+ return true;
42
+ };
43
+ }
35
44
  async function getHtmlResources(view, viewParams, resourceContext) {
36
45
  const {
37
46
  runtimeEnvironment,
@@ -71,6 +80,9 @@ async function getHtmlResources(view, viewParams, resourceContext) {
71
80
  } = view;
72
81
  const defRegistry = bundle ? moduleBundler : moduleRegistry;
73
82
  const depth = isAMD ? {static: import_shared_utils.GraphDepth.ALL, dynamic: 1} : {static: import_shared_utils.GraphDepth.NONE, dynamic: 0};
83
+ if (isAMD) {
84
+ depth.includeId = includeIdFactory(bundleConfig);
85
+ }
74
86
  const appIdentity = {
75
87
  appName,
76
88
  format: runtimeEnvironment.format,
@@ -4,6 +4,18 @@ import { AppResourceEnum, getAppSpecifier } from '@lwrjs/app-service/identity';
4
4
  import { generateHtmlTag, getModuleResourceByUri } from '../utils.js';
5
5
  import { flattenCustomElements, getViewBootstrapConfigurationResource, getViewHmrConfigurationResource, } from './utils.js';
6
6
  import { setPreloadModulesMeta, getPreloadModulesMeta } from './preload-utils.js';
7
+ function includeIdFactory(bundleConfig) {
8
+ return (moduleRef) => {
9
+ const { external } = bundleConfig || {};
10
+ // Do not bundle externals, including the loader module, which is auto bundled
11
+ // with the shim + loader combo
12
+ if (external && external[moduleRef.specifier] !== undefined) {
13
+ // Do not include externals in the required imports but also return false to indicate it should not be in the bundle
14
+ return false;
15
+ }
16
+ return true;
17
+ };
18
+ }
7
19
  export async function getHtmlResources(view, viewParams, resourceContext) {
8
20
  const { runtimeEnvironment, runtimeParams, moduleRegistry, moduleBundler, resourceRegistry, viewMetadata, } = resourceContext;
9
21
  const { lwrVersion, format, hmrEnabled, bundle, debug, minify } = runtimeEnvironment;
@@ -40,6 +52,9 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
40
52
  const depth = isAMD
41
53
  ? { static: GraphDepth.ALL, dynamic: 1 }
42
54
  : { static: GraphDepth.NONE, dynamic: 0 };
55
+ if (isAMD) {
56
+ depth.includeId = includeIdFactory(bundleConfig);
57
+ }
43
58
  // The Application Bootstrap (ABS) module resource is EITHER
44
59
  // - configured as routes[x].bootstrap.module OR
45
60
  // - defaulted as "@lwrjs/app-service/{appName}/module/{format}"
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.12.0-alpha.20",
7
+ "version": "0.12.0-alpha.22",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -30,17 +30,17 @@
30
30
  "build/**/*.d.ts"
31
31
  ],
32
32
  "dependencies": {
33
- "@lwrjs/app-service": "0.12.0-alpha.20",
34
- "@lwrjs/diagnostics": "0.12.0-alpha.20",
35
- "@lwrjs/instrumentation": "0.12.0-alpha.20",
36
- "@lwrjs/shared-utils": "0.12.0-alpha.20",
33
+ "@lwrjs/app-service": "0.12.0-alpha.22",
34
+ "@lwrjs/diagnostics": "0.12.0-alpha.22",
35
+ "@lwrjs/instrumentation": "0.12.0-alpha.22",
36
+ "@lwrjs/shared-utils": "0.12.0-alpha.22",
37
37
  "lru-cache": "^10.2.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@lwrjs/types": "0.12.0-alpha.20"
40
+ "@lwrjs/types": "0.12.0-alpha.22"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=18.0.0"
44
44
  },
45
- "gitHead": "ae1793e34eaf4e9b97996d7aea9031908b23a13a"
45
+ "gitHead": "6eb804007e93e513d4eb60fd321c088bad3c698e"
46
46
  }