-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
Try mangling _private
service props
#165117
Conversation
Results in a slight reduction in code size. Needs more testing
Change looks good, unsure about the CI failure tho |
Could this be failing because folks use |
@jrieken Where were seeing the failures? I created a private build (13c08c6). It failed for unrelated reasons. I will kick off another test build though I also sanity checked the bits that succeeded and everything seems to run ok |
Sorry, saw the wrong/bogous build failure. Anyways, I do believe there is an inherent risk with this or I am missing something. We have many injected services using As a related FYI: I have updated #165259 to only check for |
@jrieken My understanding of property mangling is that it operates on the entire bundle (not per file). If a |
Closing in favor of #166126 |
This enables property mangling for properties with names such as
_someService
. This is designed to only touch properties that we are confident can be mangled safely (in this case, any private services)This results in a very small (0.75%) reduction in the size of workbench.js. For the future:
If we mangle every
this.someService
property, we could reduce the bundle size by 4%If we mangle every
this._privateProp
properties, we could reduce the bundle size by 6%. We could likely save more by adopting_
names for private props in more placesIf we mangle every property, we'd reduce by bundle size by 40% (this is only theoretically, as doing this completely breaks the code)