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

Retain correct dependency order between imports and reexports without scopehoisting #8591

Merged
merged 4 commits into from Nov 4, 2022

Conversation

mischnic
Copy link
Member

@mischnic mischnic commented Oct 31, 2022

Closes #8560

The problem was that we first collect all imports (and add them to a requires array), and then traverse again to do the same for exports.

Now, the first traversal covers everything that has to do with dependencies (and thus retains the order), and the second traversal only handles declarations that export local bindings (and can't introduce a new dependency).

The diff makes it look more complicated but I just moved some match armes/if branches to the other loop. There was no other logic change

@parcel-benchmark
Copy link

parcel-benchmark commented Oct 31, 2022

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.41s -21.00ms
Cached 267.00ms -21.00ms 🚀

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

React HackerNews ✅

Timings

Description Time Difference
Cold 9.12s +83.00ms
Cached 442.00ms +27.00ms ⚠️

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.60m -850.00ms
Cached 2.12s -5.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/EmojiPickerComponent.1fa69644.js 187.33kb +0.00b 46.35s -2.77s 🚀
dist/card.689f1413.js 127.51kb +0.00b 46.35s -2.77s 🚀
dist/ConfigPanelFieldsLoader.dc63e391.js 83.50kb +0.00b 46.35s -2.77s 🚀
dist/esm.04d15ae5.js 61.48kb +0.00b 46.35s -2.77s 🚀
dist/ElementBrowser.42e778d2.js 57.29kb +0.00b 46.35s -2.77s 🚀
dist/ConfigPanelFieldsLoader.4ec6f541.js 16.40kb +0.00b 46.35s -2.77s 🚀
dist/ui.20d17b35.js 14.08kb +0.00b 46.35s -2.77s 🚀
dist/ConfigPanelFieldsLoader.a0d185a0.js 13.87kb +0.00b 46.35s -2.77s 🚀
dist/mobile-upload.327a0503.js 8.11kb +0.00b 46.35s -2.77s 🚀
dist/ElementBrowser.8f50c725.js 5.54kb +0.00b 46.35s -2.77s 🚀
dist/ConfigPanelFieldsLoader.e046c013.js 3.00kb +0.00b 46.35s -2.77s 🚀
dist/ru.fdb600e7.js 2.94kb +0.00b 46.35s -2.77s 🚀
dist/uk.aeae0dd4.js 2.91kb +0.00b 46.35s -2.77s 🚀
dist/th.bcd8fad5.js 2.75kb +0.00b 46.34s -2.77s 🚀
dist/tr.3968c433.js 2.15kb +0.00b 46.35s -2.77s 🚀
dist/vi.bf757a1c.js 2.15kb +0.00b 46.35s -2.77s 🚀
dist/sv.51378563.js 2.09kb +0.00b 46.34s -2.77s 🚀
dist/zh_TW.6ca95d33.js 2.00kb +0.00b 46.35s -2.77s 🚀
dist/zh.9b716de5.js 1.99kb +0.00b 46.35s -2.77s 🚀
dist/ConfigPanelFieldsLoader.58c3583b.js 1.78kb +0.00b 46.35s -2.77s 🚀
dist/workerHasher.0904bc5b.js 1.72kb +0.00b 46.35s -2.77s 🚀
dist/workerHasher.6ae6406c.js 1.72kb +0.00b 46.35s -2.77s 🚀
dist/ConfigPanelFieldsLoader.fee2d8bd.js 1.12kb +0.00b 46.35s -2.77s 🚀
dist/sk.dd4e83c8.js 791.00b +0.00b 46.34s -2.77s 🚀
dist/simpleHasher.2e0de700.js 742.00b +0.00b 46.35s -2.77s 🚀
dist/simpleHasher.28ade3b5.js 742.00b +0.00b 46.35s -2.77s 🚀
dist/ro.82d888a1.js 633.00b +0.00b 46.35s -2.77s 🚀

Cached Bundles

No bundle changes detected.

Three.js ✅

Timings

Description Time Difference
Cold 6.53s +27.00ms
Cached 254.00ms -7.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit 932b6bd into v2 Nov 4, 2022
@devongovett devongovett deleted the dev-import-reexport-dep-order branch November 4, 2022 05:07
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.

JS Dependency import / export reordering
3 participants