@lwrjs/view-registry 0.4.5 → 0.4.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.
package/LICENSE ADDED
@@ -0,0 +1,10 @@
1
+ MIT LICENSE
2
+
3
+ Copyright (c) 2020, Salesforce.com, Inc.
4
+ All rights reserved.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -166,7 +166,8 @@ var LwrViewRegistry = class {
166
166
  debug: runtimeEnvironment.debug
167
167
  });
168
168
  const viewParamKey = viewParamCacheKey ? (0, import_shared_utils.getCacheKeyFromJson)(viewParamCacheKey) : (0, import_shared_utils.getCacheKeyFromJson)(viewParams);
169
- if (!skipCaching && this.viewDefinitions.has(viewDefCacheKey)) {
169
+ const cacheDisabled = process.env.NOCACHE === "true" || skipCaching;
170
+ if (cacheDisabled === false && this.viewDefinitions.has(viewDefCacheKey)) {
170
171
  const viewDefinition2 = this.viewDefinitions.get(viewDefCacheKey);
171
172
  if (viewDefinition2 && viewDefinition2.paramKey === viewParamKey && viewDefinition2.viewDefinition.immutable) {
172
173
  return viewDefinition2.viewDefinition;
@@ -180,7 +181,7 @@ var LwrViewRegistry = class {
180
181
  this.pendingViewDefinitions.set(pendingViewDefCacheKey, pendingViewDefinition);
181
182
  const viewDefinition = await pendingViewDefinition;
182
183
  this.pendingViewDefinitions.delete(pendingViewDefCacheKey);
183
- if (!skipCaching) {
184
+ if (cacheDisabled === false) {
184
185
  this.viewDefinitions.set(viewDefCacheKey, {
185
186
  view: {id, bootstrap, rootComponent, contentTemplate, layoutTemplate},
186
187
  viewDefinition,
package/build/es/index.js CHANGED
@@ -169,8 +169,9 @@ export class LwrViewRegistry {
169
169
  const viewParamKey = viewParamCacheKey
170
170
  ? getCacheKeyFromJson(viewParamCacheKey)
171
171
  : getCacheKeyFromJson(viewParams);
172
+ const cacheDisabled = process.env.NOCACHE === 'true' || skipCaching;
172
173
  // important: cache key does not include the unbounded viewParams
173
- if (!skipCaching && this.viewDefinitions.has(viewDefCacheKey)) {
174
+ if (cacheDisabled === false && this.viewDefinitions.has(viewDefCacheKey)) {
174
175
  const viewDefinition = this.viewDefinitions.get(viewDefCacheKey);
175
176
  if (viewDefinition &&
176
177
  viewDefinition.paramKey === viewParamKey &&
@@ -186,7 +187,7 @@ export class LwrViewRegistry {
186
187
  this.pendingViewDefinitions.set(pendingViewDefCacheKey, pendingViewDefinition);
187
188
  const viewDefinition = await pendingViewDefinition;
188
189
  this.pendingViewDefinitions.delete(pendingViewDefCacheKey);
189
- if (!skipCaching) {
190
+ if (cacheDisabled === false) {
190
191
  this.viewDefinitions.set(viewDefCacheKey, {
191
192
  view: { id, bootstrap, rootComponent, contentTemplate, layoutTemplate },
192
193
  viewDefinition,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.4.5",
7
+ "version": "0.4.6",
8
8
  "homepage": "https://lwr.dev/",
9
9
  "repository": {
10
10
  "type": "git",
@@ -30,15 +30,16 @@
30
30
  "build/**/*.d.ts"
31
31
  ],
32
32
  "dependencies": {
33
- "@lwrjs/app-service": "0.4.5",
34
- "@lwrjs/diagnostics": "0.4.5",
35
- "@lwrjs/shared-utils": "0.4.5",
33
+ "@lwrjs/app-service": "0.4.6",
34
+ "@lwrjs/diagnostics": "0.4.6",
35
+ "@lwrjs/shared-utils": "0.4.6",
36
36
  "magic-string": "^0.25.7"
37
37
  },
38
38
  "devDependencies": {
39
- "@lwrjs/types": "0.4.5"
39
+ "@lwrjs/types": "0.4.6"
40
40
  },
41
41
  "engines": {
42
42
  "node": ">=14.15.4 <15"
43
- }
43
+ },
44
+ "gitHead": "71f599b20c35d612e55312e94804a97e7cc778e1"
44
45
  }