create-sitecore-jss 22.2.0-canary.39 → 22.2.0-canary.40

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.
@@ -10,14 +10,10 @@ import metadata from './src/environments/metadata.json';
10
10
  * Define the required configuration values to be exported from the server.bundle.ts.
11
11
  */
12
12
 
13
- const apiKey = environment.sitecoreApiKey;
14
- const siteName = environment.sitecoreSiteName;
15
13
  const defaultLanguage = environment.defaultLanguage;
16
14
  const getClientFactoryConfig = getGraphQLClientFactoryConfig;
17
15
 
18
16
  export {
19
- apiKey,
20
- siteName,
21
17
  clientFactory,
22
18
  getClientFactoryConfig,
23
19
  dictionaryServiceFactory,
@@ -23,7 +23,6 @@ const requiredProperties = [
23
23
  'parseRouteUrl',
24
24
  'clientFactory',
25
25
  'getClientFactoryConfig',
26
- 'siteName',
27
26
  'defaultLanguage',
28
27
  'layoutServiceFactory',
29
28
  'dictionaryServiceFactory',
@@ -41,12 +40,16 @@ if (missingProperties.length > 0) {
41
40
  );
42
41
  }
43
42
 
43
+ const layoutService = layoutServiceFactory.create();
44
+
45
+ const dictionaryService = dictionaryServiceFactory.create();
46
+
47
+ const clientFactoryConfig = config.serverBundle.getClientFactoryConfig();
48
+
44
49
  /**
45
50
  * GraphQL endpoint resolution to meet the requirements of the http-proxy-middleware
46
51
  */
47
52
  const graphQLEndpoint = (() => {
48
- const clientFactoryConfig = config.serverBundle.getClientFactoryConfig();
49
-
50
53
  try {
51
54
  const graphQLEndpoint = new URL(clientFactoryConfig.endpoint);
52
55
  // Browser request path to the proxy. Includes only the pathname.
@@ -66,10 +69,6 @@ const graphQLEndpoint = (() => {
66
69
  }
67
70
  })();
68
71
 
69
- const layoutService = layoutServiceFactory.create();
70
-
71
- const dictionaryService = dictionaryServiceFactory.create();
72
-
73
72
  /**
74
73
  * Parse requested url in order to detect current route and language
75
74
  * @param {string} reqRoute requested route
@@ -138,6 +137,10 @@ server.use(
138
137
  components: config.serverBundle.components,
139
138
  metadata: config.serverBundle.metadata,
140
139
  },
140
+ render: {
141
+ clientFactory: config.serverBundle.clientFactory,
142
+ renderView,
143
+ },
141
144
  })
142
145
  );
143
146
 
@@ -13,7 +13,6 @@ export interface ServerBundle {
13
13
  parseRouteUrl: RouteUrlParser;
14
14
  clientFactory: GraphQLRequestClientFactory;
15
15
  getClientFactoryConfig: () => GraphQLRequestClientFactoryConfig;
16
- siteName: string;
17
16
  defaultLanguage: string;
18
17
  layoutServiceFactory: { create: () => LayoutService };
19
18
  dictionaryServiceFactory: { create: () => DictionaryService };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sitecore-jss",
3
- "version": "22.2.0-canary.39",
3
+ "version": "22.2.0-canary.40",
4
4
  "description": "Sitecore JSS initializer",
5
5
  "bin": "./dist/index.js",
6
6
  "scripts": {
@@ -63,5 +63,5 @@
63
63
  "ts-node": "^10.9.1",
64
64
  "typescript": "~4.9.5"
65
65
  },
66
- "gitHead": "b4f4b36dd7b9b0aadabfeca4c8886ca3db8cfec5"
66
+ "gitHead": "5df1777482a509977ed6b3273e7eef6e3053869f"
67
67
  }