@quintype/framework 7.18.0-test-ga.0 → 7.18.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.
- package/CHANGELOG.md +12 -0
- package/client/start.js +34 -36
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [7.18.0](https://github.com/quintype/quintype-node-framework/compare/v7.15.2...v7.18.0) (2023-01-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **amp:** Decode embed using utf 8 ([#345](https://github.com/quintype/quintype-node-framework/issues/345)) ([4e8a3b3](https://github.com/quintype/quintype-node-framework/commit/4e8a3b38b9be62571f96e69e8b976ff610daf068))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* Amp chartbeat domain ([#344](https://github.com/quintype/quintype-node-framework/issues/344)) ([cbfd2f1](https://github.com/quintype/quintype-node-framework/commit/cbfd2f1a439fffbd4b9ba619d59df0165005a64a))
|
|
16
|
+
|
|
5
17
|
## [7.17.0](https://github.com/quintype/quintype-node-framework/compare/v7.16.1...v7.17.0) (2022-12-21)
|
|
6
18
|
|
|
7
19
|
|
package/client/start.js
CHANGED
|
@@ -55,20 +55,20 @@ function getRouteData(path, { location = global.location, existingFetch, mountAt
|
|
|
55
55
|
const [routeDataPath, relativePath] = getRouteDataAndPath(path, mountAt);
|
|
56
56
|
const url = new URL(relativePath, location.origin);
|
|
57
57
|
return (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
existingFetch ||
|
|
59
|
+
fetch(`${routeDataPath}?path=${encodeURIComponent(url.pathname)}${url.search ? `&${url.search.slice(1)}` : ""}`, {
|
|
60
|
+
credentials: "same-origin",
|
|
61
|
+
})
|
|
62
62
|
)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
.then((response) => {
|
|
64
|
+
if (response.status == 404) {
|
|
65
|
+
// There is a chance this might abort
|
|
66
|
+
maybeBypassServiceWorker();
|
|
67
|
+
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
return response.json();
|
|
70
|
+
})
|
|
71
|
+
.then(maybeRedirect);
|
|
72
72
|
|
|
73
73
|
function maybeRedirect(page) {
|
|
74
74
|
// This next line aborts the entire load
|
|
@@ -123,7 +123,7 @@ export function navigateToPage(dispatch, path, doNotPushPath) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
Promise.resolve(
|
|
126
|
-
|
|
126
|
+
pickComponentWrapper && pickComponentWrapper.preloadComponent(page.pageType, page.subPageType)
|
|
127
127
|
).then(() => {
|
|
128
128
|
dispatch({
|
|
129
129
|
type: NAVIGATE_TO_PAGE,
|
|
@@ -165,10 +165,8 @@ export function maybeNavigateTo(path, store) {
|
|
|
165
165
|
*/
|
|
166
166
|
export function maybeSetUrl(path, title) {
|
|
167
167
|
if (global.location.pathname === path) return;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
global.history.pushState(null, title, path);
|
|
171
|
-
}
|
|
168
|
+
global.history.pushState && global.history.pushState(null, title, path);
|
|
169
|
+
global.document.title = title;
|
|
172
170
|
}
|
|
173
171
|
|
|
174
172
|
/**
|
|
@@ -185,7 +183,7 @@ export function renderComponent(clazz, container, store, props = {}, callback) {
|
|
|
185
183
|
|
|
186
184
|
const containerEle = document.getElementById(container);
|
|
187
185
|
|
|
188
|
-
if
|
|
186
|
+
if(!containerEle){
|
|
189
187
|
console && console.log(`Rendering component on DOM id ${container} FAILED, node not available`);
|
|
190
188
|
return null;
|
|
191
189
|
}
|
|
@@ -208,16 +206,16 @@ export function renderIsomorphicComponent(container, store, pickComponent, props
|
|
|
208
206
|
if (!store.getState().qt.disableIsomorphicComponent) {
|
|
209
207
|
pickComponentWrapper = makePickComponentSync(pickComponent);
|
|
210
208
|
return pickComponentWrapper
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
209
|
+
.preloadComponent(store.getState().qt.pageType, store.getState().qt.subPageType)
|
|
210
|
+
.then(() =>
|
|
211
|
+
renderComponent(
|
|
212
|
+
IsomorphicComponent,
|
|
213
|
+
container,
|
|
214
|
+
store,
|
|
215
|
+
Object.assign({ pickComponent: pickComponentWrapper }, props),
|
|
216
|
+
() => store.dispatch({ type: CLIENT_SIDE_RENDERED })
|
|
217
|
+
)
|
|
218
|
+
);
|
|
221
219
|
}
|
|
222
220
|
console && console.log("IsomorphicComponent is disabled");
|
|
223
221
|
}
|
|
@@ -266,15 +264,15 @@ export function startApp(renderApplication, reducers, opts) {
|
|
|
266
264
|
const path = `${location.pathname}${location.search || ""}`;
|
|
267
265
|
const staticData = global.staticPageStoreContent || getJsonContent("static-page");
|
|
268
266
|
const dataPromise = staticData
|
|
269
|
-
|
|
270
|
-
|
|
267
|
+
? Promise.resolve(staticData.qt)
|
|
268
|
+
: getRouteData(path, { existingFetch: global.initialFetch });
|
|
271
269
|
|
|
272
270
|
startAnalytics();
|
|
273
271
|
|
|
274
272
|
const store = createQtStore(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
273
|
+
reducers,
|
|
274
|
+
(staticData && staticData.qt) || global.initialPage || getJsonContent("initial-page") || {},
|
|
275
|
+
{}
|
|
278
276
|
);
|
|
279
277
|
|
|
280
278
|
if (opts.preRenderApplication) {
|
|
@@ -316,9 +314,9 @@ export function startApp(renderApplication, reducers, opts) {
|
|
|
316
314
|
|
|
317
315
|
if (page.title) {
|
|
318
316
|
global.document.title = get(
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
317
|
+
page,
|
|
318
|
+
["data", "customSeo", "title"],
|
|
319
|
+
get(page, ["data", "story", "seo", "meta-title"], page.title)
|
|
322
320
|
);
|
|
323
321
|
}
|
|
324
322
|
return store;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/framework",
|
|
3
|
-
"version": "7.18.0
|
|
3
|
+
"version": "7.18.0",
|
|
4
4
|
"description": "Libraries to help build Quintype Node.js apps",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@ampproject/toolbox-optimizer": "2.8.3",
|
|
34
34
|
"@quintype/amp": "^2.9.1",
|
|
35
35
|
"@quintype/backend": "^2.3.3",
|
|
36
|
-
"@quintype/components": "^3.
|
|
36
|
+
"@quintype/components": "^3.3.0",
|
|
37
37
|
"@quintype/prerender-node": "^3.2.26",
|
|
38
38
|
"@quintype/seo": "^1.39.0",
|
|
39
39
|
"atob": "^2.1.2",
|