@parcel/packager-react-static 2.13.4-canary.3393 → 2.13.4-canary.3398

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.
@@ -249,7 +249,6 @@ async function loadBundleUncached(bundle, bundleGraph, getInlineBundleContents)
249
249
  return [[entryBundle.id, [(0, _nullthrows().default)(entryBundle.getMainEntry()), contents]]];
250
250
  });
251
251
  } else if (entryBundle) {
252
- // console.log('here', entryBundle)
253
252
  queue.add(async () => {
254
253
  let {
255
254
  assets: subAssets
@@ -342,7 +341,7 @@ async function loadBundleUncached(bundle, bundleGraph, getInlineBundleContents)
342
341
  publicUrl: bundle.target.publicUrl
343
342
  };
344
343
  parcelRequire.load = async filePath => {
345
- let bundle = bundleGraph.getBundles().find(b => b.name === filePath);
344
+ let bundle = bundleGraph.getBundles().find(b => b.publicId === filePath || b.name === filePath);
346
345
  if (bundle) {
347
346
  let {
348
347
  assets: subAssets
@@ -358,6 +357,17 @@ async function loadBundleUncached(bundle, bundleGraph, getInlineBundleContents)
358
357
  throw new Error('Bundle not found');
359
358
  }
360
359
  };
360
+ parcelRequire.resolve = url => {
361
+ let bundle = bundleGraph.getBundles().find(b => b.publicId === url || b.name === url);
362
+ if (bundle) {
363
+ return (0, _utils().urlJoin)(bundle.target.publicUrl, bundle.name);
364
+ } else {
365
+ throw new Error('Bundle not found');
366
+ }
367
+ };
368
+
369
+ // No-op. We can access the bundle graph directly.
370
+ parcelRequire.extendImportMap = () => {};
361
371
 
362
372
  // Resolve and load a module by specifier.
363
373
  let loadModule = (id, from, env = 'react-client') => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/packager-react-static",
3
- "version": "2.13.4-canary.3393+e3a2b726d",
3
+ "version": "2.13.4-canary.3398+735a635f7",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,16 +17,16 @@
17
17
  "source": "src/ReactStaticPackager.js",
18
18
  "engines": {
19
19
  "node": ">= 16.0.0",
20
- "parcel": "^2.0.0-canary.1768+e3a2b726d"
20
+ "parcel": "^2.0.0-canary.1773+735a635f7"
21
21
  },
22
22
  "dependencies": {
23
- "@parcel/node-resolver-core": "3.4.4-canary.3393+e3a2b726d",
24
- "@parcel/plugin": "2.0.0-canary.1770+e3a2b726d",
25
- "@parcel/rust": "2.13.4-canary.3393+e3a2b726d",
26
- "@parcel/types": "2.0.0-canary.1770+e3a2b726d",
27
- "@parcel/utils": "2.0.0-canary.1770+e3a2b726d",
23
+ "@parcel/node-resolver-core": "3.4.4-canary.3398+735a635f7",
24
+ "@parcel/plugin": "2.0.0-canary.1775+735a635f7",
25
+ "@parcel/rust": "2.13.4-canary.3398+735a635f7",
26
+ "@parcel/types": "2.0.0-canary.1775+735a635f7",
27
+ "@parcel/utils": "2.0.0-canary.1775+735a635f7",
28
28
  "nullthrows": "^1.1.1",
29
29
  "rsc-html-stream": "^0.0.4"
30
30
  },
31
- "gitHead": "e3a2b726db9382a873834da82746671d54557d2b"
31
+ "gitHead": "735a635f7eed538c449f37517b26247e0b19c1a4"
32
32
  }
@@ -264,7 +264,6 @@ async function loadBundleUncached(
264
264
  ];
265
265
  });
266
266
  } else if (entryBundle) {
267
- // console.log('here', entryBundle)
268
267
  queue.add(async () => {
269
268
  let {assets: subAssets} = await loadBundle(
270
269
  entryBundle,
@@ -365,7 +364,9 @@ async function loadBundleUncached(
365
364
  };
366
365
 
367
366
  parcelRequire.load = async (filePath: string) => {
368
- let bundle = bundleGraph.getBundles().find(b => b.name === filePath);
367
+ let bundle = bundleGraph
368
+ .getBundles()
369
+ .find(b => b.publicId === filePath || b.name === filePath);
369
370
  if (bundle) {
370
371
  let {assets: subAssets} = await loadBundle(
371
372
  bundle,
@@ -384,6 +385,20 @@ async function loadBundleUncached(
384
385
  }
385
386
  };
386
387
 
388
+ parcelRequire.resolve = (url: string) => {
389
+ let bundle = bundleGraph
390
+ .getBundles()
391
+ .find(b => b.publicId === url || b.name === url);
392
+ if (bundle) {
393
+ return urlJoin(bundle.target.publicUrl, bundle.name);
394
+ } else {
395
+ throw new Error('Bundle not found');
396
+ }
397
+ };
398
+
399
+ // No-op. We can access the bundle graph directly.
400
+ parcelRequire.extendImportMap = () => {};
401
+
387
402
  // Resolve and load a module by specifier.
388
403
  let loadModule = (id: string, from: string, env = 'react-client') => {
389
404
  let resolver = env === 'react-server' ? serverResolver : clientResolver;