uuid 11.0.0-0 → 11.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +7 -6
  2. package/README.md +27 -15
  3. package/package.json +27 -28
package/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
- # Changelog
1
+ ## [11.0.0](https://github.com/uuidjs/uuid/compare/v11.0.0...v11.0.0) (2024-10-27)
2
2
 
3
- All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
3
+ ## [11.0.1](https://github.com/uuidjs/uuid/compare/v11.0.0...v11.0.1) (2024-10-27)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * restore package.json#browser field ([#817](https://github.com/uuidjs/uuid/issues/817)) ([ae8f386](https://github.com/uuidjs/uuid/commit/ae8f38657bca0ee053bf29c88c006b1ea05af1b5))
4
9
 
5
10
  ## [11.0.0-0](https://github.com/uuidjs/uuid/compare/v9.0.0...v11.0.0-0) (2024-09-05)
6
11
 
@@ -13,11 +18,8 @@ All notable changes to this project will be documented in this file. See [standa
13
18
 
14
19
  ### Features
15
20
 
16
- - add support for MAX uuid (new in RFC9562) ([#714](https://github.com/uuidjs/uuid/issues/714)) ([0385cd3](https://github.com/uuidjs/uuid/commit/0385cd3f18ae9920678b2849932fa7a9d9aee7d0))
17
21
  - Port to TypeScript, closes [#762](https://github.com/uuidjs/uuid/issues/762) ([#763](https://github.com/uuidjs/uuid/issues/763)) ([1e0f987](https://github.com/uuidjs/uuid/commit/1e0f9870db864ca93f7a69db0d468b5e1b7605e7))
18
- - support v6 uuids ([#754](https://github.com/uuidjs/uuid/issues/754)) ([c4ed13e](https://github.com/uuidjs/uuid/commit/c4ed13e7159d87c9e42a349bdd9dc955f1af46b6))
19
22
  - update node support matrix (only support node 16-20) ([#750](https://github.com/uuidjs/uuid/issues/750)) ([883b163](https://github.com/uuidjs/uuid/commit/883b163b9ab9d6655bfbd8a35e61a3c71674dfe1))
20
- - v8 support ([#759](https://github.com/uuidjs/uuid/issues/759)) ([35a5342](https://github.com/uuidjs/uuid/commit/35a53428202657e402e6b4aa68f56c08194541bf))
21
23
 
22
24
  ### Bug Fixes
23
25
 
@@ -25,7 +27,6 @@ All notable changes to this project will be documented in this file. See [standa
25
27
  - refactor v1 internal state and options logic ([#780](https://github.com/uuidjs/uuid/issues/780)) ([031b3d3](https://github.com/uuidjs/uuid/commit/031b3d3d738bc6694501ac0a37152b95ed500989))
26
28
  - refactor v7 internal state and options logic, fixes [#764](https://github.com/uuidjs/uuid/issues/764) ([#779](https://github.com/uuidjs/uuid/issues/779)) ([9dbd1cd](https://github.com/uuidjs/uuid/commit/9dbd1cd4177c43fcaac961a3b16fb2d044c9940a))
27
29
  - remove v4 options default assignment preventing native.randomUUID from being used ([#786](https://github.com/uuidjs/uuid/issues/786)) ([afe6232](https://github.com/uuidjs/uuid/commit/afe62323c4408a824755a39d7b971a8ae06f7199)), closes [#763](https://github.com/uuidjs/uuid/issues/763)
28
- - revert "perf: remove superfluous call to toLowerCase ([#677](https://github.com/uuidjs/uuid/issues/677))" ([#738](https://github.com/uuidjs/uuid/issues/738)) ([e267b90](https://github.com/uuidjs/uuid/commit/e267b9073df1d0ce119ee53c0487fe76acb2be37))
29
30
  - seq_hi shift for byte 6 ([#775](https://github.com/uuidjs/uuid/issues/775)) ([1d532ca](https://github.com/uuidjs/uuid/commit/1d532ca374f181932a24a83fa98f71a5bd4f3e96))
30
31
  - tsconfig module type ([#778](https://github.com/uuidjs/uuid/issues/778)) ([7eff835](https://github.com/uuidjs/uuid/commit/7eff835cba334ad418f57768c00d15b918a9b419))
31
32
 
package/README.md CHANGED
@@ -12,6 +12,7 @@ For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (form
12
12
  - CommonJS, [ECMAScript Modules](#ecmascript-modules)
13
13
  - NodeJS 16+ ([LTS releases](https://github.com/nodejs/Release))
14
14
  - Chrome, Safari, Firefox, Edge browsers
15
+ - [React Native / Expo](#react-native--expo)
15
16
  - **Secure** - Cryptographically-strong random values
16
17
  - **Compact** - No dependencies, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking)
17
18
  - **CLI** - Includes the [`uuid` command line](#command-line) utility
@@ -19,9 +20,10 @@ For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (form
19
20
 
20
21
  <!-- prettier-ignore -->
21
22
  > [!NOTE]
22
- > `uuid@11` has the following breaking changes:
23
- > * Passing `options` to `v1()`, `v6()`, and `v7()` now behaves slightly differently. [See details](#options-handling-for-timestamp-uuids)
24
- > * Binary UUIDs are now of type `Uint8Array`. This may affect code utilizing `parse()`, `stringify()`, or that passes a `buf` argument to any of the `v1()`-`v7()` methods.
23
+ w> `uuid@11` is now available: See the [CHANGELOG](./CHANGELOG.md) for details. TL;DR:
24
+ > * TypeScript support is now included (remove `@types/uuid` from your dependencies)
25
+ > * Subtle changes to how the `options` arg is interpreted for `v1()`, `v6()`, and `v7()`. [See details](#options-handling-for-timestamp-uuids)
26
+ > * Binary UUIDs are now `Uint8Array`s. (May impact callers of `parse()`, `stringify()`, or that pass an `option#buf` argument to `v1()`-`v7()`.)
25
27
 
26
28
  ## Quickstart
27
29
 
@@ -173,11 +175,11 @@ Create an RFC version 1 (timestamp) UUID
173
175
  | | |
174
176
  | --- | --- |
175
177
  | [`options`] | `Object` with one or more of the following properties: |
176
- | [`options.node` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) |
177
- | [`options.clockseq`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff |
178
- | [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
179
- | [`options.nsecs`] | RFC "timestamp" field (`Number` of nanoseconds to add to `msecs`, should be 0-10,000) |
180
- | [`options.random`] | `Array` of 16 random bytes (0-255) |
178
+ | [`options.node = (random)` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) |
179
+ | [`options.clockseq = (random)`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff |
180
+ | [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
181
+ | [`options.nsecs = 0`] | RFC "timestamp" field (`Number` of nanoseconds to add to `msecs`, should be 0-10,000) |
182
+ | [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above |
181
183
  | [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
182
184
  | [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
183
185
  | [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
@@ -362,10 +364,10 @@ Create an RFC version 7 (random) UUID
362
364
  | | |
363
365
  | --- | --- |
364
366
  | [`options`] | `Object` with one or more of the following properties: |
365
- | [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch). Default = `Date.now()` |
366
- | [`options.random`] | `Array` of 16 random bytes (0-255) |
367
+ | [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
368
+ | [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above |
367
369
  | [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
368
- | [`options.seq`] | 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help insure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. |
370
+ | [`options.seq = (random)`] | 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help insure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. |
369
371
  | [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
370
372
  | [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
371
373
  | _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
@@ -473,12 +475,22 @@ defined by RFC9562
473
475
 
474
476
  ## `options` Handling for Timestamp UUIDs
475
477
 
476
- As of `uuid@11`, all timestamp-based UUID APIs (`v1()`, `v6()`, and `v7()`) now operate in two distinct modes:
478
+ Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to insure uniqueness of timestamp-based UUIDs (the `v1()`, `v6()`, and `v7()` methods). Starting with `uuid@11`, this issue has been addressed by using the presence of the `options` argument as a flag to select between two possible behaviors:
479
+
480
+ - Without `options`: Internal state is utilized to improve UUID uniqueness.
481
+ - With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed.
482
+
483
+ ## Known issues
477
484
 
478
- - Without `options`: If no `options` argument is passed, these APIs will make use of internal state such as a sequence counter to improve UUID uniqueness.
479
- - With `options`: If an `options` argument of any kind is passed, no internal state is used or updated. Instead, appropriate defaults are used. See the respective APIs for details.
485
+ ### React Native / Expo
480
486
 
481
- Prior to `uuid@11`, this distinction was less clear. Internal state was was being combined with `options` values in ways that were difficult to rationalize about, and that could lead to unpredictable behavior. Hence, this change.
487
+ 1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
488
+ 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:
489
+
490
+ ```javascript
491
+ import 'react-native-get-random-values';
492
+ import { v4 as uuidv4 } from 'uuid';
493
+ ```
482
494
 
483
495
  ---
484
496
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uuid",
3
- "version": "11.0.0-0",
3
+ "version": "11.0.1",
4
4
  "description": "RFC9562 UUIDs",
5
5
  "type": "module",
6
6
  "funding": [
@@ -40,6 +40,10 @@
40
40
  "./package.json": "./package.json"
41
41
  },
42
42
  "module": "./dist/esm/index.js",
43
+ "browser": {
44
+ "./dist/esm/index.js": "./dist/esm-browser/index.js",
45
+ "./dist/cjs/index.js": "./dist/cjs-browser/index.js"
46
+ },
43
47
  "files": [
44
48
  "CHANGELOG.md",
45
49
  "CONTRIBUTING.md",
@@ -49,41 +53,36 @@
49
53
  "wrapper.mjs"
50
54
  ],
51
55
  "devDependencies": {
52
- "@babel/eslint-parser": "7.24.8",
53
- "@commitlint/cli": "19.3.0",
54
- "@commitlint/config-conventional": "19.2.2",
55
- "@eslint/js": "9.7.0",
56
+ "@babel/eslint-parser": "7.25.9",
57
+ "@commitlint/cli": "19.5.0",
58
+ "@commitlint/config-conventional": "19.5.0",
59
+ "@eslint/js": "9.13.0",
56
60
  "@types/eslint__js": "8.42.3",
57
- "@wdio/browserstack-service": "9.0.9",
58
- "@wdio/cli": "9.0.9",
59
- "@wdio/jasmine-framework": "9.0.9",
60
- "@wdio/local-runner": "9.0.9",
61
- "@wdio/spec-reporter": "9.0.8",
62
- "@wdio/static-server-service": "9.0.8",
63
- "bundlewatch": "0.3.3",
64
- "eslint": "9.7.0",
61
+ "bundlewatch": "0.4.0",
62
+ "eslint": "9.13.0",
65
63
  "eslint-config-prettier": "9.1.0",
66
64
  "eslint-plugin-prettier": "5.2.1",
67
- "globals": "15.8.0",
68
- "husky": "9.1.1",
65
+ "globals": "15.11.0",
66
+ "husky": "9.1.6",
69
67
  "jest": "29.7.0",
70
- "lint-staged": "15.2.7",
71
- "neostandard": "0.11.1",
68
+ "lint-staged": "15.2.10",
69
+ "neostandard": "0.11.7",
72
70
  "npm-run-all": "4.1.5",
73
71
  "optional-dev-dependency": "2.0.1",
74
72
  "prettier": "3.3.3",
73
+ "release-please": "16.14.3",
75
74
  "runmd": "1.3.9",
76
75
  "standard-version": "9.5.0",
77
- "typescript": "5.5.3",
78
- "typescript-eslint": "8.0.0-alpha.30"
76
+ "typescript": "5.6.3",
77
+ "typescript-eslint": "8.11.0"
79
78
  },
80
79
  "optionalDevDependencies": {
81
- "@wdio/browserstack-service": "9.0.9",
82
- "@wdio/cli": "9.0.9",
83
- "@wdio/jasmine-framework": "9.0.9",
84
- "@wdio/local-runner": "9.0.9",
85
- "@wdio/spec-reporter": "9.0.8",
86
- "@wdio/static-server-service": "9.0.8"
80
+ "@wdio/browserstack-service": "9.2.1",
81
+ "@wdio/cli": "9.2.1",
82
+ "@wdio/jasmine-framework": "9.2.1",
83
+ "@wdio/local-runner": "9.2.1",
84
+ "@wdio/spec-reporter": "9.1.3",
85
+ "@wdio/static-server-service": "9.1.3"
87
86
  },
88
87
  "scripts": {
89
88
  "build": "./scripts/build.sh",
@@ -113,8 +112,8 @@
113
112
  "test:browser": "wdio run ./wdio.conf.js",
114
113
  "test:node": "npm-run-all --parallel examples:node:**",
115
114
  "test:pack": "./scripts/testpack.sh",
116
- "test:watch": "node --test --enable-source-maps --watch dist/esm/test",
117
- "test": "node --test --enable-source-maps dist/esm/test"
115
+ "test:watch": "node --test --enable-source-maps --watch dist/esm/test/*.js",
116
+ "test": "node --test --enable-source-maps dist/esm/test/*.js"
118
117
  },
119
118
  "repository": {
120
119
  "type": "git",
@@ -133,5 +132,5 @@
133
132
  "postchangelog": "prettier --write CHANGELOG.md"
134
133
  }
135
134
  },
136
- "packageManager": "npm@10.8.2+sha256.c8c61ba0fa0ab3b5120efd5ba97fdaf0e0b495eef647a97c4413919eda0a878b"
135
+ "packageManager": "npm@10.9.0"
137
136
  }