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

Scope hoisting: make interop default a function to support live default binding #5647

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

wbinnssmith
Copy link
Contributor

@wbinnssmith wbinnssmith commented Jan 14, 2021

Previously, determining the default export through interop meant that the binding would stay fixed. Similar to the non-scopehoisting packager, this defers determining the default export by invoking it as a function. Since it can receive exports from another bundle via an init function, it now accepts a function. Since CommonJS can assign module.exports to a function, these init functions must be uniquely identified by a __$parcel$init property.

@height
Copy link

height bot commented Jan 14, 2021

Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@wbinnssmith wbinnssmith force-pushed the wbinnssmith/interop-default-function branch from e1344be to c1f73b8 Compare January 14, 2021 01:56
@parcel-benchmark
Copy link

parcel-benchmark commented Jan 14, 2021

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 2.37s -18.00ms
Cached 465.00ms -11.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/modern/parcel.d5807e82.webp 102.94kb +0.00b 482.00ms -68.00ms 🚀
dist/modern/index.f81b5b4b.js 1.11kb +0.00b 494.00ms -69.00ms 🚀
dist/modern/index.html 701.00b +0.00b 494.00ms -61.00ms 🚀
dist/modern/index.77ce15d4.css 77.00b +0.00b 798.00ms -50.00ms 🚀

Cached Bundles

No bundle changes detected.

React HackerNews ✅

Timings

