-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Changelog | ||
|
||
## v5.0.0 - unreleased | ||
|
||
### Breaking changes | ||
|
||
- Migrated to native ES Modules from global variable and CommonJS export | ||
- Added named `UUID` export and removed default export | ||
- Removed `UUID.overwrittenUUID` property (a.k.a. no conflict mode) | ||
- Removed `node:crypto` module-based CSPRNG implementation | ||
- Now requires Web Crypto API to utilize cryptographically secure pseudorandom | ||
number generators | ||
- Changed target ECMAScript version from ES3 to ES2016 | ||
- Removed uuid.core.js and bower.json from repository | ||
- Fixed wrong return type declaration of `UUID.parse()`: `UUID` -> `UUID | null` | ||
- Placed tighter type constraints on `UUID` class members | ||
- Marked constructor() as private | ||
- Marked `UUID.FIELD_NAMES`, `UUID.FIELD_SIZES`, `UUID#intFields`, | ||
`UUID#bitFields`, and `UUID#hexFields` as read-only arrays/objects | ||
|
||
### Dev environment changes | ||
|
||
- Migrated to TypeScript and transpilation from pure JavaScript | ||
- Replaced manually written type declaration with auto-generated .d.ts | ||
- Adopted class declaration syntax | ||
- Applied Prettier style to source code | ||
- Migrated to TypeDoc from JSDoc for API document generation | ||
- Updated dev dependencies | ||
|
||
### Migration notes | ||
|
||
Import the `UUID` class using the ESM syntax: | ||
|
||
```diff | ||
<!-- HTML5 --> | ||
-<script src="https://unpkg.com/uuidjs@^4"></script> | ||
-<script> | ||
+<script type="module"> | ||
+ import { UUID } from "https://unpkg.com/uuidjs@^5"; | ||
const uuid = UUID.generate(); | ||
</script> | ||
``` | ||
|
||
```diff | ||
// Node.js | ||
-const UUID = require("uuidjs"); | ||
+import { UUID } from "uuidjs"; | ||
const uuid = UUID.generate(); | ||
``` | ||
|
||
Call static methods through the `UUID` class, rather than importing them | ||
directly: | ||
|
||
```diff | ||
// Node.js | ||
-const { generate } = require("uuidjs"); | ||
-const uuid = generate(); | ||
+import { UUID } from "uuidjs"; | ||
+const uuid = UUID.generate(); | ||
``` | ||
|
||
Run type checking relating to the following items, as these items have different | ||
type declarations than those in v4: | ||
|
||
- `UUID.parse()` | ||
- `UUID.FIELD_NAMES` | ||
- `UUID.FIELD_SIZES` | ||
- `new UUID()` | ||
- `UUID#intFields` | ||
- `UUID#bitFields` | ||
- `UUID#hexFields` | ||
|
||
## v4.2.13 - 2023-01-09 | ||
|
||
Last version that: | ||
|
||
- Retains ECMAScript 3 compatibility | ||
- Supports Internet Explorer 6 | ||
- Registers `UUID` in global scope | ||
- Exports CommonJS entry point | ||
- Accompanies uuid.core.js variant | ||
- Ships with bower.json | ||
- Uses `node:crypto`-based cryptographically secure pseudorandom number | ||
generator on Node.js |