Skip to content

Commit

Permalink
fix: restore package.json#browser field (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
broofa authored Oct 27, 2024
1 parent 6695be6 commit ae8f386
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (form
- CommonJS, [ECMAScript Modules](#ecmascript-modules)
- NodeJS 16+ ([LTS releases](https://github.com/nodejs/Release))
- Chrome, Safari, Firefox, Edge browsers
- [React Native / Expo](#react-native--expo)
- **Secure** - Cryptographically-strong random values
- **Compact** - No dependencies, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking)
- **CLI** - Includes the [`uuid` command line](#command-line) utility
Expand Down Expand Up @@ -479,6 +480,18 @@ Prior to `uuid@11`, it was possible for `options` state to interfere with the in
- Without `options`: Internal state is utilized to improve UUID uniqueness.
- With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed.

## Known issues

### React Native / Expo

1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point:

```javascript
import 'react-native-get-random-values';
import { v4 as uuidv4 } from 'uuid';
```

---

Markdown generated from [README_js.md](README_js.md) by <a href="https://github.com/broofa/runmd"><image height="12px" src="https://camo.githubusercontent.com/5c7c603cd1e6a43370b0a5063d457e0dabb74cf317adc7baba183acb686ee8d0/687474703a2f2f692e696d6775722e636f6d2f634a4b6f3662552e706e67" /></a>
13 changes: 13 additions & 0 deletions README_js.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (form
- CommonJS, [ECMAScript Modules](#ecmascript-modules)
- NodeJS 16+ ([LTS releases](https://github.com/nodejs/Release))
- Chrome, Safari, Firefox, Edge browsers
- [React Native / Expo](#react-native--expo)
- **Secure** - Cryptographically-strong random values
- **Compact** - No dependencies, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking)
- **CLI** - Includes the [`uuid` command line](#command-line) utility
Expand Down Expand Up @@ -486,3 +487,15 @@ Prior to `uuid@11`, it was possible for `options` state to interfere with the in

- Without `options`: Internal state is utilized to improve UUID uniqueness.
- With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed.

## Known issues

### React Native / Expo

1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point:

```javascript
import 'react-native-get-random-values';
import { v4 as uuidv4 } from 'uuid';
```
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
"./package.json": "./package.json"
},
"module": "./dist/esm/index.js",
"browser": {
"./dist/esm/index.js": "./dist/esm-browser/index.js",
"./dist/cjs/index.js": "./dist/cjs-browser/index.js"
},
"files": [
"CHANGELOG.md",
"CONTRIBUTING.md",
Expand Down

0 comments on commit ae8f386

Please sign in to comment.