-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
GH-38936: [JS] initialize overrides for DOM and Node in IIFE #39472
base: main
Are you sure you want to change the base?
Conversation
domoritz
commented
Jan 5, 2024
•
edited by github-actions
bot
Loading
edited by github-actions
bot
- Closes: [JS] The package.json file incorrectly specifies sideEffects: false #38936
|
@nrabinowitz can you test this change? If we get it in my Monday, it will be in the next release. |
I see. The issue with my code is that the method might still be thrown away? |
@domoritz yes, I believe so. I'm not sure if there's a clean way to do this... |
What impact would setting |
My understanding is that it makes tree shaking much less effective but we should check to see the impact. Or is there some way to remove the side effect for example by extending the builder and batch reader base classes with the node and dom specific methods and then exporting an extended class? |
The internal factory functions that create builders will be creating instances of the non-extended class, but we could definitely use this strategy as a way to patch the prototypes w/ the static-property-initialized-by-an-IIFE style that defeats tree-shaking. |
Sorry I missed this until now. Based on the discussion here, do you still want me to test this fix as it stands or should I wait for another approach? FWIW, my current workaround is to use a Webpack override to specify |
I'm curious whether it works or not.
How could that work? If someone imports only |