urql-graphql / urql

The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
https://urql.dev/goto/docs
MIT License
8.61k stars 449 forks source link

fix(storage-rn): Fix interop imports for CommonJS and update React imports #3251

Closed kitten closed 1 year ago

kitten commented 1 year ago

Resolves #3250

Summary

This updates the interop setting in Rollup to correctly identify default imports again when transpiled to commonjs by switching it to auto, and allowing it to add a check for __esModule to the require statement of @urql/storage-rn’s imports specifically in CommonJS.

This PR also updates all React imports to use namespace imports in ESM .es.js output and to assume defaultOnly for interop.

Set of changes