Skip to content

Make react-native-fs an optional peer dependency#2456

Open
ej612 wants to merge 1 commit intoAlaSQL:developfrom
ej612:ej612-peer-dep
Open

Make react-native-fs an optional peer dependency#2456
ej612 wants to merge 1 commit intoAlaSQL:developfrom
ej612:ej612-peer-dep

Conversation

@ej612
Copy link
Copy Markdown

@ej612 ej612 commented Mar 29, 2026

So far, react-native-fs has been declared under optionalDependencies, as alasql will use it if available, but doesn't require it to be there. This relation, however, is that of an optional peer dependency, which is contrary to how optionalDependencies works, which is that npm will install it by default. To relieve people from having to use custom logic if they don't want to end up with react-native-fs, we turn that package into a peer dependency, and use npm's peerDependenciesMeta field to declare it as optional.

Note that this is a breaking change as npm will no longer pull in react-native-fs by default.

Fixes: #2454

So far, `react-native-fs` has been declared under `optionalDependencies`, as alasql will use it if available, but doesn't require it being there.
This relation, however, is that of an optional peer dependency, which is contrary to how `optionalDependencies` works, which is that npm will install it by default.
To relieve people from having to use custom logic if they don't want to end up with `react-native-fs`, we turn that package into a peer dependency, and use npm's [peerDependenciesMeta](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#peerdependenciesmeta) field to declare it as optional.

Note that this is a breaking change as npm will no longer pull in `react-native-fs` by default.

Fixes: AlaSQL#2454
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.

Dependency on outdated version of glob

1 participant