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

Ensure nested member expressions are marked used in dev mode #9258

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

mattcompiles
Copy link
Contributor

↪️ Pull Request

Currently with scope hoisting disabled, nested member expressions are not tracked for import usage correctly. This can cause runtime errors as the import is ignored when the module is side-effect free.

The fix is to ensure we continue to visit the nested member expressions until we find the root.

💻 Examples

Example where foo would not be marked as used:

import {foo} from 'foo';
foo.a.b();

🚨 Test instructions

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@parcel-benchmark
Copy link

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.40s -36.00ms
Cached 279.00ms +39.00ms ⚠️

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

React HackerNews ✅

Timings

Description Time Difference
Cold 3.84s -50.00ms
Cached 402.00ms -0.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/logo.8dd07848.png 244.00b +0.00b 233.00ms -19.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/PermalinkedComment.3145598b.js 3.94kb +0.00b 343.00ms +43.00ms ⚠️
dist/UserProfile.b37bbaff.js 1.38kb +0.00b 343.00ms +43.00ms ⚠️
dist/NotFound.c08212ea.js 265.00b +0.00b 343.00ms +43.00ms ⚠️
dist/logo.8dd07848.png 244.00b +0.00b 251.00ms +37.00ms ⚠️

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 32.62s -256.00ms
Cached 2.14s -11.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/ConfigPanelFieldsLoader.8648eeee.js 306.81kb +0.00b 7.53s -2.54s 🚀
dist/card.3521c96b.js 140.18kb +0.00b 7.52s -2.55s 🚀
dist/esm.ce3e12df.js 59.72kb +0.00b 7.53s -2.54s 🚀
dist/pdfRenderer.6335b9a2.js 12.08kb +0.00b 7.52s -2.55s 🚀
dist/mobile-upload.e9eb996a.js 7.86kb +0.00b 7.53s -2.54s 🚀
dist/pl.f089a702.js 2.25kb +0.00b 5.47s -836.00ms 🚀
dist/ja.a9cd0bd6.js 2.09kb +0.00b 5.47s -835.00ms 🚀
dist/pt_BR.1db6fd92.js 2.06kb +0.00b 5.47s -837.00ms 🚀
dist/ko.954590a1.js 1.97kb +0.00b 5.47s -835.00ms 🚀
dist/nb.7f52770f.js 1.96kb +0.00b 5.47s -835.00ms 🚀
dist/nl.fd54481e.js 1.94kb +0.00b 5.47s -835.00ms 🚀
dist/workerHasher.8fdadeba.js 1.56kb +0.00b 7.53s -2.54s 🚀
dist/pt_PT.16308ef8.js 631.00b +0.00b 5.47s -835.00ms 🚀
dist/simpleHasher.180c1d91.js 585.00b +0.00b 7.53s -2.54s 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/EmojiPickerComponent.c199902f.js 189.68kb +0.00b 10.67s +537.00ms ⚠️
dist/ConfigPanelFieldsLoader.1a016f33.js 82.96kb +0.00b 10.67s +537.00ms ⚠️

Three.js ✅

Timings

Description Time Difference
Cold 2.87s -25.00ms
Cached 331.00ms +23.00ms ⚠️

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@mattcompiles mattcompiles merged commit b0feb72 into v2 Sep 21, 2023
15 of 16 checks passed
@mattcompiles mattcompiles deleted the fix-used-members-dev-mode branch September 21, 2023 01:48
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