@quintype/framework 7.34.5-fw-amp-access-flag.0 → 7.34.5-qlitics-removal-task.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.
@@ -13,7 +13,14 @@
13
13
  */
14
14
 
15
15
  import get from "lodash/get";
16
- import { runWhenIdle } from "./impl/run-when-idle";
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
+ `;
17
24
 
18
25
  /**
19
26
  * Load qlitics.js. This should be done automatically for you
@@ -21,21 +28,22 @@ import { runWhenIdle } from "./impl/run-when-idle";
21
28
  */
22
29
  // istanbul ignore next
23
30
  export function startAnalytics({ mountAt = global.qtMountAt || "" } = {}) {
24
- global.qlitics =
25
- global.qlitics ||
26
- function () {
27
- (qlitics.q = qlitics.q || []).push(arguments);
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
28
39
  };
29
- global.qlitics("init");
30
40
 
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
- });
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
39
47
  }
40
48
 
41
49
  function pageTypeToQliticsPageType(pageType) {
@@ -60,9 +68,13 @@ function pageTypeToQliticsPageType(pageType) {
60
68
  * @returns {void}
61
69
  */
62
70
  export function registerStoryView(storyContentId) {
63
- global.qlitics("track", "story-view", {
64
- "story-content-id": storyContentId,
65
- });
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
+ }
66
78
  }
67
79
 
68
80
  /**
@@ -72,9 +84,13 @@ export function registerStoryView(storyContentId) {
72
84
  * @returns {void}
73
85
  */
74
86
  export function registerPageView(page, newPath) {
75
- global.qlitics("track", "page-view", {
76
- "page-type": pageTypeToQliticsPageType(page.pageType),
77
- });
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
+
78
94
  if (page.pageType == "story-page") {
79
95
  registerStoryView(get(page.data, ["story", "id"]));
80
96
  }
@@ -95,7 +111,10 @@ export function registerPageView(page, newPath) {
95
111
  * @returns {void}
96
112
  */
97
113
  export function setMemberId(memberId) {
98
- global.qlitics("set", "member-id", 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
+ }
99
118
  }
100
119
 
101
120
  /**
@@ -106,9 +125,12 @@ export function setMemberId(memberId) {
106
125
  * @returns {void}
107
126
  */
108
127
  export function registerStoryShare(storyContentId, socialMediaType, storyUrl) {
109
- global.qlitics("track", "story-share", {
110
- "story-content-id": storyContentId,
111
- "social-media-type": socialMediaType,
112
- url: storyUrl,
113
- });
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
+ }
114
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/framework",
3
- "version": "7.34.5-fw-amp-access-flag.0",
3
+ "version": "7.34.5-qlitics-removal-task.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
  "@grpc/grpc-js": "^1.12.5",
35
35
  "@jsdoc/salty": "^0.2.9",
36
- "@quintype/amp": "2.22.1-amp-access-flag.0",
36
+ "@quintype/amp": "2.22.1-qlitics-removal-code.0",
37
37
  "@quintype/backend": "^2.7.0",
38
38
  "@quintype/components": "^3.5.0",
39
39
  "@quintype/prerender-node": "^3.2.26",
package/server/routes.js CHANGED
@@ -117,6 +117,7 @@ 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
120
121
  app.all('/qlitics.js', sketchesProxy)
121
122
  app.all('/auth.form', sketchesProxy)
122
123
  app.all('/auth.callback', sketchesProxy)