Description Time Difference
Cold 16.71s -125.00ms
Cached 7.29s -215.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/NotFound.9195d8a0.js 530.00b +0.00b 229.00ms +27.00ms ⚠️
dist/logo.24c8bf9e.png 274.00b +0.00b 433.00ms -22.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/index.js 485.61kb +0.00b 71.00ms -6.00ms 🚀
dist/PermalinkedComment.d85c0b32.js 4.20kb +0.00b 70.00ms -7.00ms 🚀
dist/UserProfile.854f4adc.js 1.76kb +0.00b 70.00ms -160.00ms 🚀

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.78m +4.19s
Cached 2.57s +35.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/index.c90f1e65.js 2.47mb +0.00b 1.07m +7.31s ⚠️
dist/editorView.51048e78.js 587.53kb +0.00b 1.07m +18.03s ⚠️
dist/EmojiPickerComponent.00dbc417.js 139.01kb +0.00b 9.47s +816.00ms ⚠️
dist/Toolbar.b9000328.js 99.77kb +0.00b 12.67s -1.51s 🚀
dist/media-viewer.33fcaded.js 72.87kb +0.00b 9.64s -1.26s 🚀
dist/card.63e17a92.js 54.02kb +0.00b 7.08s -2.02s 🚀
dist/card.72b48e9e.js 51.77kb +0.00b 11.14s -1.00s 🚀
dist/Modal.00b0c761.js 39.18kb +0.00b 4.31s +416.00ms ⚠️
dist/component.86f6e486.js 30.82kb +0.00b 1.51s -1.83s 🚀
dist/esm.eab73ebc.js 27.67kb +0.00b 9.51s +848.00ms ⚠️
dist/component.7d43a56a.js 22.54kb +0.00b 4.31s +428.00ms ⚠️
dist/DatePicker.0bcc849c.js 21.20kb +0.00b 5.54s -3.12s 🚀
dist/js.0a808d22.js 16.55kb +0.00b 4.31s +428.00ms ⚠️
dist/dropzone.13367dd4.js 16.06kb +0.00b 10.40s -3.61s 🚀
dist/ui.617a16c0.js 14.21kb +0.00b 7.04s -1.57s 🚀
dist/workerHasher.83104f73.js 11.90kb +0.00b 9.52s +3.67s ⚠️
dist/component.053770c1.js 6.20kb +0.00b 2.77s -755.00ms 🚀
dist/media-viewer.ebf61ecb.js 4.01kb +0.00b 9.74s -1.15s 🚀
dist/EmojiPickerComponent.d40ea3e1.js 3.62kb +0.00b 7.04s +605.00ms ⚠️
dist/png-chunks-extract.692b85d1.js 3.55kb +0.00b 4.31s +428.00ms ⚠️
dist/index.10f02a5e.css 3.46kb +0.00b 34.02s +18.48s ⚠️
dist/dropzone.840966d2.js 3.44kb +0.00b 9.74s -626.00ms 🚀
dist/Modal.29e822bf.js 3.14kb +0.00b 2.54s +1.24s ⚠️
dist/clipboard.7188d6f8.js 2.97kb +0.00b 10.26s -3.83s 🚀
dist/16.41f46c2f.js 2.49kb +0.00b 1.50s +195.00ms ⚠️
dist/ResourcedEmojiComponent.9812a721.js 2.15kb +0.00b 7.04s -1.54s 🚀
dist/card.a2f58842.js 2.15kb +0.00b 10.31s -573.00ms 🚀
dist/date.5e8b4b49.js 1.96kb +0.00b 4.58s +325.00ms ⚠️
dist/images.e479dcbe.js 1.90kb +0.00b 4.71s +459.00ms ⚠️
dist/feedback.00d01eca.js 1.86kb +0.00b 5.54s -3.12s 🚀
dist/16.8ab9c9cf.js 1.86kb +0.00b 4.71s +710.00ms ⚠️
dist/browser.8d5afc2b.js 1.82kb +0.00b 11.13s -999.00ms 🚀
dist/16.aa2b1e8c.js 1.79kb +0.00b 2.97s -825.00ms 🚀
dist/workerHasher.5caa41b8.js 1.75kb +0.00b 9.45s +3.61s ⚠️
dist/workerHasher.087b011b.js 1.75kb +0.00b 11.16s -980.00ms 🚀
dist/status.008ba29f.js 1.68kb +0.00b 5.45s +959.00ms ⚠️
dist/code.be6c45b5.js 1.61kb +0.00b 4.58s +425.00ms ⚠️
dist/heading6.a29cffb2.js 1.53kb +0.00b 5.54s +966.00ms ⚠️
dist/heading3.2326b3c4.js 1.51kb +0.00b 4.95s +378.00ms ⚠️
dist/16.15d9f682.js 1.46kb +0.00b 2.93s -799.00ms 🚀
dist/emoji.c2ecc9d7.js 1.45kb +0.00b 5.13s +879.00ms ⚠️
dist/16.7fc8af6d.js 1.45kb +0.00b 1.51s +207.00ms ⚠️
dist/16.474c8276.js 1.44kb +0.00b 4.47s +324.00ms ⚠️
dist/16.d49a0bb7.js 1.40kb +0.00b 4.47s +324.00ms ⚠️
dist/heading5.fa40b79e.js 1.40kb +0.00b 5.54s +966.00ms ⚠️
dist/expand.944ff7ce.js 1.38kb +0.00b 5.54s -3.12s 🚀
dist/16.c4941d0d.js 1.36kb +0.00b 4.80s +798.00ms ⚠️
dist/16.a4fa1a69.js 1.34kb +0.00b 1.51s +207.00ms ⚠️
dist/heading2.fa6667ad.js 1.33kb +0.00b 4.95s +378.00ms ⚠️
dist/16.ad29438e.js 1.32kb +0.00b 4.47s +440.00ms ⚠️
dist/16.3d7a389d.js 1.31kb +0.00b 4.47s +324.00ms ⚠️
dist/mention.539104d0.js 1.29kb +0.00b 5.29s +921.00ms ⚠️
dist/heading4.45b46e5b.js 1.29kb +0.00b 4.95s +378.00ms ⚠️
dist/Modal.760be919.js 1.28kb +0.00b 4.31s +428.00ms ⚠️
dist/16.55b14beb.js 1.27kb +0.00b 1.50s +194.00ms ⚠️
dist/16.45835899.js 1.27kb +0.00b 4.67s +667.00ms ⚠️
dist/16.e83a0923.js 1.26kb +0.00b 3.26s -713.00ms 🚀
dist/16.cc8ae77e.js 1.26kb +0.00b 4.52s +519.00ms ⚠️
dist/16.71387abf.js 1.26kb +0.00b 2.92s -807.00ms 🚀
dist/divider.d62a9038.js 1.25kb +0.00b 4.58s +325.00ms ⚠️
dist/quote.05e17876.js 1.25kb +0.00b 5.36s +868.00ms ⚠️
dist/component.5df34eb8.js 1.23kb +0.00b 2.53s -797.00ms 🚀
dist/action.7545becf.js 1.23kb +0.00b 4.58s +431.00ms ⚠️
dist/16.f1c68cda.js 1.23kb +0.00b 2.53s -795.00ms 🚀
dist/decision.aa61b855.js 1.21kb +0.00b 4.58s +325.00ms ⚠️
dist/panel-warning.96ab13ca.js 1.21kb +0.00b 4.81s +317.00ms ⚠️
dist/list.2f1b17d3.js 1.18kb +0.00b 4.71s +341.00ms ⚠️
dist/heading1.608781c0.js 1.18kb +0.00b 4.95s -542.00ms 🚀
dist/panel-error.aa8fc53d.js 1.11kb +0.00b 4.81s +439.00ms ⚠️
dist/panel.e409d6fe.js 1.10kb +0.00b 4.81s +316.00ms ⚠️
dist/table.d445bf7f.js 1.09kb +0.00b 4.95s +452.00ms ⚠️
dist/panel-success.26c394f0.js 1.05kb +0.00b 4.81s +439.00ms ⚠️
dist/panel-note.0319a3fe.js 1.05kb +0.00b 4.81s +439.00ms ⚠️
dist/media-picker-analytics-error-boundary.3e4d365d.js 1003.00b +0.00b 9.75s -4.26s 🚀
dist/media-card-analytics-error-boundary.ece1d621.js 999.00b +0.00b 11.14s -994.00ms 🚀
dist/media-viewer-analytics-error-boundary.9e64afc6.js 995.00b +0.00b 10.31s -580.00ms 🚀
dist/simpleHasher.26a74474.js 755.00b +0.00b 7.04s +1.16s ⚠️
dist/index.html 119.00b +0.00b 1.90s -837.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/index.ceb080bc.js 2.43mb +0.00b 537.00ms +32.00ms ⚠️
dist/pdfRenderer.6d316c6f.js 1.11mb +3.00b ⚠️ 580.00ms +28.00ms
dist/editorView.51048e78.js 587.53kb +0.00b 599.00ms +34.00ms ⚠️
dist/popup.b5893fe9.js 169.17kb +0.00b 591.00ms +39.00ms ⚠️
dist/EmojiPickerComponent.00dbc417.js 139.01kb +0.00b 558.00ms +36.00ms ⚠️
dist/Toolbar.3a17c008.js 99.68kb +0.00b 599.00ms +35.00ms ⚠️
dist/card.ee3301bd.js 53.93kb +0.00b 570.00ms +32.00ms ⚠️
dist/Modal.d1648f35.js 39.01kb +0.00b 463.00ms +42.00ms ⚠️
dist/component.86f6e486.js 30.82kb +0.00b 458.00ms +47.00ms ⚠️
dist/esm.eab73ebc.js 27.67kb +0.00b 581.00ms +42.00ms ⚠️
dist/component.7d43a56a.js 22.54kb +0.00b 464.00ms +43.00ms ⚠️
dist/smartMediaEditor.2987dd07.js 16.76kb +0.00b 599.00ms +34.00ms ⚠️
dist/js.0a808d22.js 16.55kb +0.00b 463.00ms +42.00ms ⚠️
dist/ui.617a16c0.js 14.21kb +0.00b 570.00ms +32.00ms ⚠️
dist/workerHasher.83104f73.js 11.90kb +0.00b 582.00ms +43.00ms ⚠️
dist/component.053770c1.js 6.20kb +0.00b 467.00ms +37.00ms ⚠️
dist/png-chunks-extract.692b85d1.js 3.55kb +0.00b 464.00ms +43.00ms ⚠️
dist/EmojiPickerComponent.39b93682.js 3.53kb +0.00b 582.00ms +32.00ms ⚠️
dist/index.10f02a5e.css 3.46kb +0.00b 600.00ms +34.00ms ⚠️
dist/dropzone.840966d2.js 3.44kb +0.00b 591.00ms +39.00ms ⚠️
dist/16.41f46c2f.js 2.49kb +0.00b 457.00ms +46.00ms ⚠️
dist/ResourcedEmojiComponent.9812a721.js 2.15kb +0.00b 570.00ms +32.00ms ⚠️
dist/card.a2f58842.js 2.15kb +0.00b 591.00ms +40.00ms ⚠️
dist/date.5e8b4b49.js 1.96kb +0.00b 495.00ms +35.00ms ⚠️
dist/images.e479dcbe.js 1.90kb +0.00b 508.00ms +40.00ms ⚠️
dist/16.8ab9c9cf.js 1.86kb +0.00b 479.00ms -43.00ms 🚀
dist/16.aa2b1e8c.js 1.79kb +0.00b 467.00ms +37.00ms ⚠️
dist/workerHasher.5caa41b8.js 1.75kb +0.00b 582.00ms +43.00ms ⚠️
dist/list-number.cc386df7.js 1.68kb +0.00b 514.00ms +42.00ms ⚠️
dist/status.008ba29f.js 1.68kb +0.00b 529.00ms +51.00ms ⚠️
dist/code.be6c45b5.js 1.61kb +0.00b 495.00ms +35.00ms ⚠️
dist/link.f7c12162.js 1.53kb +0.00b 508.00ms +40.00ms ⚠️
dist/heading3.2326b3c4.js 1.51kb +0.00b 557.00ms +70.00ms ⚠️
dist/16.b19b33ca.js 1.51kb +0.00b 473.00ms +34.00ms ⚠️
dist/16.15d9f682.js 1.46kb +0.00b 467.00ms +37.00ms ⚠️
dist/16.fe7e09db.js 1.46kb +0.00b 473.00ms +34.00ms ⚠️
dist/emoji.c2ecc9d7.js 1.45kb +0.00b 507.00ms +39.00ms ⚠️
dist/16.7fc8af6d.js 1.45kb +0.00b 458.00ms +47.00ms ⚠️
dist/16.474c8276.js 1.44kb +0.00b 538.00ms +91.00ms ⚠️
dist/16.d49a0bb7.js 1.40kb +0.00b 479.00ms +32.00ms ⚠️
dist/16.c4941d0d.js 1.36kb +0.00b 479.00ms +32.00ms ⚠️
dist/16.a4fa1a69.js 1.34kb +0.00b 458.00ms +47.00ms ⚠️
dist/heading2.fa6667ad.js 1.33kb +0.00b 557.00ms +70.00ms ⚠️
dist/16.ad29438e.js 1.32kb +0.00b 479.00ms +32.00ms ⚠️
dist/16.3d7a389d.js 1.31kb +0.00b 495.00ms +35.00ms ⚠️
dist/mention.539104d0.js 1.29kb +0.00b 514.00ms +42.00ms ⚠️
dist/heading4.45b46e5b.js 1.29kb +0.00b 557.00ms +70.00ms ⚠️
dist/Modal.760be919.js 1.28kb +0.00b 463.00ms +42.00ms ⚠️
dist/16.55b14beb.js 1.27kb +0.00b 458.00ms +47.00ms ⚠️
dist/layout.61e66223.js 1.27kb +0.00b 508.00ms +40.00ms ⚠️
dist/16.45835899.js 1.27kb +0.00b 473.00ms +34.00ms ⚠️
dist/16.e83a0923.js 1.26kb +0.00b 467.00ms +37.00ms ⚠️
dist/16.d315628f.js 1.26kb +0.00b 473.00ms +34.00ms ⚠️
dist/16.cc8ae77e.js 1.26kb +0.00b 473.00ms +34.00ms ⚠️
dist/16.71387abf.js 1.26kb +0.00b 467.00ms +37.00ms ⚠️
dist/divider.d62a9038.js 1.25kb +0.00b 507.00ms +39.00ms ⚠️
dist/quote.05e17876.js 1.25kb +0.00b 529.00ms +51.00ms ⚠️
dist/action.7545becf.js 1.23kb +0.00b 495.00ms +35.00ms ⚠️
dist/media-card-analytics-error-boundary.d5ccfa87.js 1.23kb +0.00b 570.00ms +32.00ms ⚠️
dist/decision.aa61b855.js 1.21kb +0.00b 495.00ms +34.00ms ⚠️
dist/panel-warning.96ab13ca.js 1.21kb +0.00b 522.00ms +46.00ms ⚠️
dist/16.8cd85281.js 1.18kb +0.00b 479.00ms +32.00ms ⚠️
dist/list.2f1b17d3.js 1.18kb +0.00b 514.00ms +42.00ms ⚠️
dist/heading1.608781c0.js 1.18kb +0.00b 557.00ms +70.00ms ⚠️
dist/panel-error.aa8fc53d.js 1.11kb +0.00b 514.00ms +42.00ms ⚠️
dist/panel.e409d6fe.js 1.10kb +0.00b 522.00ms +45.00ms ⚠️
dist/table.d445bf7f.js 1.09kb +0.00b 542.00ms +55.00ms ⚠️
dist/panel-success.26c394f0.js 1.05kb +0.00b 521.00ms +45.00ms ⚠️
dist/panel-note.0319a3fe.js 1.05kb +0.00b 514.00ms +42.00ms ⚠️
dist/media-picker-analytics-error-boundary.3e4d365d.js 1003.00b +0.00b 591.00ms +32.00ms ⚠️
dist/media-card-analytics-error-boundary.2e3e2b28.js 999.00b +0.00b 570.00ms +32.00ms ⚠️
dist/simpleHasher.26a74474.js 755.00b +0.00b 582.00ms +43.00ms ⚠️
dist/simpleHasher.042b95c1.js 755.00b +0.00b 599.00ms +34.00ms ⚠️
dist/index.html 119.00b +0.00b 479.00ms +48.00ms ⚠️

Three.js ✅

Timings

Description Time Difference
Cold 12.05s +177.00ms
Cached 526.00ms +5.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/Three.js 580.59kb +0.00b 86.00ms -5.00ms 🚀

Click here to view a detailed benchmark overview.

@wbinnssmith wbinnssmith force-pushed the wbinnssmith/interop-default-function branch from c1f73b8 to 285f87d Compare January 14, 2021 05:40
@mischnic
Copy link
Member

(Just so I don't forget about this branch: https://github.com/parcel-bundler/parcel/compare/mischnic/5662-interop-init)

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