From 12749b700eb49db8a9759fd306d8be05dbfbd58c Mon Sep 17 00:00:00 2001 From: Christoph Tavan Date: Fri, 21 Feb 2020 11:29:27 +0100 Subject: [PATCH] docs: add note about removal of default export (#372) 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 --- README.md | 14 +++++++++++++- README_js.md | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ee32195..2fa2dd62 100644 --- a/README.md +++ b/README.md @@ -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(); ``` @@ -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 diff --git a/README_js.md b/README_js.md index f3724b88..e9b7a2cf 100644 --- a/README_js.md +++ b/README_js.md @@ -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(); ``` @@ -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