Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: restore package.json#browser field #817

Merged
merged 3 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading