@rindo/core 3.2.1 → 3.2.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.
@@ -279,37 +279,7 @@ function afterHydrate(e, t, r, s) {
279
279
  function finalizeHydrate(e, t, r, s, n) {
280
280
  try {
281
281
  if (inspectElement(s, t.documentElement, 0), !1 !== r.removeUnusedStyles) try {
282
- ((e, t) => {
283
- try {
284
- const r = e.head.querySelectorAll("style[data-styles]"), s = r.length;
285
- if (s > 0) {
286
- const n = (e => {
287
- const t = {
288
- attrs: new Set,
289
- classNames: new Set,
290
- ids: new Set,
291
- tags: new Set
292
- };
293
- return collectUsedSelectors(t, e), t;
294
- })(e.documentElement);
295
- for (let e = 0; e < s; e++) removeUnusedStyleText(n, t, r[e]);
296
- }
297
- } catch (e) {
298
- ((e, t, r) => {
299
- const s = {
300
- level: "error",
301
- type: "build",
302
- header: "Build Error",
303
- messageText: "build error",
304
- relFilePath: null,
305
- absFilePath: null,
306
- lines: []
307
- };
308
- null != t && (null != t.stack ? s.messageText = t.stack.toString() : null != t.message ? s.messageText = t.message.length ? t.message : "UNKNOWN ERROR" : s.messageText = t.toString()),
309
- null == e || shouldIgnoreError(s.messageText) || e.push(s);
310
- })(t, e);
311
- }
312
- })(t, s.diagnostics);
282
+ removeUnusedStyles(t, s.diagnostics);
313
283
  } catch (e) {
314
284
  renderCatchError(s, e);
315
285
  }
@@ -320,21 +290,12 @@ function finalizeHydrate(e, t, r, s, n) {
320
290
  }
321
291
  s.title = t.title, r.removeScripts && removeScripts(t.documentElement);
322
292
  try {
323
- ((e, t) => {
324
- let r = e.head.querySelector('link[rel="canonical"]');
325
- "string" == typeof t ? (null == r && (r = e.createElement("link"), r.setAttribute("rel", "canonical"),
326
- e.head.appendChild(r)), r.setAttribute("href", t)) : null != r && (r.getAttribute("href") || r.parentNode.removeChild(r));
327
- })(t, r.canonicalUrl);
293
+ updateCanonicalLink(t, r.canonicalUrl);
328
294
  } catch (e) {
329
295
  renderCatchError(s, e);
330
296
  }
331
297
  try {
332
- (e => {
333
- const t = e.head;
334
- let r = t.querySelector("meta[charset]");
335
- null == r ? (r = e.createElement("meta"), r.setAttribute("charset", "utf-8")) : r.remove(),
336
- t.insertBefore(r, t.firstChild);
337
- })(t);
298
+ relocateMetaCharset(t);
338
299
  } catch (e) {}
339
300
  hasError(s.diagnostics) || (s.httpStatus = 200);
340
301
  try {
@@ -385,7 +346,16 @@ import { MockWindow, cloneWindow, patchWindow, constrainTimeouts, serializeNodeT
385
346
 
386
347
  import { hydrateFactory } from "@rindo/core/hydrate-factory";
387
348
 
388
- const templateWindows = new Map, isPromise = e => !!e && ("object" == typeof e || "function" == typeof e) && "function" == typeof e.then, hasError = e => null != e && 0 !== e.length && e.some((e => "error" === e.level && "runtime" !== e.type)), shouldIgnoreError = e => e === TASK_CANCELED_MSG, TASK_CANCELED_MSG = "task canceled", parseCss = (e, t) => {
349
+ const templateWindows = new Map, isPromise = e => !!e && ("object" == typeof e || "function" == typeof e) && "function" == typeof e.then, hasError = e => null != e && 0 !== e.length && e.some((e => "error" === e.level && "runtime" !== e.type)), TASK_CANCELED_MSG = "task canceled", updateCanonicalLink = (e, t) => {
350
+ let r = e.head.querySelector('link[rel="canonical"]');
351
+ "string" == typeof t ? (null == r && (r = e.createElement("link"), r.setAttribute("rel", "canonical"),
352
+ e.head.appendChild(r)), r.setAttribute("href", t)) : null != r && (r.getAttribute("href") || r.parentNode.removeChild(r));
353
+ }, relocateMetaCharset = e => {
354
+ const t = e.head;
355
+ let r = t.querySelector("meta[charset]");
356
+ null == r ? (r = e.createElement("meta"), r.setAttribute("charset", "utf-8")) : r.remove(),
357
+ t.insertBefore(r, t.firstChild);
358
+ }, parseCss = (e, t) => {
389
359
  let r = 1, s = 1;
390
360
  const n = [], o = e => {
391
361
  const t = e.match(/\n/g);
@@ -732,6 +702,36 @@ const templateWindows = new Map, isPromise = e => !!e && ("object" == typeof e |
732
702
  }
733
703
  if (r) for (let t = 0, s = r.length; t < s; t++) collectUsedSelectors(e, r[t]);
734
704
  }
705
+ }, removeUnusedStyles = (e, t) => {
706
+ try {
707
+ const r = e.head.querySelectorAll("style[data-styles]"), s = r.length;
708
+ if (s > 0) {
709
+ const n = (e => {
710
+ const t = {
711
+ attrs: new Set,
712
+ classNames: new Set,
713
+ ids: new Set,
714
+ tags: new Set
715
+ };
716
+ return collectUsedSelectors(t, e), t;
717
+ })(e.documentElement);
718
+ for (let e = 0; e < s; e++) removeUnusedStyleText(n, t, r[e]);
719
+ }
720
+ } catch (e) {
721
+ ((e, t, r) => {
722
+ const s = {
723
+ level: "error",
724
+ type: "build",
725
+ header: "Build Error",
726
+ messageText: "build error",
727
+ relFilePath: null,
728
+ absFilePath: null,
729
+ lines: []
730
+ };
731
+ null != t && (null != t.stack ? s.messageText = t.stack.toString() : null != t.message ? s.messageText = t.message.length ? t.message : "UNKNOWN ERROR" : s.messageText = t.toString()),
732
+ null == e || (e => e === TASK_CANCELED_MSG)(s.messageText) || e.push(s);
733
+ })(t, e);
734
+ }
735
735
  }, removeUnusedStyleText = (e, t, r) => {
736
736
  try {
737
737
  const s = parseCss(r.innerHTML);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Rindo internals only to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -170,7 +170,7 @@ export interface RindoConfig {
170
170
  */
171
171
  invisiblePrehydration?: boolean;
172
172
  /**
173
- * Sets the task queue used by Rindo's runtime. The task queue schedules DOM read and writes
173
+ * Sets the task queue used by rindo's runtime. The task queue schedules DOM read and writes
174
174
  * across the frames to efficiently render and reduce layout thrashing. By default,
175
175
  * `async` is used. It's recommended to also try each setting to decide which works
176
176
  * best for your use-case. In all cases, if your app has many CPU intensive tasks causing the
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/testing",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Rindo internal testing platform to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Mock Doc (CommonJS) v3.2.1 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc (CommonJS) v3.2.2 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var mockDoc = (function(exports) {
5
5
  'use strict';
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Mock Doc v3.2.1 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc v3.2.2 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  const CONTENT_REF_ID = 'r';
5
5
  const ORG_LOCATION_ID = 'o';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/mock-doc",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Mock window, document and DOM outside of a browser environment.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "license": "MIT",
5
5
  "main": "./internal/rindo-core/index.cjs",
6
6
  "module": "./internal/rindo-core/index.js",
@@ -72,15 +72,15 @@
72
72
  "@yarnpkg/lockfile": "^1.1.0",
73
73
  "ansi-colors": "4.1.3",
74
74
  "assert": "^2.0.0",
75
- "autoprefixer": "10.4.13",
75
+ "autoprefixer": "10.4.14",
76
76
  "conventional-changelog-cli": "^2.2.2",
77
- "dts-bundle-generator": "~7.1.0",
77
+ "dts-bundle-generator": "~7.2.0",
78
78
  "eslint": "^8.23.1",
79
79
  "eslint-config-prettier": "^8.5.0",
80
80
  "eslint-plugin-jest": "^27.0.4",
81
- "eslint-plugin-jsdoc": "^39.3.1",
81
+ "eslint-plugin-jsdoc": "^40.0.0",
82
82
  "eslint-plugin-simple-import-sort": "^10.0.0",
83
- "execa": "7.0.0",
83
+ "execa": "7.1.1",
84
84
  "exit": "^0.1.2",
85
85
  "fs-extra": "^11.0.0",
86
86
  "glob": "8.1.0",
@@ -95,14 +95,14 @@
95
95
  "merge-source-map": "^1.1.0",
96
96
  "mime-db": "^1.46.0",
97
97
  "minimatch": "5.1.2",
98
- "node-fetch": "2.6.7",
98
+ "node-fetch": "3.3.1",
99
99
  "open": "^9.0.0",
100
100
  "open-in-editor": "2.2.0",
101
101
  "parse5": "7.1.2",
102
102
  "path-browserify": "^1.0.1",
103
103
  "pixelmatch": "5.3.0",
104
104
  "postcss": "^8.2.8",
105
- "prettier": "2.8.3",
105
+ "prettier": "2.8.7",
106
106
  "process": "^0.11.10",
107
107
  "prompts": "2.4.2",
108
108
  "puppeteer": "^19.5.0",
@@ -110,10 +110,10 @@
110
110
  "rollup-plugin-sourcemaps": "^0.6.3",
111
111
  "semver": "^7.3.7",
112
112
  "sizzle": "^2.3.6",
113
- "terser": "5.16.1",
114
- "typescript": "4.9.4",
113
+ "terser": "5.16.8",
114
+ "typescript": "4.9.5",
115
115
  "webpack": "^5.75.0",
116
- "ws": "8.12.0"
116
+ "ws": "8.13.0"
117
117
  },
118
118
  "engines": {
119
119
  "node": ">=14.10.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/screenshot",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "Rindo Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",