From b43377287234b13acf3966413a9170cbd5d8b4bc Mon Sep 17 00:00:00 2001 From: Christoph Tavan Date: Thu, 20 Feb 2020 11:47:38 +0100 Subject: [PATCH] docs: add note about removal of default export 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 5f34900d..1c390b66 100644 --- a/README.md +++ b/README.md @@ -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(); ``` @@ -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 diff --git a/README_js.md b/README_js.md index 6c1b55f2..ea0f71ab 100644 --- a/README_js.md +++ b/README_js.md @@ -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(); ``` @@ -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