-
Notifications
You must be signed in to change notification settings - Fork 644
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
Add "sideEffects": false
to package.json
#1021
Comments
If you would like to upvote the priority of this issue, please comment below or react on the original post above with 👍 so we can see what is popular when we triage.@ABuffSeagull Thank you for opening this issue. 🙏
This is an automated message, feel free to ignore. |
Hey @ABuffSeagull, this module is very likely free of sideEffects per the webpack definition:
However, I'd like to point out two things:
The recommended way to use the autocomplete API in a regular client-application is either using the Maps JavaScript API or directly via fetch. Depending on your use-case, something as simple as async function queryAutocomplete(input) {
const url = new URL('https://maps.googleapis.com/maps/api/place/queryautocomplete/json');
url.searchParams.set('input', input);
url.searchParams.set('apiKey', YOUR_API_KEY);
const res = await fetch(url.toString());
const data = await res.json();
return data.predictions;
} could already be enough. |
Hey, thanks for the response! |
Is your feature request related to a problem? Please describe.
Without this field, certain bundlers (namely ESBuild) don't know if they tree-shake this package correctly, so they'll leave it in just in case. In my Remix project, this causes a 1.5MB
node:crypto
polyfill to be included in the bundle for no reason.Describe the solution you'd like
Simply adding
"sideEffects": false
to thepackage.json
is enough to fix it. I've tested this withpatch-package
and everything works perfectly.Describe alternatives you've considered
N/A
Additional context
I'd make a pull-request, but I'd imagine it's easier to have someone on the team do it than to have to do the whole CLA song and dance.
The text was updated successfully, but these errors were encountered: