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

Fix overriding single export of a export * #8653

Merged
merged 2 commits into from Nov 27, 2022
Merged

Conversation

mischnic
Copy link
Member

@mischnic mischnic commented Nov 22, 2022

Closes #8652

Right now, the order of $parcel$export is wrong. The exports coming from export * should always be first and get overridden by the explicit exports of the asset

// this was `export {foo}`
$parcel$export(module.exports, "foo", () => $e6ba20bd13e7c6a6$export$6a5cdcad01c973fa); 

// this is `export * from "./c";`
$parcel$export(module.exports, "foo", () => (parcelRequire("1mXMP")).foo);

var $1mXMP = parcelRequire("1mXMP");

var $1mXMP = parcelRequire("1mXMP");
function $e6ba20bd13e7c6a6$export$6a5cdcad01c973fa() {
    return "fooB" + (0, $1mXMP.foo)();
}

TODO

  • Implement Fix

@parcel-benchmark
Copy link

parcel-benchmark commented Nov 22, 2022

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.79s +29.00ms
Cached 439.00ms +16.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 97.00ms -187.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 98.00ms -188.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 98.00ms -188.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 100.00ms -9.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 101.00ms -9.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 100.00ms -9.00ms 🚀

React HackerNews ✅

Timings

Description Time Difference
Cold 11.44s +302.00ms
Cached 560.00ms +35.00ms ⚠️

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/index.js 486.37kb +0.00b 5.97s -876.00ms 🚀
dist/PermalinkedComment.46b19af5.js 4.21kb +0.00b 5.97s -876.00ms 🚀
dist/UserProfile.f8cd7884.js 1.57kb +0.00b 5.97s -876.00ms 🚀
dist/NotFound.960ab92b.js 429.00b +0.00b 5.97s -877.00ms 🚀
dist/logo.c5bb83f1.png 246.00b +0.00b 5.97s -876.00ms 🚀

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.94m -1.76s
Cached 2.47s -128.00ms 🚀

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Three.js ✅

Timings

Description Time Difference
Cold 8.39s +57.00ms
Cached 298.00ms -5.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@mischnic mischnic marked this pull request as ready for review November 27, 2022 19:03
@devongovett devongovett merged commit 60b8ebc into v2 Nov 27, 2022
@devongovett devongovett deleted the 8652-override-reexport-all branch November 27, 2022 21:27
lettertwo added a commit that referenced this pull request Dec 8, 2022
* upstream/v2:
  Make sure we're compiling on ubuntu-20.04
  v2.8.1
  Add mjs and cjs to resolver extensions (#8667)
  Fix transformer-svg-react not finding .svgrrc's (#7741)
  Fix overriding single export of a `export *` (#8653)
  chore: spelling fix (#8614)
  Parse shortcut icons in web app manifests (#8660)
  Make ts-types transformer work with TS >= 4.8 (#8661)
  Don't retarget dependencies with `*` (#8645)
  fix: remove @parcel/utils dep in @parcel/graph (#8630)
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.

Runtime error related to scope hoisting on production build
3 participants