@naanlang/naan 1.4.2 → 1.4.3
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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/bin/index.js +2 -2
- package/dist/naan.min.js +3 -3
- package/frameworks/browser/sworker.js +23 -23
- package/frameworks/project/projects.nlg +1 -1
- package/lib/browser/env_web.js +7 -7
- package/lib/core/naanlib.js +3 -3
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
*
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
var CurrentCacheName = "Naanlang-1.4.
|
|
39
|
+
var CurrentCacheName = "Naanlang-1.4.3+1";
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
//
|
|
@@ -92,18 +92,18 @@ var terminated; // flag that this service worker
|
|
|
92
92
|
var pubVersion = event.data.hereIsMyVersion;
|
|
93
93
|
var sourceId = event.source.id; // client id of sender of message
|
|
94
94
|
msgPorts[sourceId] = msgport;
|
|
95
|
-
console.log("[1.4.
|
|
96
|
-
if (pubVersion != "1.4.
|
|
95
|
+
console.log("[1.4.3+1] received new msgport for", sourceId, pubID, "-", pubVersion);
|
|
96
|
+
if (pubVersion != "1.4.3+1") {
|
|
97
97
|
if (upgradeMsgPorts) { // if not activated
|
|
98
|
-
console.log("[1.4.
|
|
98
|
+
console.log("[1.4.3+1] update pending for", sourceId);
|
|
99
99
|
upgradeMsgPorts[sourceId] = msgport;
|
|
100
100
|
}
|
|
101
101
|
else {
|
|
102
102
|
msgport.postMessage({ // notify new version available
|
|
103
103
|
id: "upgrade",
|
|
104
|
-
version: "1.4.
|
|
104
|
+
version: "1.4.3+1"
|
|
105
105
|
});
|
|
106
|
-
console.log("[1.4.
|
|
106
|
+
console.log("[1.4.3+1] update sent for:", sourceId);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
Reaper(); // clean up obsolete info
|
|
@@ -134,10 +134,10 @@ var terminated; // flag that this service worker
|
|
|
134
134
|
msgport.onmessage = function(msg) {
|
|
135
135
|
msg = msg.data;
|
|
136
136
|
if (msg.id == "skipWaiting") { // try to activate this SW now
|
|
137
|
-
console.log("[1.4.
|
|
137
|
+
console.log("[1.4.3+1] attempting skipWaiting");
|
|
138
138
|
self.skipWaiting();
|
|
139
139
|
} else if (msg.id == "terminate") { // termiante this SW now
|
|
140
|
-
console.log("[1.4.
|
|
140
|
+
console.log("[1.4.3+1] terminated");
|
|
141
141
|
terminate();
|
|
142
142
|
} else if (msg.id == "abortURL") { // abort an I/O transaction
|
|
143
143
|
var href = new URL(msg.url).href;
|
|
@@ -150,7 +150,7 @@ var terminated; // flag that this service worker
|
|
|
150
150
|
} else if (msg.id == "response") // response from fetch request
|
|
151
151
|
processResponse(msg);
|
|
152
152
|
else if (msg.id == "text") // just log some text
|
|
153
|
-
console.log("[1.4.
|
|
153
|
+
console.log("[1.4.3+1] msg received:", msg.text);
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
// send text to IDE log
|
|
@@ -161,7 +161,7 @@ var terminated; // flag that this service worker
|
|
|
161
161
|
// don't clutter the log
|
|
162
162
|
msgport.postMessage({
|
|
163
163
|
id: "text",
|
|
164
|
-
text: "port received by 1.4.
|
|
164
|
+
text: "port received by 1.4.3+1",
|
|
165
165
|
});
|
|
166
166
|
*/
|
|
167
167
|
if (--pending === 0)
|
|
@@ -178,7 +178,7 @@ var terminated; // flag that this service worker
|
|
|
178
178
|
includeUncontrolled: true
|
|
179
179
|
}).then(function(clientList) {
|
|
180
180
|
clientList.every(function(client) {
|
|
181
|
-
console.log("[1.4.
|
|
181
|
+
console.log("[1.4.3+1] requesting new msgport for", client.id);
|
|
182
182
|
++pending;
|
|
183
183
|
client.postMessage({ // tell client(s) we need this fetch source
|
|
184
184
|
msg: "Naan_need_fetch_port",
|
|
@@ -224,12 +224,12 @@ function Reaper() {
|
|
|
224
224
|
clients[clientList[clidex].id] = clientList[clidex];
|
|
225
225
|
for (var sourceId in msgPorts)
|
|
226
226
|
if (!clients[sourceId]) {
|
|
227
|
-
console.log("[1.4.
|
|
227
|
+
console.log("[1.4.3+1] source gone:", sourceId);
|
|
228
228
|
delete msgPorts[sourceId]; // no longer a source
|
|
229
229
|
}
|
|
230
230
|
for (var clientId in fetchPorts)
|
|
231
231
|
if (!clients[clientId]) {
|
|
232
|
-
console.log("[1.4.
|
|
232
|
+
console.log("[1.4.3+1] client gone:", clientId);
|
|
233
233
|
delete fetchPorts[clientId]; // no longer a client
|
|
234
234
|
}
|
|
235
235
|
for (var fqdex = 0; fqdex < fetchQueue.length; ++fqdex) {
|
|
@@ -263,16 +263,16 @@ function ClearCaches() {
|
|
|
263
263
|
return (Promise.all(
|
|
264
264
|
cacheNames.map(function(cacheName) {
|
|
265
265
|
if (cacheName != CurrentCacheName) {
|
|
266
|
-
console.log('[1.4.
|
|
266
|
+
console.log('[1.4.3+1] deleting old cache:', cacheName);
|
|
267
267
|
return (caches.delete(cacheName));
|
|
268
268
|
}
|
|
269
269
|
})
|
|
270
270
|
));
|
|
271
271
|
}).then(function() { // claim all clients
|
|
272
|
-
console.log('[1.4.
|
|
272
|
+
console.log('[1.4.3+1] claiming clients');
|
|
273
273
|
return (self.clients.claim());
|
|
274
274
|
}).then(function() {
|
|
275
|
-
console.log('[1.4.
|
|
275
|
+
console.log('[1.4.3+1] clients claimed');
|
|
276
276
|
return (Promise.resolve(true));
|
|
277
277
|
});
|
|
278
278
|
return (promise);
|
|
@@ -315,7 +315,7 @@ function GetClientResponse(event, urlpath) {
|
|
|
315
315
|
msgport.postMessage({
|
|
316
316
|
id: "fetch",
|
|
317
317
|
seq: seqno,
|
|
318
|
-
version: "1.4.
|
|
318
|
+
version: "1.4.3+1",
|
|
319
319
|
request: {
|
|
320
320
|
method: event.request.method,
|
|
321
321
|
url: event.request.url
|
|
@@ -363,7 +363,7 @@ function GetClientResponse(event, urlpath) {
|
|
|
363
363
|
*/
|
|
364
364
|
|
|
365
365
|
self.addEventListener('install', function(event) {
|
|
366
|
-
console.log("[1.4.
|
|
366
|
+
console.log("[1.4.3+1] install");
|
|
367
367
|
self.skipWaiting();
|
|
368
368
|
});
|
|
369
369
|
|
|
@@ -376,20 +376,20 @@ self.addEventListener('install', function(event) {
|
|
|
376
376
|
*/
|
|
377
377
|
|
|
378
378
|
self.addEventListener('activate', function(event) {
|
|
379
|
-
console.log("[1.4.
|
|
379
|
+
console.log("[1.4.3+1] activate");
|
|
380
380
|
self.clients.matchAll({ // for debugging, list controlled clients
|
|
381
381
|
includeUncontrolled: true
|
|
382
382
|
}).then(function(clientList) {
|
|
383
383
|
var urls = clientList.map(function(client) {
|
|
384
384
|
return (client.url);
|
|
385
385
|
});
|
|
386
|
-
console.log('[1.4.
|
|
386
|
+
console.log('[1.4.3+1] matching clients:', urls.join(', '));
|
|
387
387
|
});
|
|
388
388
|
var promise = ClearCaches().then(function() {
|
|
389
389
|
for (var sourceId in upgradeMsgPorts) {
|
|
390
390
|
upgradeMsgPorts[sourceId].postMessage({ // notify new version available
|
|
391
391
|
id: "upgrade",
|
|
392
|
-
version: "1.4.
|
|
392
|
+
version: "1.4.3+1"
|
|
393
393
|
});
|
|
394
394
|
}
|
|
395
395
|
upgradeMsgPorts = false;
|
|
@@ -421,7 +421,7 @@ self.addEventListener('fetch', function(event) {
|
|
|
421
421
|
var promise;
|
|
422
422
|
var url = new URL(request.url);
|
|
423
423
|
var nocache = request.method != "GET"
|
|
424
|
-
|| url.search.length !== 0 && url.searchParams.get("naanver") !== "
|
|
424
|
+
|| url.search.length !== 0 && url.searchParams.get("naanver") !== "3b6364f71856e32f6cb8edae0e67bbc2"
|
|
425
425
|
|| request.headers.get('range');
|
|
426
426
|
if (url.pathname.startsWith("/run/")) {
|
|
427
427
|
nocache = true;
|
|
@@ -455,7 +455,7 @@ self.addEventListener('fetch', function(event) {
|
|
|
455
455
|
statusText: "Request Cancelled"
|
|
456
456
|
}));
|
|
457
457
|
}
|
|
458
|
-
console.log("[1.4.
|
|
458
|
+
console.log("[1.4.3+1] fetch failed", request.url, e);
|
|
459
459
|
return (new Response(undefined, {
|
|
460
460
|
status: 404,
|
|
461
461
|
statusText: "Fetch Failed"
|
|
@@ -296,7 +296,7 @@ closure projConnector(projman, projtype, local connector, watch) {
|
|
|
296
296
|
*
|
|
297
297
|
* Nide.proj/
|
|
298
298
|
* nide_cliser.cfg - JSON definition of the project (see below)
|
|
299
|
-
* NaanIDE_version.txt - [default] substitution file defining 1.4.
|
|
299
|
+
* NaanIDE_version.txt - [default] substitution file defining 1.4.3+1 etc.
|
|
300
300
|
* NaanIDE_version_builds.txt - [default] contains current build number as decimal string
|
|
301
301
|
* build/ - [optional] default build output location
|
|
302
302
|
* NaanIDE.lic - [optional] defines Zulch Laboratories, Inc. and other license info
|
package/lib/browser/env_web.js
CHANGED
|
@@ -514,7 +514,7 @@ exports.NaanControllerWeb = function() {
|
|
|
514
514
|
statedoc.curversion = kStateCurrentVersion;
|
|
515
515
|
statedoc.firstver = kStateFirstVersion;
|
|
516
516
|
statedoc.licensee = "MIT-License";
|
|
517
|
-
statedoc.verstring = "1.4.
|
|
517
|
+
statedoc.verstring = "1.4.3+1";
|
|
518
518
|
statedoc.date = new Date().toISOString();
|
|
519
519
|
statedoc.prefs = prefs;
|
|
520
520
|
statedoc.naan = naanlib.saveState(false); // true to optimize, which is a bit slower
|
|
@@ -532,7 +532,7 @@ exports.NaanControllerWeb = function() {
|
|
|
532
532
|
|| statedoc.firstver > kStateCurrentVersion
|
|
533
533
|
|| statedoc.curversion < kStateFirstVersion
|
|
534
534
|
|| statedoc.licensee != "MIT-License"
|
|
535
|
-
|| statedoc.verstring != "1.4.
|
|
535
|
+
|| statedoc.verstring != "1.4.3+1"
|
|
536
536
|
|| !(naanstate = statedoc.naan))
|
|
537
537
|
{
|
|
538
538
|
localStorage.removeItem("NaanState_Hosted");
|
|
@@ -591,7 +591,7 @@ exports.NaanControllerWeb = function() {
|
|
|
591
591
|
op: "VsiteOpen",
|
|
592
592
|
name: vsiteName,
|
|
593
593
|
naancont: contSelf,
|
|
594
|
-
title: vsiteName + " 1.4.
|
|
594
|
+
title: vsiteName + " 1.4.3+1"
|
|
595
595
|
});
|
|
596
596
|
}
|
|
597
597
|
} catch (e) {
|
|
@@ -605,7 +605,7 @@ exports.NaanControllerWeb = function() {
|
|
|
605
605
|
op: "VsiteClose",
|
|
606
606
|
name: vsiteName,
|
|
607
607
|
naancont: contSelf,
|
|
608
|
-
title: vsiteName + " 1.4.
|
|
608
|
+
title: vsiteName + " 1.4.3+1"
|
|
609
609
|
});
|
|
610
610
|
termTextOut("\x1b[90m\x1b[3m".concat("\nwindow closed", "\x1b[0m\n"));
|
|
611
611
|
}
|
|
@@ -621,7 +621,7 @@ exports.NaanControllerWeb = function() {
|
|
|
621
621
|
op: "VsiteVisibilityChange",
|
|
622
622
|
name: vsiteName,
|
|
623
623
|
naancont: contSelf,
|
|
624
|
-
title: vsiteName + " 1.4.
|
|
624
|
+
title: vsiteName + " 1.4.3+1",
|
|
625
625
|
hidden: window.document.visibilityState == "hidden",
|
|
626
626
|
window: window
|
|
627
627
|
});
|
|
@@ -636,8 +636,8 @@ exports.NaanControllerWeb = function() {
|
|
|
636
636
|
naanlib.banner();
|
|
637
637
|
var hostpath = window.location.origin.concat(naanlib.js.r("path").dirname(window.location.pathname));
|
|
638
638
|
naanlib.start({
|
|
639
|
-
cmd: 'App.version = "1.4.
|
|
640
|
-
+ 'App.cache = "
|
|
639
|
+
cmd: 'App.version = "1.4.3+1";;\r\n'
|
|
640
|
+
+ 'App.cache = "cd897fb5b9f8c4fe564a32db8f9048ad";;\r\n'
|
|
641
641
|
+ 'Naan.module.requireQuery({ naanver: App.cache });;\r\n'
|
|
642
642
|
+ 'Naan.module.webparse("naan_init.nlg", "' + hostpath + '", { naanver: App.cache });;\r\n'
|
|
643
643
|
});
|