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

build(deps): bump nanoid from 2.0.3 to 3.1.10 #288

Merged
merged 2 commits into from
Jul 27, 2020

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jul 21, 2020

Bumps nanoid from 2.0.3 to 3.1.10.

Release notes

Sourced from nanoid's releases.

3.0 Migration Guide

Nano ID 3.0 is the biggest release in the project history. Unfortunately, you will need to change the code of your application. But the changes are very small in most cases. In return, you will have better performance, smaller size, ES modules and TypeScript support.

Known Issues

  • Create React App needs to merge this pull request to fix dual ESM/CJS packages. Do not migrate to 3.0 if you use CRA with TypeScript.

Simple Case

In simple cases, you just need to change default import to named import.

- import nanoid from 'nanoid'
+ import { nanoid } from 'nanoid'
nanoid() //=> "sSAi9F8yakJZPxOCr_WFb"
nanoid(5) //=> "ISe9l"

If you support IE, you need to transpile node_modules by Babel.

Non-secure and asynchronous Nano ID need only import changes as well.

- import nanoid from 'nanoid/non-secure'
+ import { nanoid } from 'nanoid/non-secure'
nanoid() //=> "sSAi9F8yakJZPxOCr_WFb"

- import nanoid from 'nanoid/async'
+ import { nanoid } from 'nanoid/async'
nanoid().then(id => {
id //=> "sSAi9F8yakJZPxOCr_WFb"
})

TypeScript

Remove @types/nanoid if you have it. Nano ID now have built-in types.

npm uninstall @types/nanoid

React Native

For Expo you need to load the file by direct path:

Changelog

Sourced from nanoid's changelog.

3.1.10

  • Fix ES modules support.

3.1.9

  • Try to fix React Native Expo support.

3.1.8

  • Add React Native Expo support.

3.1.7

  • Clean up code.

3.1.6

  • Avoid self using.

3.1.5

  • Improve IE docs and warning.

3.1.4

  • Restrict old Node.js 13 by engines.node (by Cansin Yildiz).

3.1.3

  • Fix ES modules issue with CLI.

3.1.2

  • Add shebang to CLI.

3.1.1

  • Fix CLI.

3.1

  • Add npx nanoid CLI.

3.0.2

  • Fix docs (by Dylan Irlbeck ).

3.0.1

  • Fix React Native warning on non-secure import (by Jia Huang).

3.0

Migration guide: https://github.com/ai/nanoid/releases/tag/3.0.0

  • Move to ES2016 syntax. You need to use Babel for IE 11.
  • Move to named exports import { nanoid } from 'nanoid'.
  • Move import url from 'nanoid/url' to import { urlAlphabet } from 'nanoid'.
  • Replace format() to customRandom().
  • Replace generate() to customAlphabet().
  • Remove async/format.
  • Remove React Native support for nanoid/async.
  • Add nanoid.js to use directly in browser from CDN.
  • Add TypeScript type definitions.
Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jul 21, 2020
@LoneRifle
Copy link
Contributor

@dependabot rebase

@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/nanoid-3.1.10 branch from 673f722 to efce4f8 Compare July 22, 2020 10:09
dependabot bot and others added 2 commits July 24, 2020 01:26
Bumps [nanoid](https://github.com/ai/nanoid) from 2.0.3 to 3.1.10.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/master/CHANGELOG.md)
- [Commits](ai/nanoid@2.0.3...3.1.10)

Also removes @types/nanoid, no longer needed

Signed-off-by: dependabot[bot] <support@github.com>
Replace `generate()` in v2 with `customAlphabet()` in v3,
so that we can more easily adopt future versions of nanoid

- map `generateShortUrl` directly to `customAlphabet()`
- ai/nanoid#228 suggests that `customAlphabet()` is not async, so
  make `generateShortUrl()` synchronous, and change CreateLinkForm
  to account for this

This is a follow-up commit for dependabot
@LoneRifle LoneRifle force-pushed the dependabot/npm_and_yarn/nanoid-3.1.10 branch from efce4f8 to 1aa425d Compare July 24, 2020 02:12
@LoneRifle
Copy link
Contributor

I had to rejig how we use nanoid, so if someone could exercise the generation of random short urls that would be helpful

Copy link
Contributor

@liangyuanruo liangyuanruo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, please test locally before merging

@LoneRifle LoneRifle merged commit d92f50a into develop Jul 27, 2020
@LoneRifle LoneRifle deleted the dependabot/npm_and_yarn/nanoid-3.1.10 branch July 27, 2020 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants