tkeron 3.6.2 → 3.6.4

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 CHANGED
@@ -1,3 +1,7 @@
1
+ # v3.6.3
2
+
3
+ - update esbuild version
4
+
1
5
  # v3.6.0
2
6
 
3
7
  - the "from" method was added to the TkeronElement
@@ -3,16 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  (async () => {
4
4
  const review = async () => {
5
5
  const cb = new Date().getTime();
6
- const result = await fetch("/compdate.txt?cb=" + cb)
7
- .then((_) => _.json())
8
- .catch((_) => ({ reload: false }));
9
- const { reload } = result;
10
- if (reload) {
6
+ const resultText = await fetch("/compdate.txt?cb=" + cb)
7
+ .then((_) => _.text())
8
+ .catch((_) => "");
9
+ try {
10
+ if (JSON.parse(resultText)?.reload) {
11
+ location.reload();
12
+ setTimeout(review, 618);
13
+ return;
14
+ }
15
+ }
16
+ catch (_) { }
17
+ if (prevComp !== "" && resultText !== prevComp) {
18
+ prevComp = resultText;
11
19
  location.reload();
12
- setTimeout(review, 618);
13
- return;
14
20
  }
21
+ prevComp = resultText;
15
22
  setTimeout(review, 618 * 2);
16
23
  };
24
+ let prevComp = "";
17
25
  review();
18
26
  })();
@@ -1,16 +1,28 @@
1
1
  (async () => {
2
2
  const review = async () => {
3
3
  const cb = new Date().getTime();
4
- const result = await fetch("/compdate.txt?cb=" + cb)
5
- .then((_) => _.json())
6
- .catch((_) => ({ reload: false }));
7
- const { reload } = result as { reload: boolean };
8
- if (reload) {
4
+
5
+ const resultText = await fetch("/compdate.txt?cb=" + cb)
6
+ .then((_) => _.text())
7
+ .catch((_) => "");
8
+
9
+ try {
10
+ if (JSON.parse(resultText)?.reload) {
11
+ location.reload();
12
+ setTimeout(review, 618);
13
+ return;
14
+ }
15
+ } catch (_) {}
16
+
17
+ if (prevComp !== "" && resultText !== prevComp) {
18
+ prevComp = resultText;
9
19
  location.reload();
10
- setTimeout(review, 618);
11
- return;
12
20
  }
21
+
22
+ prevComp = resultText;
23
+
13
24
  setTimeout(review, 618 * 2);
14
25
  };
26
+ let prevComp = "";
15
27
  review();
16
28
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tkeron",
3
- "version": "3.6.2",
3
+ "version": "3.6.4",
4
4
  "description": "Micro framework for developing web user interfaces with typescript.",
5
5
  "bin": {
6
6
  "tkeron": "dist/index.js",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@tkeron/commands": "0.2.1",
22
22
  "colorette": "^2.0.19",
23
- "esbuild": "^0.24.0",
23
+ "esbuild": "^0.25.0",
24
24
  "express": "^4.21.1",
25
25
  "jsdom": "^25.0.1",
26
26
  "node-watch": "^0.7.3",