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

Import tracer #2411

Open
kriskowal opened this issue Aug 16, 2024 · 2 comments
Open

Import tracer #2411

kriskowal opened this issue Aug 16, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@kriskowal
Copy link
Member

What is the Problem Being Solved?

Bundles tend to get big and we notice when they can’t be posted to an Agoric blockchain with a message size limit, for example. They get big because modules get entrained by import and we need a way to investigate why they got entrained and how many bytes they (shallowly, transitively, differentially) contributed to the bundle. So, a tool like yarn why, but for modules instead of packages would be in order.

Description of the Design

A CLI tool, tentatively bundle-why would take bundle-why <entry.js> <contributor.js> would make a report starting at contributor.js that shows how many bytes it is, how many bytes it transitively imports, and how many bytes it transitively imports that were not accounted for by previous entries, then indent (maybe) and make the same report for each of its shallow imports from largest differential weight to least.

The tool will need to take the same -C,condition as bundle-source.

Security Considerations

None.

Scaling Considerations

None.

Test Plan

None.

Compatibility Considerations

None.

Upgrade Considerations

None.

@kriskowal kriskowal added the enhancement New feature or request label Aug 16, 2024
@kriskowal
Copy link
Member Author

Maybe trace-imports

@erights
Copy link
Contributor

erights commented Aug 16, 2024

See also Agoric/agoric-sdk#9900 and the nice collections of links it cites

@kriskowal kriskowal changed the title Bundle weight watcher Import tracer Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants