@quintype/framework 7.34.5-qlitics-removal-task.5 → 7.34.5-react-upgrade-v19.2

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.
@@ -13,14 +13,7 @@
13
13
  */
14
14
 
15
15
  import get from "lodash/get";
16
-
17
- // Qlitics deprecation warning
18
- const QLITICS_DEPRECATION_WARNING = `
19
- 🚨 QLITICS DEPRECATION WARNING 🚨
20
- Qlitics analytics has been deprecated and will be removed in a future version.
21
- Please migrate to Google Analytics (GA4) or other analytics solutions.
22
- For migration guidance, contact the development team.
23
- `;
16
+ import { runWhenIdle } from "./impl/run-when-idle";
24
17
 
25
18
  /**
26
19
  * Load qlitics.js. This should be done automatically for you
@@ -28,22 +21,21 @@ For migration guidance, contact the development team.
28
21
  */
29
22
  // istanbul ignore next
30
23
  export function startAnalytics({ mountAt = global.qtMountAt || "" } = {}) {
31
- // Check if qlitics is already initialized to avoid multiple warnings
32
- if (!global.qlitics) {
33
- console.warn(QLITICS_DEPRECATION_WARNING);
34
-
35
- // Create a no-op qlitics function to prevent errors
36
- global.qlitics = function () {
37
- // Silently ignore all qlitics calls to prevent breaking existing code
38
- // This ensures backward compatibility while deprecating the service
24
+ global.qlitics =
25
+ global.qlitics ||
26
+ function () {
27
+ (qlitics.q = qlitics.q || []).push(arguments);
39
28
  };
29
+ global.qlitics("init");
40
30
 
41
- // Initialize the no-op function
42
- global.qlitics("init");
43
- }
44
-
45
- // Note: We're no longer loading the actual qlitics.js script
46
- // This prevents any external dependencies while maintaining API compatibility
31
+ runWhenIdle(function () {
32
+ const s = document.createElement("script");
33
+ s.type = "text/javascript";
34
+ s.async = true;
35
+ s.src = `${mountAt}/qlitics.js`;
36
+ const x = document.getElementsByTagName("script")[0];
37
+ x.parentNode.insertBefore(s, x);
38
+ });
47
39
  }
48
40
 
49
41
  function pageTypeToQliticsPageType(pageType) {
@@ -68,13 +60,9 @@ function pageTypeToQliticsPageType(pageType) {
68
60
  * @returns {void}
69
61
  */
70
62
  export function registerStoryView(storyContentId) {
71
- // Qlitics is deprecated - this function now does nothing
72
- // Consider migrating to GA4 or other analytics solutions
73
- if (global.qlitics && typeof global.qlitics === 'function') {
74
- global.qlitics("track", "story-view", {
75
- "story-content-id": storyContentId,
76
- });
77
- }
63
+ global.qlitics("track", "story-view", {
64
+ "story-content-id": storyContentId,
65
+ });
78
66
  }
79
67
 
80
68
  /**
@@ -84,13 +72,9 @@ export function registerStoryView(storyContentId) {
84
72
  * @returns {void}
85
73
  */
86
74
  export function registerPageView(page, newPath) {
87
- // Qlitics is deprecated - only track in GA now
88
- if (global.qlitics && typeof global.qlitics === 'function') {
89
- global.qlitics("track", "page-view", {
90
- "page-type": pageTypeToQliticsPageType(page.pageType),
91
- });
92
- }
93
-
75
+ global.qlitics("track", "page-view", {
76
+ "page-type": pageTypeToQliticsPageType(page.pageType),
77
+ });
94
78
  if (page.pageType == "story-page") {
95
79
  registerStoryView(get(page.data, ["story", "id"]));
96
80
  }
@@ -111,10 +95,7 @@ export function registerPageView(page, newPath) {
111
95
  * @returns {void}
112
96
  */
113
97
  export function setMemberId(memberId) {
114
- // Qlitics is deprecated - this function now does nothing
115
- if (global.qlitics && typeof global.qlitics === 'function') {
116
- global.qlitics("set", "member-id", memberId);
117
- }
98
+ global.qlitics("set", "member-id", memberId);
118
99
  }
119
100
 
120
101
  /**
@@ -125,12 +106,9 @@ export function setMemberId(memberId) {
125
106
  * @returns {void}
126
107
  */
127
108
  export function registerStoryShare(storyContentId, socialMediaType, storyUrl) {
128
- // Qlitics is deprecated - this function now does nothing
129
- if (global.qlitics && typeof global.qlitics === 'function') {
130
- global.qlitics("track", "story-share", {
131
- "story-content-id": storyContentId,
132
- "social-media-type": socialMediaType,
133
- url: storyUrl,
134
- });
135
- }
109
+ global.qlitics("track", "story-share", {
110
+ "story-content-id": storyContentId,
111
+ "social-media-type": socialMediaType,
112
+ url: storyUrl,
113
+ });
136
114
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/framework",
3
- "version": "7.34.5-qlitics-removal-task.5",
3
+ "version": "7.34.5-react-upgrade-v19.2",
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
  "@grpc/grpc-js": "^1.12.5",
35
35
  "@jsdoc/salty": "^0.2.9",
36
- "@quintype/amp": "2.22.1-amp-access-flag.4",
36
+ "@quintype/amp": "^2.22.0",
37
37
  "@quintype/backend": "^2.7.0",
38
38
  "@quintype/components": "^3.5.0",
39
39
  "@quintype/prerender-node": "^3.2.26",
@@ -54,9 +54,9 @@
54
54
  "mocha-snapshots": "^4.2.0",
55
55
  "morgan": "^1.10.0",
56
56
  "path-to-regexp": "^6.2.0",
57
- "react": "^16.14.0",
58
- "react-dom": "^16.14.0",
59
- "react-redux": "^7.2.5",
57
+ "react": "^19.1.0",
58
+ "react-dom": "^19.1.0",
59
+ "react-redux": "^9.1.2",
60
60
  "react-router": "^5.2.1",
61
61
  "redux": "^4.1.1",
62
62
  "request-promise": "^4.2.6",
@@ -68,8 +68,6 @@ async function ampStoryPageHandler(
68
68
 
69
69
  return res.redirect(301, redirectUrl);
70
70
  }
71
- const enableAmpAccess = get(opts, ["enableAmpAccess"], false);
72
- const isAmpAccessEnabled = typeof enableAmpAccess === "function" && opts.enableAmpAccess(story);
73
71
 
74
72
  const domainSpecificOpts = getDomainSpecificOpts(opts, domainSlug);
75
73
  const url = urlLib.parse(req.url, true);
@@ -146,13 +144,6 @@ async function ampStoryPageHandler(
146
144
  });
147
145
  merge(mergedAdditionalConfig, additionalConfig, fetchedAdditionalConfig);
148
146
  }
149
- // the query appending happens in the worker, this is needed for any publisher who needs ad-free in amp story
150
- if(req && req.query && req.query.subscriber === "true") {
151
- merge(additionalConfig, { subscriber: true });
152
- }
153
- if (isAmpAccessEnabled) {
154
- merge(additionalConfig, { isAmpAccessEnabled: isAmpAccessEnabled });
155
- }
156
147
  const optimizeAmpHtml = get(domainSpecificOpts, ["featureConfig", "optimizeAmpHtml"], true);
157
148
  const ampHtml = ampifyStory({
158
149
  story,
package/server/routes.js CHANGED
@@ -117,7 +117,6 @@ exports.upstreamQuintypeRoutes = function upstreamQuintypeRoutes (
117
117
  app.all('/api/*', sketchesProxy)
118
118
  app.all('*/api/*', sketchesProxy)
119
119
  app.all('/login', sketchesProxy)
120
- // Qlitics is deprecated - this route will be removed in a future version
121
120
  app.all('/qlitics.js', sketchesProxy)
122
121
  app.all('/auth.form', sketchesProxy)
123
122
  app.all('/auth.callback', sketchesProxy)
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable no-unused-vars */
2
2
  /* eslint-disable no-undef */
3
3
  /* eslint-disable func-names */
4
- import supertest from "supertest";
5
- import { ampRoutes } from "../../server/routes";
4
+ const supertest = require("supertest");
5
+ const { ampRoutes } = require("../../server/routes");
6
6
 
7
7
  const assert = require("assert");
8
8
  const express = require("express");
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable func-names */
2
2
  /* eslint-disable consistent-return */
3
- import supertest from "supertest";
4
- import { setCorsHeaders } from "../../../server/amp/helpers";
3
+ const supertest = require("supertest");
4
+ const { setCorsHeaders } = require("../../../server/amp/helpers");
5
5
 
6
6
  const express = require("express");
7
7
  const assert = require("assert");
@@ -1,4 +1,4 @@
1
- import { NAVIGATE_TO_PAGE, SERVICE_WORKER_UPDATED } from "@quintype/components";
1
+ const { NAVIGATE_TO_PAGE, SERVICE_WORKER_UPDATED } = require("@quintype/components");
2
2
 
3
3
  const assert = require("assert");
4
4