-
Notifications
You must be signed in to change notification settings - Fork 821
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
chore: mark packages as side effects free for tree shaking #3087
Conversation
|
I am going to mark this as a draft until the CLA is signed. Feel free to mark it as ready when the checks are passing and it is ready for review. |
Codecov Report
@@ Coverage Diff @@
## main #3087 +/- ##
==========================================
- Coverage 93.08% 92.66% -0.42%
==========================================
Files 188 173 -15
Lines 6261 5523 -738
Branches 1323 1175 -148
==========================================
- Hits 5828 5118 -710
+ Misses 433 405 -28
|
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This PR was closed because it has been stale for 14 days with no activity. |
Any plan to include this in future releases ? The size of the library is a show stopper for us to adopt it. |
Yes this is planned. I would have accepted this PR had the CLA been signed. If you'd like to work on it, you can comment on #2855. We're aware that the bundle is prohibitively large for many web users. The early days (and honestly the current days) of this SDK were quite focused on NodeJS as most of the maintainers have significantly more node experience. Also, OTel in general (all languages) tends to be more server-side focused than client-side. We recognize that is a shortcoming and focus is shifting but progress is slow. If you're interested, there is an effort by @MSNev to make the JS SDK more browser-friendly, which may even result in a browser-specific JS SDK. There is also a RUM working group which is working on additions/changes to the spec to make it more client friendly. |
@pkanal was faster on the mark to grab this :-) |
Which problem is this PR solving?
Fixes #2855
For instance, when using the
exporter-trace-otlp-http
package for a simple create/send trace, havingsideEffects
set to false for all packages it depends on results in a 70kb smaller bundle (minified)Short description of the changes
Marked all package as side-effect free with
"sideEffects": false
.This is supposed to be safe:
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Tested manually using samples and setting
sideEffects: false
manually innode_modules
Checklist:
Unit tests have been added