-
Notifications
You must be signed in to change notification settings - Fork 18
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
Address concerns from package maintainers that sourcemaps are too large #41
Comments
Here's another size-related concern from googleapis/google-cloud-node#2867 (comment), which I admit I don't fully understand but perhaps it's about browser download size?
|
One issue I was not too familiar with until recently is that bundle size concern are apparently also real on backend services. The reason being that |
/cc @MylesBorins because of npm package distribution I think the real solution would be separate debug packages. With those in place, I don't think you'd need additional source map features afaict. I'm not sure compression would really solve this. |
I wonder how much of this is because After that, the |
Good question. @trivikr, do you remember approximately what % of your AWS SDK packages' size were
Do you have a sense of how this would work? Do you envision separate packages, one with code+sourcemaps, and one just code? Or a separate "sourcemap-only" package (no executable code, just And what would be the publishing workflow? Would maintainers need separate build configs and need to run
Agree, compression alone may not be enough. But unminified |
I think the correct solution would be to eventually find a way to have something like a source map server protocol. If we get traction going on either debug IDs or source hashes, it would trivial enough to solve this particular problem. Then the main distribution does not contain source maps, and they can be published separate to either npm or any publicly available URL. |
With the
//# sourceMappingURL=node://mypkg-sources#dist/index.js.map
//# debugId=... If npm were to host the symbols, one way npm could enshrine source/debug packages is by having a Then people wouldn't have to sync up two packages like we have to do for #42 is also relevant here. I assume a symbol server would have the easiest time serving How do I set a breakpoint? |
Package maintainers have a lot of reasons why they don't want to ship sourcemaps, but one common complaint that I've heard is that sourcemaps make package downloads and on-disk storage much larger than they'd otherwise be.
For example, the AWS JavaScript SDK's 380 packages reduced download sizes by 21%, or more than 160MB total by removing sourcemaps. Obviously no real user is going to use all 380 packages, but using 20-30 of them is probably not unusual, esp. given intra-SDK dependencies.
For AWS in particular, I suspect that they're sensitive to this because the AWS SDK is probably loaded into hundreds of thousands of cloud server images running in AWS, so all those sourcemaps may have a material impact on AWS's overall storage budget.
But the net result is that the AWS SDK is now harder to debug and troubleshoot. There's been an open issue aws/aws-sdk-js-v3#2895 for 18 months to create a separate debug SDK that has sourcemaps, but there's been no action yet. And honestly that seems like a bad solution because it'd require a different prod vs. dev setup that seems easy to break or get out of sync.
Obviously AWS is an extreme case, but I've heard similar size complaints from many other maintainers. googleapis/google-cloud-node#2867 is a good honeypot of examples (read the issues linked to this one) of maintainers deciding not to ship sourcemaps.
Can we do something to address maintainers' concerns? For example:
I admit I'm not expert enough to know which (if any) of the solutions above are practical. But without addressing the size issue, I fear that we'll never get full adoption of sourcemaps across the ecosystem.
The text was updated successfully, but these errors were encountered: