Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove deep requires #426

Merged
merged 2 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,33 @@ import { v4 as uuidv4 } from 'uuid';
Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if
you find one, please).

## Upgrading From uuid\@7

### Only Named Exports Supported When Using with Node.js ESM

uuid\@7 did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in
Node.js ESM consequently imported the CommonJS source with a default export. This library now comes
with true Node.js ESM support and only provides named exports.

Instead of doing:

```javascript
import uuid from 'uuid';
uuid.v4();
```

you will now have to use the named exports:

```javascript
import { v4 as uuidv4 } from 'uuid';
uuidv4();
```

### Deep Requires No Longer Supported

Deep requires like `require('uuid/v4')` [which have been deprecated in
uuid\@7](#deep-requires-now-deprecated) are no longer supported.

## Upgrading From uuid\@3

"_Wait... what happened to uuid\@4 - uuid\@6?!?_"
Expand Down
27 changes: 27 additions & 0 deletions README_js.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,33 @@ import { v4 as uuidv4 } from 'uuid';
Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if
you find one, please).

## Upgrading From uuid\@7

### Only Named Exports Supported When Using with Node.js ESM

uuid\@7 did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in
Node.js ESM consequently imported the CommonJS source with a default export. This library now comes
with true Node.js ESM support and only provides named exports.

Instead of doing:

```javascript
import uuid from 'uuid';
uuid.v4();
```

you will now have to use the named exports:

```javascript
import { v4 as uuidv4 } from 'uuid';
uuidv4();
```

### Deep Requires No Longer Supported

Deep requires like `require('uuid/v4')` [which have been deprecated in
uuid\@7](#deep-requires-now-deprecated) are no longer supported.

## Upgrading From uuid\@3

"_Wait... what happened to uuid\@4 - uuid\@6?!?_"
Expand Down
20 changes: 0 additions & 20 deletions deprecate.js

This file was deleted.

5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@
"CONTRIBUTING.md",
"LICENSE.md",
"README.md",
"deprecate.js",
"dist",
"v1.js",
"v3.js",
"v4.js",
"v5.js",
"wrapper.mjs"
],
"devDependencies": {
Expand Down
35 changes: 0 additions & 35 deletions test/unit/deep-require-deprecation.test.js

This file was deleted.

8 changes: 0 additions & 8 deletions v1.js

This file was deleted.

8 changes: 0 additions & 8 deletions v3.js

This file was deleted.

8 changes: 0 additions & 8 deletions v4.js

This file was deleted.

8 changes: 0 additions & 8 deletions v5.js

This file was deleted.