Skip to content

Commit

Permalink
docs: add changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
LiosK committed Jan 28, 2023
1 parent 46ef537 commit 55ef474
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions CHANGELOG.md
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

0 comments on commit 55ef474

Please sign in to comment.