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

parcel-query tool #8478

Merged
merged 17 commits into from Dec 13, 2022
Merged

parcel-query tool #8478

merged 17 commits into from Dec 13, 2022

Conversation

mischnic
Copy link
Member

@mischnic mischnic commented Sep 15, 2022

Adds a CLI tool for inspecting the graphs stored in the Parcel cache (so notably, for doing analysis after a potentially long build without having to rebuild and adding some logging in a reporter somewhere).

(This is probably only marginally useful for end-users)

Some examples of what you can do:

  • .getAsset 3NkQQ to figure out what asset is behind that public id
  • various methods that are on the bundle graph: .getAssetWithDependency <dependency id> , .getIncomingDependencies <asset> , .getResolvedAsset <dependency>, .findAsset <filepath regex>
  • some more experimental queries like .findEntriesBundleGraph <asset> which does traverseAncestors (so reverse DFS) and prints the “paths” or .findBundleReason <bundle-id> <asset-id> to hopefully say why that asset is in the bundle
  • (and for arbitrary analysis, you can also just access the deserialized bundleGraph variable and access the graph directly)

Also exposes an API entrypoint do load the graphs in your own tooling (loadGraphs gives you the asset, bundle, request graph and the bundle info).

@parcel-benchmark
Copy link

parcel-benchmark commented Sep 15, 2022

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 1.44s -17.00ms
Cached 337.00ms -1.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 83.00ms +7.00ms ⚠️
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 83.00ms +6.00ms ⚠️
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 83.00ms +6.00ms ⚠️

Cached Bundles

No bundle changes detected.

React HackerNews ✅

Timings

Description Time Difference
Cold 9.53s +215.00ms
Cached 427.00ms -66.00ms 🚀

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.66m +24.00ms
Cached 2.27s +45.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Three.js ✅

Timings

Description Time Difference
Cold 7.12s +24.00ms
Cached 283.00ms +15.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 December 12, 2022 19:09
@AGawrys AGawrys self-requested a review December 13, 2022 17:01
@mischnic mischnic merged commit cafaeaf into v2 Dec 13, 2022
@mischnic mischnic deleted the parcel-query branch December 13, 2022 17:57
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

4 participants