@jsenv/core 28.3.3 → 28.3.6

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/dist/main.js CHANGED
@@ -16810,9 +16810,18 @@ const jsenvPluginHmr = () => {
16810
16810
  return urlObject.href;
16811
16811
  },
16812
16812
  transformUrlSearchParams: (reference, context) => {
16813
- const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl);
16813
+ if (reference.type === "package_json") {
16814
+ // maybe the if above shoulb be .isImplicit but it's just a detail anyway
16815
+ return null;
16816
+ }
16817
+
16818
+ if (context.reference && !context.reference.data.hmr) {
16819
+ // parent do not use hmr search param
16820
+ return null;
16821
+ }
16814
16822
 
16815
- if (!parentUrlInfo || !parentUrlInfo.data.hmr) {
16823
+ if (!context.reference && !reference.data.hmr) {
16824
+ // entry point do not use hmr search param
16816
16825
  return null;
16817
16826
  }
16818
16827
 
@@ -16998,28 +17007,38 @@ const jsenvPluginAutoreloadServer = ({
16998
17007
  url,
16999
17008
  event
17000
17009
  }) => {
17001
- const urlInfo = urlGraph.getUrlInfo(url); // file not part of dependency graph
17010
+ const onUrlInfo = urlInfo => {
17011
+ const relativeUrl = formatUrlForClient(urlInfo.url);
17012
+ const hotUpdate = propagateUpdate(urlInfo);
17002
17013
 
17003
- if (!urlInfo) {
17004
- return;
17005
- }
17014
+ if (hotUpdate.declined) {
17015
+ notifyDeclined({
17016
+ cause: `${relativeUrl} ${event}`,
17017
+ reason: hotUpdate.reason,
17018
+ declinedBy: hotUpdate.declinedBy
17019
+ });
17020
+ } else {
17021
+ notifyAccepted({
17022
+ cause: `${relativeUrl} ${event}`,
17023
+ reason: hotUpdate.reason,
17024
+ instructions: hotUpdate.instructions
17025
+ });
17026
+ }
17027
+ };
17006
17028
 
17007
- const relativeUrl = formatUrlForClient(url);
17008
- const hotUpdate = propagateUpdate(urlInfo);
17029
+ const exactUrlInfo = urlGraph.getUrlInfo(url);
17009
17030
 
17010
- if (hotUpdate.declined) {
17011
- notifyDeclined({
17012
- cause: `${relativeUrl} ${event}`,
17013
- reason: hotUpdate.reason,
17014
- declinedBy: hotUpdate.declinedBy
17015
- });
17016
- } else {
17017
- notifyAccepted({
17018
- cause: `${relativeUrl} ${event}`,
17019
- reason: hotUpdate.reason,
17020
- instructions: hotUpdate.instructions
17021
- });
17031
+ if (exactUrlInfo) {
17032
+ onUrlInfo(exactUrlInfo);
17022
17033
  }
17034
+
17035
+ urlGraph.urlInfoMap.forEach(urlInfo => {
17036
+ if (urlInfo === exactUrlInfo) return;
17037
+ const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
17038
+ if (urlWithoutSearch !== url) return;
17039
+ if (exactUrlInfo && exactUrlInfo.dependents.has(urlInfo.url)) return;
17040
+ onUrlInfo(urlInfo);
17041
+ });
17023
17042
  });
17024
17043
  clientFilesPruneCallbackList.push((prunedUrlInfos, firstUrlInfo) => {
17025
17044
  const mainHotUpdate = propagateUpdate(firstUrlInfo);
@@ -25301,16 +25320,22 @@ const createFileService = ({
25301
25320
  clientFileChangeCallbackList.push(({
25302
25321
  url
25303
25322
  }) => {
25304
- urlGraph.urlInfoMap.forEach(urlInfo => {
25305
- if (urlInfo.url === url) {
25306
- urlGraph.considerModified(urlInfo);
25307
- } else {
25308
- const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
25323
+ const onUrlInfo = urlInfo => {
25324
+ urlGraph.considerModified(urlInfo);
25325
+ };
25309
25326
 
25310
- if (urlWithoutSearch === url) {
25311
- urlGraph.considerModified(urlInfo);
25312
- }
25313
- }
25327
+ const exactUrlInfo = urlGraph.getUrlInfo(url);
25328
+
25329
+ if (exactUrlInfo) {
25330
+ onUrlInfo(exactUrlInfo);
25331
+ }
25332
+
25333
+ urlGraph.urlInfoMap.forEach(urlInfo => {
25334
+ if (urlInfo === exactUrlInfo) return;
25335
+ const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
25336
+ if (urlWithoutSearch !== url) return;
25337
+ if (exactUrlInfo && exactUrlInfo.dependents.has(urlInfo.url)) return;
25338
+ onUrlInfo(urlInfo);
25314
25339
  });
25315
25340
  });
25316
25341
  const kitchen = createKitchen({
@@ -28439,7 +28464,7 @@ const registerEvent = ({
28439
28464
 
28440
28465
  const chromium = createRuntimeFromPlaywright({
28441
28466
  browserName: "chromium",
28442
- browserVersion: "104.0.5112.48",
28467
+ browserVersion: "105.0.5195.19",
28443
28468
  // to update, check https://github.com/microsoft/playwright/releases
28444
28469
  coveragePlaywrightAPIAvailable: true
28445
28470
  });
@@ -28447,7 +28472,7 @@ const chromiumIsolatedTab = chromium.isolatedTab;
28447
28472
 
28448
28473
  const firefox = createRuntimeFromPlaywright({
28449
28474
  browserName: "firefox",
28450
- browserVersion: "102.0" // to update, check https://github.com/microsoft/playwright/releases
28475
+ browserVersion: "103.0" // to update, check https://github.com/microsoft/playwright/releases
28451
28476
 
28452
28477
  });
28453
28478
  const firefoxIsolatedTab = firefox.isolatedTab;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "28.3.3",
3
+ "version": "28.3.6",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -61,20 +61,20 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@babel/plugin-proposal-dynamic-import": "7.18.6",
64
- "@babel/plugin-transform-modules-systemjs": "7.18.6",
64
+ "@babel/plugin-transform-modules-systemjs": "7.19.0",
65
65
  "@babel/plugin-transform-modules-umd": "7.18.6",
66
66
  "@c88/v8-coverage": "0.1.1",
67
- "@financial-times/polyfill-useragent-normaliser": "2.0.1",
67
+ "@financial-times/polyfill-useragent-normaliser": "1.10.2",
68
68
  "@jsenv/abort": "4.2.4",
69
- "@jsenv/ast": "1.2.1",
70
- "@jsenv/babel-plugins": "1.0.6",
69
+ "@jsenv/ast": "1.2.2",
70
+ "@jsenv/babel-plugins": "1.0.7",
71
71
  "@jsenv/filesystem": "4.1.3",
72
72
  "@jsenv/importmap": "1.2.1",
73
73
  "@jsenv/integrity": "0.0.1",
74
74
  "@jsenv/log": "3.3.0",
75
75
  "@jsenv/node-esm-resolution": "0.1.0",
76
76
  "@jsenv/server": "14.1.3",
77
- "@jsenv/sourcemap": "1.0.4",
77
+ "@jsenv/sourcemap": "1.0.5",
78
78
  "@jsenv/uneval": "1.6.0",
79
79
  "@jsenv/url-meta": "7.0.0",
80
80
  "@jsenv/urls": "1.2.7",
@@ -87,12 +87,12 @@
87
87
  "istanbul-lib-instrument": "5.2.0",
88
88
  "istanbul-lib-report": "3.0.0",
89
89
  "istanbul-reports": "3.1.5",
90
- "launch-editor": "2.5.0",
90
+ "launch-editor": "2.6.0",
91
91
  "pidtree": "0.6.0",
92
- "rollup": "2.77.2",
92
+ "rollup": "2.79.0",
93
93
  "string-width": "5.1.2",
94
94
  "strip-ansi": "7.0.1",
95
- "terser": "5.14.2",
95
+ "terser": "5.15.0",
96
96
  "v8-to-istanbul": "9.0.1",
97
97
  "wrap-ansi": "8.0.1"
98
98
  },
@@ -105,11 +105,11 @@
105
105
  "@jsenv/https-local": "3.0.1",
106
106
  "@jsenv/package-workspace": "0.5.0",
107
107
  "@jsenv/performance-impact": "3.0.1",
108
- "eslint": "8.21.0",
108
+ "eslint": "8.23.0",
109
109
  "eslint-plugin-html": "7.1.0",
110
110
  "eslint-plugin-import": "2.26.0",
111
- "eslint-plugin-react": "7.30.1",
112
- "playwright": "1.24.2",
111
+ "eslint-plugin-react": "7.31.7",
112
+ "playwright": "1.25.1",
113
113
  "prettier": "2.7.1"
114
114
  }
115
115
  }
@@ -2,7 +2,7 @@ import { createRuntimeFromPlaywright } from "./from_playwright.js"
2
2
 
3
3
  export const chromium = createRuntimeFromPlaywright({
4
4
  browserName: "chromium",
5
- browserVersion: "104.0.5112.48", // to update, check https://github.com/microsoft/playwright/releases
5
+ browserVersion: "105.0.5195.19", // to update, check https://github.com/microsoft/playwright/releases
6
6
  coveragePlaywrightAPIAvailable: true,
7
7
  })
8
8
  export const chromiumIsolatedTab = chromium.isolatedTab
@@ -2,6 +2,6 @@ import { createRuntimeFromPlaywright } from "./from_playwright.js"
2
2
 
3
3
  export const firefox = createRuntimeFromPlaywright({
4
4
  browserName: "firefox",
5
- browserVersion: "102.0", // to update, check https://github.com/microsoft/playwright/releases
5
+ browserVersion: "103.0", // to update, check https://github.com/microsoft/playwright/releases
6
6
  })
7
7
  export const firefoxIsolatedTab = firefox.isolatedTab
@@ -95,15 +95,19 @@ export const createFileService = ({
95
95
  )
96
96
  const urlGraph = createUrlGraph()
97
97
  clientFileChangeCallbackList.push(({ url }) => {
98
+ const onUrlInfo = (urlInfo) => {
99
+ urlGraph.considerModified(urlInfo)
100
+ }
101
+ const exactUrlInfo = urlGraph.getUrlInfo(url)
102
+ if (exactUrlInfo) {
103
+ onUrlInfo(exactUrlInfo)
104
+ }
98
105
  urlGraph.urlInfoMap.forEach((urlInfo) => {
99
- if (urlInfo.url === url) {
100
- urlGraph.considerModified(urlInfo)
101
- } else {
102
- const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url)
103
- if (urlWithoutSearch === url) {
104
- urlGraph.considerModified(urlInfo)
105
- }
106
- }
106
+ if (urlInfo === exactUrlInfo) return
107
+ const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url)
108
+ if (urlWithoutSearch !== url) return
109
+ if (exactUrlInfo && exactUrlInfo.dependents.has(urlInfo.url)) return
110
+ onUrlInfo(urlInfo)
107
111
  })
108
112
  })
109
113
  const kitchen = createKitchen({
@@ -1,4 +1,8 @@
1
- import { urlIsInsideOf, urlToRelativeUrl } from "@jsenv/urls"
1
+ import {
2
+ urlIsInsideOf,
3
+ urlToRelativeUrl,
4
+ asUrlWithoutSearch,
5
+ } from "@jsenv/urls"
2
6
 
3
7
  export const jsenvPluginAutoreloadServer = ({
4
8
  clientFileChangeCallbackList,
@@ -113,26 +117,34 @@ export const jsenvPluginAutoreloadServer = ({
113
117
  return iterate(firstUrlInfo, seen)
114
118
  }
115
119
  clientFileChangeCallbackList.push(({ url, event }) => {
116
- const urlInfo = urlGraph.getUrlInfo(url)
117
- // file not part of dependency graph
118
- if (!urlInfo) {
119
- return
120
+ const onUrlInfo = (urlInfo) => {
121
+ const relativeUrl = formatUrlForClient(urlInfo.url)
122
+ const hotUpdate = propagateUpdate(urlInfo)
123
+ if (hotUpdate.declined) {
124
+ notifyDeclined({
125
+ cause: `${relativeUrl} ${event}`,
126
+ reason: hotUpdate.reason,
127
+ declinedBy: hotUpdate.declinedBy,
128
+ })
129
+ } else {
130
+ notifyAccepted({
131
+ cause: `${relativeUrl} ${event}`,
132
+ reason: hotUpdate.reason,
133
+ instructions: hotUpdate.instructions,
134
+ })
135
+ }
120
136
  }
121
- const relativeUrl = formatUrlForClient(url)
122
- const hotUpdate = propagateUpdate(urlInfo)
123
- if (hotUpdate.declined) {
124
- notifyDeclined({
125
- cause: `${relativeUrl} ${event}`,
126
- reason: hotUpdate.reason,
127
- declinedBy: hotUpdate.declinedBy,
128
- })
129
- } else {
130
- notifyAccepted({
131
- cause: `${relativeUrl} ${event}`,
132
- reason: hotUpdate.reason,
133
- instructions: hotUpdate.instructions,
134
- })
137
+ const exactUrlInfo = urlGraph.getUrlInfo(url)
138
+ if (exactUrlInfo) {
139
+ onUrlInfo(exactUrlInfo)
135
140
  }
141
+ urlGraph.urlInfoMap.forEach((urlInfo) => {
142
+ if (urlInfo === exactUrlInfo) return
143
+ const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url)
144
+ if (urlWithoutSearch !== url) return
145
+ if (exactUrlInfo && exactUrlInfo.dependents.has(urlInfo.url)) return
146
+ onUrlInfo(urlInfo)
147
+ })
136
148
  })
137
149
  clientFilesPruneCallbackList.push((prunedUrlInfos, firstUrlInfo) => {
138
150
  const mainHotUpdate = propagateUpdate(firstUrlInfo)
@@ -7,7 +7,6 @@ export const jsenvPluginHmr = () => {
7
7
  reference.data.hmr = false
8
8
  return null
9
9
  }
10
-
11
10
  reference.data.hmr = true
12
11
  const urlObject = new URL(reference.url)
13
12
  // "hmr" search param goal is to mark url as enabling hmr:
@@ -19,8 +18,16 @@ export const jsenvPluginHmr = () => {
19
18
  return urlObject.href
20
19
  },
21
20
  transformUrlSearchParams: (reference, context) => {
22
- const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl)
23
- if (!parentUrlInfo || !parentUrlInfo.data.hmr) {
21
+ if (reference.type === "package_json") {
22
+ // maybe the if above shoulb be .isImplicit but it's just a detail anyway
23
+ return null
24
+ }
25
+ if (context.reference && !context.reference.data.hmr) {
26
+ // parent do not use hmr search param
27
+ return null
28
+ }
29
+ if (!context.reference && !reference.data.hmr) {
30
+ // entry point do not use hmr search param
24
31
  return null
25
32
  }
26
33
  const urlInfo = context.urlGraph.getUrlInfo(reference.url)