@jsenv/core 41.4.7 → 41.4.9
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.
|
@@ -7205,15 +7205,15 @@ const inferRuntimeCompatFromClosestPackage = async (
|
|
|
7205
7205
|
}
|
|
7206
7206
|
|
|
7207
7207
|
if (runtimeType === "browser") {
|
|
7208
|
-
const
|
|
7209
|
-
if (!
|
|
7208
|
+
const browserslistQuery = packageJSON.browserslist;
|
|
7209
|
+
if (!browserslistQuery) {
|
|
7210
7210
|
return null;
|
|
7211
7211
|
}
|
|
7212
7212
|
const namespace = await import("./browserslist_index/browserslist_index.js");
|
|
7213
7213
|
const browserslist = namespace.default;
|
|
7214
|
-
const
|
|
7214
|
+
const browserslistResult = browserslist(browserslistQuery);
|
|
7215
7215
|
const runtimeCompat = {};
|
|
7216
|
-
for (const browserNameAndVersion of
|
|
7216
|
+
for (const browserNameAndVersion of browserslistResult) {
|
|
7217
7217
|
let [name, version] = browserNameAndVersion.split(" ");
|
|
7218
7218
|
if (name === "ios_saf") {
|
|
7219
7219
|
name = "ios_safari";
|
|
@@ -768,7 +768,9 @@ const parseUserAgentHeader = (userAgent) => {
|
|
|
768
768
|
* - "clients_list" the whole registry (the dashboard renders it)
|
|
769
769
|
* - "client_log" a single log line (a monitor appends it)
|
|
770
770
|
* - "client_activity" a single qualified activity (a monitor appends it)
|
|
771
|
-
* - "client_here" a client just appeared/resumed (every page
|
|
771
|
+
* - "client_here" a networked client just appeared/resumed (every page
|
|
772
|
+
* can toast it); never sent for the main client, which
|
|
773
|
+
* is the person reading the toast
|
|
772
774
|
* - "client_command" pilot one client (navigate/reload its tab) from the
|
|
773
775
|
* dashboard; the matching reporter runs it
|
|
774
776
|
* Server events are broadcast, so consumers filter what they care about.
|
|
@@ -783,7 +785,7 @@ const parseUserAgentHeader = (userAgent) => {
|
|
|
783
785
|
*
|
|
784
786
|
* The monitoring script is injected into EVERY cooked page, including our own
|
|
785
787
|
* dashboard and monitor pages — so opening one of those counts as a connected
|
|
786
|
-
* client, and any open page gets toasted when another client appears.
|
|
788
|
+
* client, and any open page gets toasted when another networked client appears.
|
|
787
789
|
*
|
|
788
790
|
* Pages:
|
|
789
791
|
* - /.internal/clients → dashboard listing every client seen
|
|
@@ -1114,12 +1116,25 @@ const jsenvPluginClientMonitoring = () => {
|
|
|
1114
1116
|
pruneTabs(client);
|
|
1115
1117
|
pruneClients();
|
|
1116
1118
|
|
|
1117
|
-
if (firstEver) {
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
//
|
|
1122
|
-
|
|
1119
|
+
if (firstEver || !wasOnline) {
|
|
1120
|
+
// The toast invites the reader to monitor the client that just appeared,
|
|
1121
|
+
// so it is only worth showing for a client there is something to watch:
|
|
1122
|
+
// one reaching the server over the network. The machine running the dev
|
|
1123
|
+
// server is the person reading the toast — it browses over localhost, its
|
|
1124
|
+
// devtools are one keystroke away and nothing is captured for it, so
|
|
1125
|
+
// announcing it means interrupting someone about themselves. It happens
|
|
1126
|
+
// more than one would think: the client id lives in localStorage, so the
|
|
1127
|
+
// same browser gets a fresh id per origin (localhost vs 127.0.0.1 vs the
|
|
1128
|
+
// LAN ip, another port) and in private windows, and each of those looks
|
|
1129
|
+
// like a brand new client to the server.
|
|
1130
|
+
if (!isLocalIp(client.ip)) {
|
|
1131
|
+
sendClientHere({
|
|
1132
|
+
// A report after a long quiet spell means the client was picked back
|
|
1133
|
+
// up rather than newly seen.
|
|
1134
|
+
reason: firstEver ? "new" : "resumed",
|
|
1135
|
+
client: serializeClient(client),
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1123
1138
|
sendClientsList();
|
|
1124
1139
|
}
|
|
1125
1140
|
|
package/package.json
CHANGED
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
* - "clients_list" the whole registry (the dashboard renders it)
|
|
23
23
|
* - "client_log" a single log line (a monitor appends it)
|
|
24
24
|
* - "client_activity" a single qualified activity (a monitor appends it)
|
|
25
|
-
* - "client_here" a client just appeared/resumed (every page
|
|
25
|
+
* - "client_here" a networked client just appeared/resumed (every page
|
|
26
|
+
* can toast it); never sent for the main client, which
|
|
27
|
+
* is the person reading the toast
|
|
26
28
|
* - "client_command" pilot one client (navigate/reload its tab) from the
|
|
27
29
|
* dashboard; the matching reporter runs it
|
|
28
30
|
* Server events are broadcast, so consumers filter what they care about.
|
|
@@ -37,7 +39,7 @@
|
|
|
37
39
|
*
|
|
38
40
|
* The monitoring script is injected into EVERY cooked page, including our own
|
|
39
41
|
* dashboard and monitor pages — so opening one of those counts as a connected
|
|
40
|
-
* client, and any open page gets toasted when another client appears.
|
|
42
|
+
* client, and any open page gets toasted when another networked client appears.
|
|
41
43
|
*
|
|
42
44
|
* Pages:
|
|
43
45
|
* - /.internal/clients → dashboard listing every client seen
|
|
@@ -370,12 +372,25 @@ export const jsenvPluginClientMonitoring = () => {
|
|
|
370
372
|
pruneTabs(client);
|
|
371
373
|
pruneClients();
|
|
372
374
|
|
|
373
|
-
if (firstEver) {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
//
|
|
378
|
-
|
|
375
|
+
if (firstEver || !wasOnline) {
|
|
376
|
+
// The toast invites the reader to monitor the client that just appeared,
|
|
377
|
+
// so it is only worth showing for a client there is something to watch:
|
|
378
|
+
// one reaching the server over the network. The machine running the dev
|
|
379
|
+
// server is the person reading the toast — it browses over localhost, its
|
|
380
|
+
// devtools are one keystroke away and nothing is captured for it, so
|
|
381
|
+
// announcing it means interrupting someone about themselves. It happens
|
|
382
|
+
// more than one would think: the client id lives in localStorage, so the
|
|
383
|
+
// same browser gets a fresh id per origin (localhost vs 127.0.0.1 vs the
|
|
384
|
+
// LAN ip, another port) and in private windows, and each of those looks
|
|
385
|
+
// like a brand new client to the server.
|
|
386
|
+
if (!isLocalIp(client.ip)) {
|
|
387
|
+
sendClientHere({
|
|
388
|
+
// A report after a long quiet spell means the client was picked back
|
|
389
|
+
// up rather than newly seen.
|
|
390
|
+
reason: firstEver ? "new" : "resumed",
|
|
391
|
+
client: serializeClient(client),
|
|
392
|
+
});
|
|
393
|
+
}
|
|
379
394
|
sendClientsList();
|
|
380
395
|
}
|
|
381
396
|
|