@jsenv/core 28.3.4 → 28.4.0

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
@@ -4452,6 +4452,7 @@ const parseAndTransformJsUrls = async (urlInfo, context) => {
4452
4452
  data: jsMention.data,
4453
4453
  baseUrl: {
4454
4454
  "StringLiteral": jsMention.baseUrl,
4455
+ "window.location": urlInfo.url,
4455
4456
  "window.origin": context.rootDirectoryUrl,
4456
4457
  "import.meta.url": urlInfo.url,
4457
4458
  "context.meta.url": urlInfo.url,
@@ -16810,9 +16811,18 @@ const jsenvPluginHmr = () => {
16810
16811
  return urlObject.href;
16811
16812
  },
16812
16813
  transformUrlSearchParams: (reference, context) => {
16813
- const parentUrlInfo = context.urlGraph.getUrlInfo(reference.parentUrl);
16814
+ if (reference.type === "package_json") {
16815
+ // maybe the if above shoulb be .isImplicit but it's just a detail anyway
16816
+ return null;
16817
+ }
16818
+
16819
+ if (context.reference && !context.reference.data.hmr) {
16820
+ // parent do not use hmr search param
16821
+ return null;
16822
+ }
16814
16823
 
16815
- if (!parentUrlInfo || !parentUrlInfo.data.hmr) {
16824
+ if (!context.reference && !reference.data.hmr) {
16825
+ // entry point do not use hmr search param
16816
16826
  return null;
16817
16827
  }
16818
16828
 
@@ -16999,7 +17009,7 @@ const jsenvPluginAutoreloadServer = ({
16999
17009
  event
17000
17010
  }) => {
17001
17011
  const onUrlInfo = urlInfo => {
17002
- const relativeUrl = formatUrlForClient(url);
17012
+ const relativeUrl = formatUrlForClient(urlInfo.url);
17003
17013
  const hotUpdate = propagateUpdate(urlInfo);
17004
17014
 
17005
17015
  if (hotUpdate.declined) {
@@ -17017,16 +17027,18 @@ const jsenvPluginAutoreloadServer = ({
17017
17027
  }
17018
17028
  };
17019
17029
 
17020
- urlGraph.urlInfoMap.forEach(urlInfo => {
17021
- if (urlInfo.url === url) {
17022
- onUrlInfo(urlInfo);
17023
- } else {
17024
- const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
17030
+ const exactUrlInfo = urlGraph.getUrlInfo(url);
17025
17031
 
17026
- if (urlWithoutSearch === url) {
17027
- onUrlInfo(urlInfo);
17028
- }
17029
- }
17032
+ if (exactUrlInfo) {
17033
+ onUrlInfo(exactUrlInfo);
17034
+ }
17035
+
17036
+ urlGraph.urlInfoMap.forEach(urlInfo => {
17037
+ if (urlInfo === exactUrlInfo) return;
17038
+ const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
17039
+ if (urlWithoutSearch !== url) return;
17040
+ if (exactUrlInfo && exactUrlInfo.dependents.has(urlInfo.url)) return;
17041
+ onUrlInfo(urlInfo);
17030
17042
  });
17031
17043
  });
17032
17044
  clientFilesPruneCallbackList.push((prunedUrlInfos, firstUrlInfo) => {
@@ -25309,16 +25321,22 @@ const createFileService = ({
25309
25321
  clientFileChangeCallbackList.push(({
25310
25322
  url
25311
25323
  }) => {
25312
- urlGraph.urlInfoMap.forEach(urlInfo => {
25313
- if (urlInfo.url === url) {
25314
- urlGraph.considerModified(urlInfo);
25315
- } else {
25316
- const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
25324
+ const onUrlInfo = urlInfo => {
25325
+ urlGraph.considerModified(urlInfo);
25326
+ };
25317
25327
 
25318
- if (urlWithoutSearch === url) {
25319
- urlGraph.considerModified(urlInfo);
25320
- }
25321
- }
25328
+ const exactUrlInfo = urlGraph.getUrlInfo(url);
25329
+
25330
+ if (exactUrlInfo) {
25331
+ onUrlInfo(exactUrlInfo);
25332
+ }
25333
+
25334
+ urlGraph.urlInfoMap.forEach(urlInfo => {
25335
+ if (urlInfo === exactUrlInfo) return;
25336
+ const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url);
25337
+ if (urlWithoutSearch !== url) return;
25338
+ if (exactUrlInfo && exactUrlInfo.dependents.has(urlInfo.url)) return;
25339
+ onUrlInfo(urlInfo);
25322
25340
  });
25323
25341
  });
25324
25342
  const kitchen = createKitchen({
@@ -28447,7 +28465,7 @@ const registerEvent = ({
28447
28465
 
28448
28466
  const chromium = createRuntimeFromPlaywright({
28449
28467
  browserName: "chromium",
28450
- browserVersion: "104.0.5112.48",
28468
+ browserVersion: "105.0.5195.19",
28451
28469
  // to update, check https://github.com/microsoft/playwright/releases
28452
28470
  coveragePlaywrightAPIAvailable: true
28453
28471
  });
@@ -28455,7 +28473,7 @@ const chromiumIsolatedTab = chromium.isolatedTab;
28455
28473
 
28456
28474
  const firefox = createRuntimeFromPlaywright({
28457
28475
  browserName: "firefox",
28458
- browserVersion: "102.0" // to update, check https://github.com/microsoft/playwright/releases
28476
+ browserVersion: "103.0" // to update, check https://github.com/microsoft/playwright/releases
28459
28477
 
28460
28478
  });
28461
28479
  const firefoxIsolatedTab = firefox.isolatedTab;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "28.3.4",
3
+ "version": "28.4.0",
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({
@@ -118,7 +118,7 @@ export const jsenvPluginAutoreloadServer = ({
118
118
  }
119
119
  clientFileChangeCallbackList.push(({ url, event }) => {
120
120
  const onUrlInfo = (urlInfo) => {
121
- const relativeUrl = formatUrlForClient(url)
121
+ const relativeUrl = formatUrlForClient(urlInfo.url)
122
122
  const hotUpdate = propagateUpdate(urlInfo)
123
123
  if (hotUpdate.declined) {
124
124
  notifyDeclined({
@@ -134,15 +134,16 @@ export const jsenvPluginAutoreloadServer = ({
134
134
  })
135
135
  }
136
136
  }
137
+ const exactUrlInfo = urlGraph.getUrlInfo(url)
138
+ if (exactUrlInfo) {
139
+ onUrlInfo(exactUrlInfo)
140
+ }
137
141
  urlGraph.urlInfoMap.forEach((urlInfo) => {
138
- if (urlInfo.url === url) {
139
- onUrlInfo(urlInfo)
140
- } else {
141
- const urlWithoutSearch = asUrlWithoutSearch(urlInfo.url)
142
- if (urlWithoutSearch === url) {
143
- onUrlInfo(urlInfo)
144
- }
145
- }
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)
146
147
  })
147
148
  })
148
149
  clientFilesPruneCallbackList.push((prunedUrlInfos, 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)
@@ -32,6 +32,7 @@ export const parseAndTransformJsUrls = async (urlInfo, context) => {
32
32
  data: jsMention.data,
33
33
  baseUrl: {
34
34
  "StringLiteral": jsMention.baseUrl,
35
+ "window.location": urlInfo.url,
35
36
  "window.origin": context.rootDirectoryUrl,
36
37
  "import.meta.url": urlInfo.url,
37
38
  "context.meta.url": urlInfo.url,