Skip to content

Commit

Permalink
refactor(js): refactor @logto/client package exports
Browse files Browse the repository at this point in the history
refactor @logto/client package exports condition for react-native
  • Loading branch information
simeng-li committed Sep 9, 2024
1 parent cee889a commit 4b6623d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
17 changes: 17 additions & 0 deletions .changeset/poor-lizards-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@logto/client": patch
---

add react-native package export condition

[Enabling package export](https://reactnative.dev/blog/2023/06/21/package-exports-support#enabling-package-exports-beta) in react-native is unstable and can cause issues.

Replace the `exports` in `@logto/client` package.json with the `react-native` [condition](https://reactnative.dev/blog/2023/06/21/package-exports-support#the-new-react-native-condition).

```json
{
"react-native": "./lin/shim.js"
}
```

So the `shim.js` module can be used in react-native projects, without enabling the unstable package export feature.
15 changes: 1 addition & 14 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,7 @@
"main": "./lib/index.cjs",
"module": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"types": "./lib/index.d.ts",
"require": "./lib/index.cjs",
"import": "./lib/index.js",
"default": "./lib/index.js"
},
"./shim": {
"types": "./lib/shim.d.ts",
"require": "./lib/shim.cjs",
"import": "./lib/shim.js",
"default": "./lib/shim.js"
}
},
"react-native": "./lib/shim.js",
"files": [
"lib"
],
Expand Down

0 comments on commit 4b6623d

Please sign in to comment.