Skip to content

Commit 91805f6

Browse files
authored
README verbiage for Googlebot (#560)
* chore: discuss googlebot case in readma, fixes #546 * chore: fix doc regression * chore: reword README * chore: fixup README
1 parent 7feb2c3 commit 91805f6

File tree

2 files changed

+40
-22
lines changed

2 files changed

+40
-22
lines changed

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs
1717
- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers
1818
- **CLI** - Includes the [`uuid` command line](#command-line) utility
1919

20-
**Upgrading from `uuid@3.x`?** Your code is probably okay, but check out [Upgrading From `uuid@3.x`](#upgrading-from-uuid3x) for details.
20+
**Upgrading from `uuid@3`?** Your code is probably okay, but check out [Upgrading From `uuid@3`](#upgrading-from-uuid3x) for details.
2121

2222
## Quickstart
2323

@@ -418,7 +418,16 @@ These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) metho
418418

419419
Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively.
420420

421-
## "getRandomValues() not supported"
421+
## Known issues
422+
423+
### Duplicate UUIDs (Googlebot)
424+
425+
This module may generate duplicate UUIDs when run in clients with _deterministic_ random number generators, such as [Googlebot crawlers](https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers). This can cause problems for apps that expect client-generated UUIDs to always be unique. Developers should be prepared for this and have a strategy for dealing with possible collisions, such as:
426+
427+
- Check for duplicate UUIDs, fail gracefully
428+
- Disable write operations for Googlebot clients
429+
430+
### "getRandomValues() not supported"
422431

423432
This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill:
424433

@@ -438,11 +447,11 @@ Note: If you are using Expo, you must be using at least `react-native-get-random
438447

439448
[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please).
440449

441-
## Upgrading From `uuid@7.x`
450+
## Upgrading From `uuid@7`
442451

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

445-
`uuid@7.x` 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.
454+
`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.
446455

447456
Instead of doing:
448457

@@ -460,24 +469,24 @@ uuidv4();
460469

461470
### Deep Requires No Longer Supported
462471

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

465-
## Upgrading From `uuid@3.x`
474+
## Upgrading From `uuid@3`
466475

467-
"_Wait... what happened to `uuid@4.x` - `uuid@6.x`?!?_"
476+
"_Wait... what happened to `uuid@4` thru `uuid@6`?!?_"
468477

469478
In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped.
470479

471480
### Deep Requires Now Deprecated
472481

473-
`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds:
482+
`uuid@3` encouraged the use of deep requires to minimize the bundle size of browser builds:
474483

475484
```javascript
476485
const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED!
477486
uuidv4();
478487
```
479488

480-
As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
489+
As of `uuid@7` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
481490

482491
```javascript
483492
import { v4 as uuidv4 } from 'uuid';
@@ -493,13 +502,13 @@ uuidv4();
493502

494503
### Default Export Removed
495504

496-
`uuid@3.x` was exporting the Version 4 UUID method as a default export:
505+
`uuid@3` was exporting the Version 4 UUID method as a default export:
497506

498507
```javascript
499508
const uuid = require('uuid'); // <== REMOVED!
500509
```
501510

502-
This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`.
511+
This usage pattern was already discouraged in `uuid@3` and has been removed in `uuid@7`.
503512

504513
----
505514
Markdown generated from [README_js.md](README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd)

README_js.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs
2929
- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers
3030
- **CLI** - Includes the [`uuid` command line](#command-line) utility
3131

32-
**Upgrading from `uuid@3.x`?** Your code is probably okay, but check out [Upgrading From `uuid@3.x`](#upgrading-from-uuid3x) for details.
32+
**Upgrading from `uuid@3`?** Your code is probably okay, but check out [Upgrading From `uuid@3`](#upgrading-from-uuid3x) for details.
3333

3434
## Quickstart
3535

@@ -424,7 +424,16 @@ These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) metho
424424

425425
Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively.
426426

427-
## "getRandomValues() not supported"
427+
## Known issues
428+
429+
### Duplicate UUIDs (Googlebot)
430+
431+
This module may generate duplicate UUIDs when run in clients with _deterministic_ random number generators, such as [Googlebot crawlers](https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers). This can cause problems for apps that expect client-generated UUIDs to always be unique. Developers should be prepared for this and have a strategy for dealing with possible collisions, such as:
432+
433+
- Check for duplicate UUIDs, fail gracefully
434+
- Disable write operations for Googlebot clients
435+
436+
### "getRandomValues() not supported"
428437

429438
This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill:
430439

@@ -444,11 +453,11 @@ Note: If you are using Expo, you must be using at least `react-native-get-random
444453

445454
[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please).
446455

447-
## Upgrading From `uuid@7.x`
456+
## Upgrading From `uuid@7`
448457

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

451-
`uuid@7.x` 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.
460+
`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.
452461

453462
Instead of doing:
454463

@@ -466,24 +475,24 @@ uuidv4();
466475

467476
### Deep Requires No Longer Supported
468477

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

471-
## Upgrading From `uuid@3.x`
480+
## Upgrading From `uuid@3`
472481

473-
"_Wait... what happened to `uuid@4.x` - `uuid@6.x`?!?_"
482+
"_Wait... what happened to `uuid@4` thru `uuid@6`?!?_"
474483

475484
In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped.
476485

477486
### Deep Requires Now Deprecated
478487

479-
`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds:
488+
`uuid@3` encouraged the use of deep requires to minimize the bundle size of browser builds:
480489

481490
```javascript
482491
const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED!
483492
uuidv4();
484493
```
485494

486-
As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
495+
As of `uuid@7` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
487496

488497
```javascript
489498
import { v4 as uuidv4 } from 'uuid';
@@ -499,10 +508,10 @@ uuidv4();
499508

500509
### Default Export Removed
501510

502-
`uuid@3.x` was exporting the Version 4 UUID method as a default export:
511+
`uuid@3` was exporting the Version 4 UUID method as a default export:
503512

504513
```javascript
505514
const uuid = require('uuid'); // <== REMOVED!
506515
```
507516

508-
This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`.
517+
This usage pattern was already discouraged in `uuid@3` and has been removed in `uuid@7`.

0 commit comments

Comments
 (0)