Skip to content

Commit

Permalink
docs: add note about removal of default export (#372)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The default export, which used to be the v4() method
but which was already discouraged in v3.x of this library, has been
removed.

Fixes #370
  • Loading branch information
ctavan authored Feb 21, 2020
1 parent dd442e6 commit 12749b7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ decided to jump v4.x, v5.x and v6.x in order to avoid any confusion with [versio
4](#version-4-random) and [version 5](#version-5-namespace) UUIDs and the [version 6 UUID
proposal](http://gh.peabody.io/uuidv6/).

### Deep Requires now Deprecated

In v3.x of this library we were promoting the use of deep requires to reduce bundlesize for browser
builds:

```javascript
const uuidv4 = require('uuid/v4');
const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED!
uuidv4();
```

Expand All @@ -51,6 +53,16 @@ const { v4: uuidv4 } = require('uuid');
uuidv4();
```

### Default Export Removed

v3.x of this library was exporting the Version 4 UUID method as a default export:

```javascript
const uuid = require('uuid'); // <== REMOVED!
```

This usage pattern was already discouraged in v3.x and has been removed in v7.x.

## Quickstart - Node.js/CommonJS

```shell
Expand Down
14 changes: 13 additions & 1 deletion README_js.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ decided to jump v4.x, v5.x and v6.x in order to avoid any confusion with [versio
4](#version-4-random) and [version 5](#version-5-namespace) UUIDs and the [version 6 UUID
proposal](http://gh.peabody.io/uuidv6/).

### Deep Requires now Deprecated

In v3.x of this library we were promoting the use of deep requires to reduce bundlesize for browser
builds:

```javascript
const uuidv4 = require('uuid/v4');
const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED!
uuidv4();
```

Expand All @@ -64,6 +66,16 @@ const { v4: uuidv4 } = require('uuid');
uuidv4();
```

### Default Export Removed

v3.x of this library was exporting the Version 4 UUID method as a default export:

```javascript
const uuid = require('uuid'); // <== REMOVED!
```

This usage pattern was already discouraged in v3.x and has been removed in v7.x.

## Quickstart - Node.js/CommonJS

```shell
Expand Down

0 comments on commit 12749b7

Please sign in to comment.