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 packaging of synchronous reused bundles #8934

Merged
merged 3 commits into from
May 5, 2023
Merged

Conversation

mattcompiles
Copy link
Contributor

↪️ Pull Request

The new bundler currently assumes all bundles that have source bundles do not have a mainEntryAsset (reused bundles) and can create bundles that fail in packaging. We experienced this locally with an inline SVG dependency.

This PR resolves this issue by adding an extra check before creating a shared bundle with no main entry.

💻 Examples

🚨 Test instructions

I've validated this fixes my issue locally but wasn't sure how to replicate it in the test suite. @AGawrys any ideas?

✔️ 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.97s -139.00ms 🚀
Cached 396.00ms -15.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 303.00ms -27.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 304.00ms -27.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 304.00ms -27.00ms 🚀
dist/legacy/index.7d75205b.js 1.63kb +0.00b 494.00ms -36.00ms 🚀
dist/legacy/index.d20f91ee.js 1.19kb +0.00b 495.00ms -34.00ms 🚀
dist/modern/index.1ee30fe4.js 1.12kb +0.00b 493.00ms -35.00ms 🚀
dist/legacy/index.b8ae99ba.css 94.00b +0.00b 313.00ms -29.00ms 🚀
dist/modern/index.31cedca9.css 94.00b +0.00b 313.00ms -29.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 301.00ms -21.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 302.00ms -21.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 302.00ms -21.00ms 🚀
dist/legacy/index.b8ae99ba.css 94.00b +0.00b 314.00ms -21.00ms 🚀
dist/modern/index.31cedca9.css 94.00b +0.00b 313.00ms -21.00ms 🚀

React HackerNews ✅

Timings

Description Time Difference
Cold 8.79s +60.00ms
Cached 561.00ms +23.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/index.js 463.02kb +0.00b 1.38s +77.00ms ⚠️
dist/PermalinkedComment.60e78a07.js 4.18kb +0.00b 641.00ms +62.00ms ⚠️
dist/UserProfile.c18819ee.js 1.57kb +0.00b 641.00ms +62.00ms ⚠️
dist/NotFound.cfeedbab.js 427.00b +0.00b 641.00ms +62.00ms ⚠️
dist/logo.c5bb83f1.png 246.00b +0.00b 432.00ms +23.00ms ⚠️

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.29m -1.08s
Cached 2.67s +46.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/pdfRenderer.4f3765de.js 1.11mb +0.00b 15.53s -789.00ms 🚀
dist/media-viewer.bd165005.js 542.15kb +0.00b 14.10s +2.85s ⚠️
dist/ConfigPanelFieldsLoader.f06a6b36.js 312.08kb +0.00b 10.04s -1.21s 🚀
dist/card.501ecffa.js 143.52kb +0.00b 10.04s -1.21s 🚀
dist/ConfigPanelFieldsLoader.e1ae433f.js 83.45kb +0.00b 10.04s -1.21s 🚀
dist/ElementBrowser.3bcad544.js 65.85kb +0.00b 10.04s -1.21s 🚀
dist/archive.b919f1ad.js 61.47kb +0.00b 14.10s +2.85s ⚠️
dist/esm.945b66be.js 60.94kb +0.00b 10.03s -1.22s 🚀
dist/component.e578d640.js 58.27kb +0.00b 6.69s -336.00ms 🚀
dist/ConfigPanelFieldsLoader.ef739802.js 16.14kb +0.00b 10.04s -1.21s 🚀
dist/ui.2de0ef21.js 14.88kb +0.00b 10.04s -1.21s 🚀
dist/ConfigPanelFieldsLoader.c68d84ab.js 14.25kb +0.00b 10.04s -1.21s 🚀
dist/pdfRenderer.187ba54d.js 12.21kb +0.00b 10.04s -1.21s 🚀
dist/mobile-upload.136dd5cb.js 8.08kb +0.00b 10.04s -1.21s 🚀
dist/mobile-upload.0bdb676c.js 8.08kb +0.00b 10.04s -1.22s 🚀
dist/media-viewer-analytics-error-boundary.e6109a6a.js 3.46kb +0.00b 14.10s +2.85s ⚠️
dist/ru.896915b9.js 2.94kb +0.00b 10.04s +1.88s ⚠️
dist/uk.48c97550.js 2.89kb +0.00b 10.04s -1.21s 🚀
dist/codeViewerRenderer.915ef6b3.js 2.84kb +0.00b 14.10s +2.85s ⚠️
dist/th.31044730.js 2.73kb +0.00b 10.04s -1.21s 🚀
dist/vi.d8dcb67a.js 2.22kb +0.00b 10.04s -1.21s 🚀
dist/pt_BR.eccfad73.js 2.19kb +0.00b 10.04s +1.88s ⚠️
dist/tr.46f26598.js 2.16kb +0.00b 10.04s -1.22s 🚀
dist/sv.13d93533.js 2.10kb +0.00b 10.04s -1.21s 🚀
dist/zh_TW.afaf6222.js 1.98kb +0.00b 10.04s -1.21s 🚀
dist/zh.fcdc32bb.js 1.96kb +0.00b 10.04s -1.21s 🚀
dist/workerHasher.ef49a7fc.js 1.72kb +0.00b 10.04s -1.21s 🚀
dist/workerHasher.9d5fe27b.js 1.72kb +0.00b 10.04s -1.21s 🚀
dist/heading5.023a8f1f.js 1.36kb +0.00b 7.79s +432.00ms ⚠️
dist/sk.101f1705.js 786.00b +0.00b 10.04s +1.88s ⚠️
dist/simpleHasher.f1f58b0a.js 687.00b +0.00b 10.04s -1.21s 🚀
dist/simpleHasher.09f4d713.js 687.00b +0.00b 10.04s -1.21s 🚀
dist/index.html 240.00b +0.00b 14.36s +7.48s ⚠️

Cached Bundles

Bundle Size Difference Time Difference
dist/component-lazy.60375b05.js 60.45kb +0.00b 7.97s +529.00ms ⚠️
dist/index.b16227d6.css 4.08kb +0.00b 14.08s -736.00ms 🚀
dist/codeViewerRenderer.915ef6b3.js 2.84kb +0.00b 14.04s +3.31s ⚠️
dist/heading4.05995ed9.js 1.25kb +0.00b 7.86s +408.00ms ⚠️
dist/ro.a6eff34a.js 612.00b +0.00b 10.20s +1.95s ⚠️

Three.js ✅

Timings

Description Time Difference
Cold 5.91s -8.00ms
Cached 336.00ms -7.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@AGawrys
Copy link
Contributor

AGawrys commented May 5, 2023

We've agreed we don't think this needs a test case. Gonna give it the ✅

@AGawrys AGawrys self-requested a review May 5, 2023 00:15
@mattcompiles mattcompiles merged commit 049ee1d into v2 May 5, 2023
@mattcompiles mattcompiles deleted the fix-reused-entry-assets branch May 5, 2023 01:26
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.

3 participants