Skip to content

Mark the package as side-effect free - #28

Open
retyui wants to merge 1 commit into
react-native-community:masterfrom
retyui:add-side-effects
Open

retyui wants to merge 1 commit into
react-native-community:masterfrom
retyui:add-side-effects

Conversation

@retyui

@retyui retyui commented Nov 5, 2026

Copy link
Copy Markdown

Summary

fetch.js and src/* only declare and export fetch, Headers, Request and Response. They don't touch globals; installing them as globals is left to the consumer, for example polyfillGlobal('fetch', …). The only top-level statements besides declarations assign Response.error and Response.redirect on the package's own class.

"sideEffects": false

This lets bundlers drop the modules an app doesn't use, such as ArrayBufferResponse or BlobResponse.

Test plan

  • Checked every top-level statement in the published 3.0.0 fetch.js and src/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant