@lwrjs/view-registry 0.7.0-alpha.9 → 0.8.0-alpha.0

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.
@@ -56,7 +56,6 @@ async function getHtmlResources(view, viewParams, resourceContext) {
56
56
  const visitedCache = new Map();
57
57
  const imports = {};
58
58
  const rootComponents = [];
59
- const rootProperties = {};
60
59
  const requiredAmdModules = [];
61
60
  const preloadAmdModules = [];
62
61
  if (isAMD) {
@@ -114,9 +113,6 @@ async function getHtmlResources(view, viewParams, resourceContext) {
114
113
  moduleResources.push((0, import_utils.getModuleResourceByUri)(uri2, runtimeEnvironment, true));
115
114
  rootComponents.push(specifier);
116
115
  imports[specifier] = uri2;
117
- if (isSSR && props) {
118
- rootProperties[specifier] = props;
119
- }
120
116
  if (isAMD) {
121
117
  preloadAmdModules.push(specifier);
122
118
  for (const staticDep of graph.graphs[0].static) {
@@ -142,7 +138,6 @@ async function getHtmlResources(view, viewParams, resourceContext) {
142
138
  default: (0, import_shared_utils.getModuleUriPrefix)(runtimeEnvironment, runtimeParams)
143
139
  },
144
140
  rootComponents,
145
- rootProperties: isSSR ? rootProperties : void 0,
146
141
  ...isAMD && {requiredModules: requiredAmdModules},
147
142
  ...isAMD && {preloadModules: preloadAmdModules}
148
143
  }, runtimeEnvironment, runtimeParams));
@@ -56,7 +56,6 @@ async function getHtmlResources(view, viewParams, resourceContext) {
56
56
  const visitedCache = new Map();
57
57
  const imports = {};
58
58
  const rootComponents = [];
59
- const rootProperties = {};
60
59
  const requiredAmdModules = [];
61
60
  const preloadAmdModules = [];
62
61
  if (isAMD) {
@@ -115,9 +114,6 @@ async function getHtmlResources(view, viewParams, resourceContext) {
115
114
  moduleResources.push((0, import_utils.getModuleResourceByUri)(uri2, runtimeEnvironment, true));
116
115
  rootComponents.push(specifier);
117
116
  imports[specifier] = uri2;
118
- if (isSSR && props) {
119
- rootProperties[specifier] = props;
120
- }
121
117
  if (isAMD) {
122
118
  preloadAmdModules.push(specifier);
123
119
  for (const staticDep of graph.graphs[0].static) {
@@ -142,7 +138,6 @@ async function getHtmlResources(view, viewParams, resourceContext) {
142
138
  imports: importMetadata?.imports,
143
139
  index: importMetadata?.index,
144
140
  rootComponents,
145
- rootProperties: isSSR ? rootProperties : void 0,
146
141
  ...isAMD && {requiredModules: requiredAmdModules},
147
142
  ...isAMD && {preloadModules: preloadAmdModules}
148
143
  }, runtimeEnvironment, runtimeParams));
@@ -45,7 +45,11 @@ var LwrViewHandler = class {
45
45
  return response;
46
46
  }
47
47
  const {view, viewParams, renderOptions} = normalizeViewProperties(viewRequest, response, route, this.globalConfig);
48
- const viewDefinition2 = await this.viewRegistry.getViewDefinition(view, viewParams, runtimeEnvironment, runtimeParams, renderOptions);
48
+ const viewDefinition2 = await this.viewRegistry.getViewDefinition(view, viewParams, runtimeEnvironment, {
49
+ ...runtimeParams,
50
+ params: viewRequest.params,
51
+ query: viewRequest.query
52
+ }, renderOptions);
49
53
  return {
50
54
  ...response,
51
55
  body: viewDefinition2.renderedView,
@@ -114,7 +118,11 @@ var LwrViewHandler = class {
114
118
  rootComponent,
115
119
  contentTemplate,
116
120
  layoutTemplate
117
- }, {page, ...properties}, runtimeEnvironment, runtimeParams);
121
+ }, {page, ...properties}, runtimeEnvironment, {
122
+ ...runtimeParams,
123
+ params: viewRequest.params,
124
+ query: viewRequest.query
125
+ });
118
126
  return viewDefinition;
119
127
  }
120
128
  async getRouteHandlerResponse(viewRequest, route, runtimeEnvironment, runtimeParams = {}) {
@@ -137,8 +145,9 @@ var LwrViewHandler = class {
137
145
  this.routeHandlerFunctionMap.set(routeHandler, routeHandlerFunction);
138
146
  this.inflightRouteHandlerEvalMap.delete(routeHandler);
139
147
  }
148
+ const locale = runtimeParams.locale;
140
149
  const viewApi = this.getBoundApi(route, runtimeEnvironment, runtimeParams);
141
- const response = await routeHandlerFunction(viewRequest, {route, viewApi, ...paths});
150
+ const response = await routeHandlerFunction({...viewRequest, locale}, {route, viewApi, ...paths});
142
151
  return response;
143
152
  }
144
153
  getBoundApi(route, runtimeEnvironment, runtimeParams) {
@@ -35,8 +35,6 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
35
35
  const imports = {};
36
36
  // Collection of root view component specifiers
37
37
  const rootComponents = [];
38
- // Collection of root view component properties, used for SSR hydration
39
- const rootProperties = {};
40
38
  // Collection of modules specifiers that MUST be loaded in the view
41
39
  const requiredAmdModules = [];
42
40
  // Collection of modules that will be loaded in the view
@@ -124,10 +122,6 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
124
122
  // ADD register custom elements as a uri addressable rootComponents
125
123
  rootComponents.push(specifier);
126
124
  imports[specifier] = uri;
127
- // ADD properties for each rootComponent if SSR is on
128
- if (isSSR && props) {
129
- rootProperties[specifier] = props;
130
- }
131
125
  if (isAMD) {
132
126
  preloadAmdModules.push(specifier);
133
127
  for (const staticDep of graph.graphs[0].static) {
@@ -156,7 +150,6 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
156
150
  default: getModuleUriPrefix(runtimeEnvironment, runtimeParams),
157
151
  },
158
152
  rootComponents,
159
- rootProperties: isSSR ? rootProperties : undefined,
160
153
  ...(isAMD && { requiredModules: requiredAmdModules }),
161
154
  ...(isAMD && { preloadModules: preloadAmdModules }),
162
155
  }, runtimeEnvironment, runtimeParams));
@@ -35,8 +35,6 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
35
35
  const imports = {};
36
36
  // Collection of root view component specifiers
37
37
  const rootComponents = [];
38
- // Collection of root view component properties, used for SSR hydration
39
- const rootProperties = {};
40
38
  // Collection of modules specifiers that MUST be loaded in the view
41
39
  const requiredAmdModules = [];
42
40
  // Collection of modules that will be loaded in the view
@@ -124,10 +122,6 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
124
122
  // ADD register custom elements as a uri addressable rootComponents
125
123
  rootComponents.push(specifier);
126
124
  imports[specifier] = uri;
127
- // ADD properties for each rootComponent if SSR is on
128
- if (isSSR && props) {
129
- rootProperties[specifier] = props;
130
- }
131
125
  if (isAMD) {
132
126
  preloadAmdModules.push(specifier);
133
127
  for (const staticDep of graph.graphs[0].static) {
@@ -155,7 +149,6 @@ export async function getHtmlResources(view, viewParams, resourceContext) {
155
149
  imports: importMetadata?.imports,
156
150
  index: importMetadata?.index,
157
151
  rootComponents,
158
- rootProperties: isSSR ? rootProperties : undefined,
159
152
  ...(isAMD && { requiredModules: requiredAmdModules }),
160
153
  ...(isAMD && { preloadModules: preloadAmdModules }),
161
154
  }, runtimeEnvironment, runtimeParams));
@@ -27,7 +27,11 @@ export class LwrViewHandler {
27
27
  }
28
28
  // Process ViewDefinitionResponse
29
29
  const { view, viewParams, renderOptions } = normalizeViewProperties(viewRequest, response, route, this.globalConfig);
30
- const viewDefinition = await this.viewRegistry.getViewDefinition(view, viewParams, runtimeEnvironment, runtimeParams, renderOptions);
30
+ const viewDefinition = await this.viewRegistry.getViewDefinition(view, viewParams, runtimeEnvironment, {
31
+ ...runtimeParams,
32
+ params: viewRequest.params,
33
+ query: viewRequest.query,
34
+ }, renderOptions);
31
35
  return {
32
36
  ...response,
33
37
  body: viewDefinition.renderedView,
@@ -127,7 +131,11 @@ export class LwrViewHandler {
127
131
  rootComponent,
128
132
  contentTemplate,
129
133
  layoutTemplate,
130
- }, { page, ...properties }, runtimeEnvironment, runtimeParams);
134
+ }, { page, ...properties }, runtimeEnvironment, {
135
+ ...runtimeParams,
136
+ params: viewRequest.params,
137
+ query: viewRequest.query,
138
+ });
131
139
  return viewDefinition;
132
140
  }
133
141
  async getRouteHandlerResponse(
@@ -159,8 +167,9 @@ export class LwrViewHandler {
159
167
  this.routeHandlerFunctionMap.set(routeHandler, routeHandlerFunction);
160
168
  this.inflightRouteHandlerEvalMap.delete(routeHandler);
161
169
  }
170
+ const locale = runtimeParams.locale;
162
171
  const viewApi = this.getBoundApi(route, runtimeEnvironment, runtimeParams);
163
- const response = await routeHandlerFunction(viewRequest, { route, viewApi, ...paths });
172
+ const response = await routeHandlerFunction({ ...viewRequest, locale }, { route, viewApi, ...paths });
164
173
  return response;
165
174
  }
166
175
  /*
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.7.0-alpha.9",
7
+ "version": "0.8.0-alpha.0",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -30,15 +30,15 @@
30
30
  "build/**/*.d.ts"
31
31
  ],
32
32
  "dependencies": {
33
- "@lwrjs/app-service": "0.7.0-alpha.9",
34
- "@lwrjs/diagnostics": "0.7.0-alpha.9",
35
- "@lwrjs/shared-utils": "0.7.0-alpha.9"
33
+ "@lwrjs/app-service": "0.8.0-alpha.0",
34
+ "@lwrjs/diagnostics": "0.8.0-alpha.0",
35
+ "@lwrjs/shared-utils": "0.8.0-alpha.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@lwrjs/types": "0.7.0-alpha.9"
38
+ "@lwrjs/types": "0.8.0-alpha.0"
39
39
  },
40
40
  "engines": {
41
- "node": ">=14.15.4 <17"
41
+ "node": ">=14.15.4 <19"
42
42
  },
43
- "gitHead": "522665298cc74f1898da6ed018fa72504bd72645"
43
+ "gitHead": "2e1f60ed13f9f8079f1333af9b614cd24715f3ad"
44
44
  }