@lwrjs/view-registry 0.10.0-alpha.18 → 0.10.0-alpha.19

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.
@@ -181,11 +181,13 @@ var LwrViewRegistry = class {
181
181
  if (cacheDisabled === false) {
182
182
  const route = this.globalConfig.routes.find((r) => r.id === view.id);
183
183
  const ttl = (0, import_shared_utils.shortestTtl)(viewDefinition.cache?.ttl, route?.cache?.ttl);
184
- this.viewDefinitions.set(viewDefCacheKey, {
185
- view,
186
- viewDefinition,
187
- paramKey: viewParamKey
188
- }, {ttl: ttl ? ttl * 1e3 : void 0});
184
+ if (ttl !== 0) {
185
+ this.viewDefinitions.set(viewDefCacheKey, {
186
+ view,
187
+ viewDefinition,
188
+ paramKey: viewParamKey
189
+ }, {ttl: ttl ? ttl * 1e3 : void 0});
190
+ }
189
191
  }
190
192
  return viewDefinition;
191
193
  }
@@ -29,6 +29,9 @@ __export(exports, {
29
29
  });
30
30
  var import_shared_utils = __toModule(require("@lwrjs/shared-utils"));
31
31
  function setPreloadModulesMeta(specifier, uri, groups, preloads) {
32
+ const [removedVersion, version] = specifier.split("/v/");
33
+ const normalizedSpecifier = version === import_shared_utils.VERSION_NOT_PROVIDED ? removedVersion : specifier;
34
+ specifier = normalizedSpecifier;
32
35
  const preloadModulesSpecifiers = preloads.specifiers;
33
36
  const preloadBundleGroupsMap = preloads.groups;
34
37
  const preloadModulesURIs = preloads.uris;
package/build/es/index.js CHANGED
@@ -181,13 +181,16 @@ export class LwrViewRegistry {
181
181
  if (cacheDisabled === false) {
182
182
  const route = this.globalConfig.routes.find((r) => r.id === view.id);
183
183
  const ttl = shortestTtl(viewDefinition.cache?.ttl, route?.cache?.ttl);
184
- this.viewDefinitions.set(viewDefCacheKey, {
185
- view,
186
- viewDefinition,
187
- paramKey: viewParamKey,
188
- },
189
- // s -> ms
190
- { ttl: ttl ? ttl * 1000 : undefined });
184
+ if (ttl !== 0) {
185
+ // cache view definition for the shortest ttl or until it is the least recently used when ttl is undefined
186
+ this.viewDefinitions.set(viewDefCacheKey, {
187
+ view,
188
+ viewDefinition,
189
+ paramKey: viewParamKey,
190
+ },
191
+ // s -> ms
192
+ { ttl: ttl ? ttl * 1000 : undefined });
193
+ }
191
194
  }
192
195
  return viewDefinition;
193
196
  }
@@ -3,6 +3,13 @@ import { explodeSpecifier, getGroupName, getVersionedModuleId, normalizeVersionT
3
3
  * keeps track of preloadModules metadata
4
4
  */
5
5
  export function setPreloadModulesMeta(specifier, uri, groups, preloads) {
6
+ // We need to support versionless preloadModules, including versionless rootComponents.
7
+ // Removing the "/v/version_not_provided" hack from the preloadModules specifier
8
+ // because otherwise the loader will wait for that module that will never get defined.
9
+ // TODO: remove pending W-12702948
10
+ const [removedVersion, version] = specifier.split('/v/');
11
+ const normalizedSpecifier = version === VERSION_NOT_PROVIDED ? removedVersion : specifier;
12
+ specifier = normalizedSpecifier;
6
13
  const preloadModulesSpecifiers = preloads.specifiers;
7
14
  const preloadBundleGroupsMap = preloads.groups;
8
15
  const preloadModulesURIs = preloads.uris;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.10.0-alpha.18",
7
+ "version": "0.10.0-alpha.19",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -30,16 +30,16 @@
30
30
  "build/**/*.d.ts"
31
31
  ],
32
32
  "dependencies": {
33
- "@lwrjs/app-service": "0.10.0-alpha.18",
34
- "@lwrjs/diagnostics": "0.10.0-alpha.18",
35
- "@lwrjs/shared-utils": "0.10.0-alpha.18",
36
- "lru-cache": "9.1.2"
33
+ "@lwrjs/app-service": "0.10.0-alpha.19",
34
+ "@lwrjs/diagnostics": "0.10.0-alpha.19",
35
+ "@lwrjs/shared-utils": "0.10.0-alpha.19",
36
+ "lru-cache": "^10.0.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@lwrjs/types": "0.10.0-alpha.18"
39
+ "@lwrjs/types": "0.10.0-alpha.19"
40
40
  },
41
41
  "engines": {
42
- "node": ">=16.0.0 <20"
42
+ "node": ">=16.0.0"
43
43
  },
44
- "gitHead": "15d09e9a17b6b070e162336234434d6800b2f32d"
44
+ "gitHead": "0bd55139c08ddf5a532978cfa9e037eaf27e78e2"
45
45
  }