Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for chained reexports from a hybrid module #7980

Merged
merged 6 commits into from May 10, 2022

Conversation

lettertwo
Copy link
Member

@lettertwo lettertwo commented Apr 19, 2022

This adds two tests that fail prior to #7944

 
  1) scope hoisting
       es6
         should support chained reexports from hybrid modules:
     a.js:56
output = (/*@__PURE__*/$parcel$interopDefault($d2UUm)) + $8693f62e1d3f1804$exports.bar;
                                                         ^

ReferenceError: $8693f62e1d3f1804$exports is not defined
      at a.js:56:58
      at a.js:58:3
      at Script.runInContext (vm.js:144:12)
      at runBundles (~/parcel/packages/core/test-utils/src/utils.js:375:10)
      at runBundle (~/parcel/packages/core/test-utils/src/utils.js:457:12)
      at run (~/parcel/packages/core/test-utils/src/utils.js:478:10)
      at Context.<anonymous> (test/scope-hoisting.js:1995:26)

  2) scope hoisting
       es6
         should support chained reexports as default from hybrid modules:
     AssertionError [ERR_ASSERTION]: Asset was skipped or not found.
      at ScopeHoistingPackager.getSymbolResolution (~/parcel/packages/packagers/js/src/ScopeHoistingPackager.js:831:7)
      at map (~/parcel/packages/packagers/js/src/ScopeHoistingPackager.js:984:33)
      at Array.map (<anonymous>)
      at ScopeHoistingPackager.buildAssetPrelude (~/parcel/packages/packagers/js/src/ScopeHoistingPackager.js:983:12)
      at ScopeHoistingPackager.buildAsset (~/parcel/packages/packagers/js/src/ScopeHoistingPackager.js:437:48)
      at ScopeHoistingPackager.visitAsset (~/parcel/packages/packagers/js/src/ScopeHoistingPackager.js:380:17)
      at replace (~/parcel/packages/packagers/js/src/ScopeHoistingPackager.js:496:56)
      at String.replace (<anonymous>)
      at ScopeHoistingPackager.buildAsset (~/parcel/packages/packagers/js/src/ScopeHoistingPackager.js:458:19)
      at ScopeHoistingPackager.visitAsset (~/parcel/packages/packagers/js/src/ScopeHoistingPackager.js:380:17)

Related: #6892

This captures a case where a CJS export is missing.
This captures a case where packaging fails
with `Asset was skipped or not found`.
@lettertwo lettertwo changed the title Add tests for reexports from a hybrid module Add tests for chained reexports from a hybrid module Apr 20, 2022
@parcel-benchmark
Copy link

parcel-benchmark commented Apr 20, 2022

Benchmark Results

Kitchen Sink 🚨

Timings

Description Time Difference
Cold FAILED -0.00ms
Cached FAILED -0.00ms

Cold Bundles

No bundles found, this is probably a failed build...

Cached Bundles

No bundles found, this is probably a failed build...

React HackerNews ✅

Timings

Description Time Difference
Cold 8.91s +9.00ms
Cached 452.00ms -8.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/logo.c5bb83f1.png 246.00b +0.00b 4.79s +724.00ms ⚠️

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.60m +3.85s
Cached 2.58s +205.00ms ⚠️

Cold Bundles

Bundle Size Difference Time Difference
dist/index.69e5454d.js 3.32mb -144.00b 🚀 30.72s +850.00ms

Cached Bundles

Bundle Size Difference Time Difference
dist/index.3750cb3a.js 3.32mb +144.00b ⚠️ 30.48s -669.00ms

Three.js ✅

Timings

Description Time Difference
Cold 6.46s -1.00ms
Cached 275.00ms +26.00ms ⚠️

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@lettertwo lettertwo merged commit e68beeb into v2 May 10, 2022
@lettertwo lettertwo deleted the lettertwo/reexports-hybrid-tests branch September 12, 2022 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants