@jsenv/core 41.4.27 → 41.4.29

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.
@@ -10517,19 +10517,6 @@ const determineCategory = (buildRelativeUrl) => {
10517
10517
  return "other";
10518
10518
  };
10519
10519
 
10520
- // default runtimeCompat corresponds to
10521
- // "we can keep <script type="module"> intact":
10522
- // so script_type_module + dynamic_import + import_meta
10523
- const defaultRuntimeCompat = {
10524
- // android: "8",
10525
- chrome: "64",
10526
- edge: "79",
10527
- firefox: "67",
10528
- ios: "12",
10529
- opera: "51",
10530
- safari: "11.3",
10531
- samsung: "9.2",
10532
- };
10533
10520
  const logsDefault = {
10534
10521
  level: "info",
10535
10522
  animated: true,
@@ -12167,6 +12154,25 @@ const splitFileExtension = (filename) => {
12167
12154
  return [filename.slice(0, dotLastIndex), filename.slice(dotLastIndex)];
12168
12155
  };
12169
12156
 
12157
+ const resolveImportIdPath = (ownerUrlInfo, dynamicImportId) => {
12158
+ const ancestorImportIds = [];
12159
+ let ancestorUrlInfo = ownerUrlInfo;
12160
+ let currentImportId = dynamicImportId;
12161
+ while (ancestorUrlInfo) {
12162
+ const ancestorDynamicImportId =
12163
+ ancestorUrlInfo.searchParams.get("dynamic_import_id");
12164
+ if (!ancestorDynamicImportId) {
12165
+ break;
12166
+ }
12167
+ if (ancestorDynamicImportId !== currentImportId) {
12168
+ ancestorImportIds.push(ancestorDynamicImportId);
12169
+ currentImportId = ancestorDynamicImportId;
12170
+ }
12171
+ ancestorUrlInfo = ancestorUrlInfo.firstReference?.ownerUrlInfo;
12172
+ }
12173
+ return [...ancestorImportIds, dynamicImportId].join("/");
12174
+ };
12175
+
12170
12176
  const determineDirectoryPath = ({
12171
12177
  sourceDirectoryUrl,
12172
12178
  assetsDirectory,
@@ -12189,23 +12195,24 @@ const determineDirectoryPath = ({
12189
12195
  }
12190
12196
  const dynamicImportId = urlInfo.searchParams.get("dynamic_import_id");
12191
12197
  if (dynamicImportId) {
12192
- const ancestorImportIds = [];
12193
- let ancestorUrlInfo = ownerUrlInfo;
12194
- let currentImportId = dynamicImportId;
12195
- while (ancestorUrlInfo) {
12196
- const ancestorDynamicImportId =
12197
- ancestorUrlInfo.searchParams.get("dynamic_import_id");
12198
- if (!ancestorDynamicImportId) {
12199
- break;
12200
- }
12201
- if (ancestorDynamicImportId !== currentImportId) {
12202
- ancestorImportIds.push(ancestorDynamicImportId);
12203
- currentImportId = ancestorDynamicImportId;
12204
- }
12205
- ancestorUrlInfo = ancestorUrlInfo.firstReference?.ownerUrlInfo;
12198
+ // Inside the isolated group that asked for it — but only while ONE did.
12199
+ // A chunk several groups reach belongs to none of them: put inside the
12200
+ // first asker it would move the day another one asks first, and the others
12201
+ // would import it out of a sibling's directory.
12202
+ const importIdPathSet = new Set();
12203
+ for (const referenceFromOther of urlInfo.referenceFromOthersSet) {
12204
+ importIdPathSet.add(
12205
+ resolveImportIdPath(referenceFromOther.ownerUrlInfo, dynamicImportId),
12206
+ );
12207
+ }
12208
+ if (importIdPathSet.size === 0) {
12209
+ importIdPathSet.add(resolveImportIdPath(ownerUrlInfo, dynamicImportId));
12210
+ }
12211
+ if (importIdPathSet.size === 1) {
12212
+ const [importIdPath] = importIdPathSet;
12213
+ return `${assetsDirectory}${importIdPath}/`;
12206
12214
  }
12207
- const importIdPath = [...ancestorImportIds, dynamicImportId].join("/");
12208
- return `${assetsDirectory}${importIdPath}/`;
12215
+ return `${assetsDirectory}${dynamicImportId}/`;
12209
12216
  }
12210
12217
  if (urlInfo.isEntryPoint && !urlInfo.isDynamicEntryPoint) {
12211
12218
  return "";
@@ -12956,12 +12963,10 @@ entryPoints: {
12956
12963
  for (const entryPoint of entryPointArray) {
12957
12964
  let { runtimeCompat } = entryPoint.params;
12958
12965
  if (runtimeCompat === undefined) {
12959
- const runtimeCompatFromPackage = inferRuntimeCompatFromClosestPackage(
12960
- entryPoint.sourceUrl,
12961
- {
12966
+ const runtimeCompatFromPackage =
12967
+ await inferRuntimeCompatFromClosestPackage(entryPoint.sourceUrl, {
12962
12968
  runtimeType: entryPoint.runtimeType,
12963
- },
12964
- );
12969
+ });
12965
12970
  if (runtimeCompatFromPackage) {
12966
12971
  entryPoint.params.runtimeCompat = runtimeCompat =
12967
12972
  runtimeCompatFromPackage;
@@ -13258,7 +13263,7 @@ entryPoints: {
13258
13263
  const entryPointDefaultParams = {
13259
13264
  buildRelativeUrl: undefined,
13260
13265
  mode: undefined,
13261
- runtimeCompat: defaultRuntimeCompat,
13266
+ runtimeCompat: undefined,
13262
13267
  plugins: [],
13263
13268
  mappings: undefined,
13264
13269
  assetsDirectory: undefined,
@@ -6611,18 +6611,24 @@ const startMonitoringMemoryUsage = () => {
6611
6611
  return result;
6612
6612
  };
6613
6613
 
6614
- // default runtimeCompat corresponds to
6615
- // "we can keep <script type="module"> intact":
6616
- // so script_type_module + dynamic_import + import_meta
6614
+ // The floor a browser project targets when it says nothing: high enough that
6615
+ // the css jsenv and its components write is shipped as written — nesting,
6616
+ // light-dark(), and the module features that keep <script type="module">,
6617
+ // importmap and top-level await intact. light-dark() is the last gate to
6618
+ // close, and Safari 17.5 is where it does, so it sets the line; the other
6619
+ // runtimes are their releases of that same moment.
6620
+ //
6621
+ // Raising it further is a matter of moving that line, not of adding runtimes:
6622
+ // a project needing a lower one declares "browserslist" in its package.json or
6623
+ // passes runtimeCompat, and both dev and build read it.
6617
6624
  const browserDefaultRuntimeCompat = {
6618
- // android: "8",
6619
- chrome: "64",
6620
- edge: "79",
6621
- firefox: "67",
6622
- ios_safari: "12",
6623
- opera: "51",
6624
- safari: "11.3",
6625
- samsung: "9.2",
6625
+ chrome: "125",
6626
+ edge: "125",
6627
+ firefox: "126",
6628
+ ios_safari: "17.5",
6629
+ opera: "110",
6630
+ safari: "17.5",
6631
+ samsung: "25",
6626
6632
  };
6627
6633
 
6628
6634
  const nodeDefaultRuntimeCompat = {
@@ -6780,6 +6786,7 @@ const featuresCompatMap = {
6780
6786
  samsung: "15",
6781
6787
  firefox: "108",
6782
6788
  safari: "16.4",
6789
+ ios_safari: "16.4",
6783
6790
  },
6784
6791
  import_type_json: {
6785
6792
  chrome: "123",
@@ -6806,6 +6813,7 @@ const featuresCompatMap = {
6806
6813
  safari: "4",
6807
6814
  ios_safari: "5",
6808
6815
  android: "4.4",
6816
+ samsung: "4",
6809
6817
  },
6810
6818
  // https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker#browser_compatibility
6811
6819
  worker_type_module: {
@@ -6823,6 +6831,7 @@ const featuresCompatMap = {
6823
6831
  opera: "27",
6824
6832
  ios_safari: "11.3",
6825
6833
  android: "12.12",
6834
+ samsung: "4",
6826
6835
  },
6827
6836
  service_worker_type_module: {
6828
6837
  chrome: "80",
@@ -6875,6 +6884,7 @@ const featuresCompatMap = {
6875
6884
  ios_safari: "9",
6876
6885
  android: "4",
6877
6886
  node: "4",
6887
+ samsung: "4",
6878
6888
  },
6879
6889
  arrow_function: {
6880
6890
  chrome: "47",
@@ -7010,7 +7020,7 @@ const inferRuntimeCompatFromClosestPackage = async (
7010
7020
  if (!browserslistQuery) {
7011
7021
  return null;
7012
7022
  }
7013
- const namespace = await import("./browserslist_index/browserslist_index.js");
7023
+ const namespace = await import("../browserslist_index/browserslist_index.js");
7014
7024
  const browserslist = namespace.default;
7015
7025
  const browserslistResult = browserslist(browserslistQuery);
7016
7026
  const runtimeCompat = {};