@lwrjs/static 0.15.0-alpha.21 → 0.15.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.
@@ -127,7 +127,7 @@ var DecisionTreeImpl = class {
127
127
  const ssrChoice = match.variants[import_shared_utils.SSR_SIGIL] || CHOICE_EMPTY;
128
128
  const ssr = ssrChoice ? [ssrChoice, CHOICE_WILDCARD] : [CHOICE_WILDCARD];
129
129
  const localeChoice = match.variants[import_shared_utils.LOCALE_SIGIL];
130
- const localeId = localeChoice && localeFallbacks ? localeFallbacks[localeChoice] : [CHOICE_WILDCARD];
130
+ const localeId = localeFallbacks?.[localeChoice] ?? [CHOICE_WILDCARD];
131
131
  return this.getOrderedChoices([specifier], envChoice, ssr, versions, localeId);
132
132
  }
133
133
  };
@@ -7,7 +7,7 @@ export interface ArtifactVariantId {
7
7
  ssr?: boolean;
8
8
  }
9
9
  export default class DecisionTreeImpl<Artifact extends SiteArtifact> implements DecisionTree<Artifact> {
10
- private root;
10
+ private readonly root;
11
11
  insert(siteArtifactId: string, artifact: Artifact, debug?: boolean, localeFallbacks?: Record<string, string[]>): void;
12
12
  /**
13
13
  * A method to handle deeper insertions, preserving the unique paths.
@@ -38,8 +38,8 @@ export default class DecisionTreeImpl {
38
38
  }
39
39
  // Insert an artifact into the tree based on a path of decisions
40
40
  insert(siteArtifactId, artifact, debug, localeFallbacks) {
41
- // The decision path is the set of choices needed to get to the right metadata
42
- // Currently this is hard coded to [specifier, isDebug, version, locale]
41
+ // The decision path is the set of choices needed to get to the right metadata
42
+ // Currently this is hard coded to [specifier, isDebug, version, ssr, locale]
43
43
  const decisionPath = this.createPossibleArtifactChoices({
44
44
  id: siteArtifactId,
45
45
  localeFallbacks,
@@ -163,7 +163,8 @@ export default class DecisionTreeImpl {
163
163
  const ssrChoice = match.variants[SSR_SIGIL] || CHOICE_EMPTY;
164
164
  const ssr = ssrChoice ? [ssrChoice, CHOICE_WILDCARD] : [CHOICE_WILDCARD];
165
165
  const localeChoice = match.variants[LOCALE_SIGIL];
166
- const localeId = localeChoice && localeFallbacks ? localeFallbacks[localeChoice] : [CHOICE_WILDCARD];
166
+ // If there are no fallbacks, or localeChoice is not in fallbacks use the ['*'] wildcard choice
167
+ const localeId = localeFallbacks?.[localeChoice] ?? [CHOICE_WILDCARD];
167
168
  return this.getOrderedChoices([specifier], envChoice, ssr, versions, localeId);
168
169
  }
169
170
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.15.0-alpha.21",
7
+ "version": "0.15.0-alpha.22",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -52,12 +52,12 @@
52
52
  "build/**/*.d.ts"
53
53
  ],
54
54
  "dependencies": {
55
- "@lwrjs/diagnostics": "0.15.0-alpha.21",
56
- "@lwrjs/shared-utils": "0.15.0-alpha.21",
55
+ "@lwrjs/diagnostics": "0.15.0-alpha.22",
56
+ "@lwrjs/shared-utils": "0.15.0-alpha.22",
57
57
  "lru-cache": "^10.4.3"
58
58
  },
59
59
  "devDependencies": {
60
- "@lwrjs/types": "0.15.0-alpha.21",
60
+ "@lwrjs/types": "0.15.0-alpha.22",
61
61
  "@types/express": "^4.17.21",
62
62
  "jest": "^26.6.3",
63
63
  "jest-express": "^1.12.0",
@@ -71,5 +71,5 @@
71
71
  "volta": {
72
72
  "extends": "../../../package.json"
73
73
  },
74
- "gitHead": "4c09ff654569ab490fc77f196d3230b31404940e"
74
+ "gitHead": "0c89221b041a09f05fe6463ad385941f0351dbbe"
75
75
  }