Skip to content

Commit

Permalink
docs: add note about removal of default export
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 committed Feb 20, 2020
1 parent 7fedc79 commit b433772
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
14 changes: 13 additions & 1 deletion README.md
Expand Up @@ -19,11 +19,13 @@ of the current stable version](https://github.com/uuidjs/uuid/blob/v3.4.0/README

## Upgrading from v3.x of this Module

### 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 @@ -46,6 +48,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
Expand Up @@ -32,11 +32,13 @@ of the current stable version](https://github.com/uuidjs/uuid/blob/v3.4.0/README

## Upgrading from v3.x of this Module

### 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 @@ -59,6 +61,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 b433772

Please sign in to comment.