This repository has been archived by the owner on Nov 5, 2020. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.0.3
->3.1.16
Release Notes
ai/nanoid
v3.1.16
Compare Source
v3.1.15
Compare Source
package.types
path.v3.1.14
Compare Source
package.types
.v3.1.13
Compare Source
randomFillSync
regression fromengines.node
.v3.1.12
Compare Source
v3.1.11
Compare Source
customAlphabet
in browser (by @LoneRifle).v3.1.10
Compare Source
v3.1.9
Compare Source
v3.1.8
Compare Source
v3.1.7
Compare Source
v3.1.6
Compare Source
self
using.v3.1.5
Compare Source
v3.1.4
engines.node
(by Cansin Yildiz).v3.1.3
v3.1.2
Compare Source
v3.1.1
Compare Source
v3.1.0
Compare Source
v3.0.2
Compare Source
v3.0.1
Compare Source
non-secure
import (by Jia Huang).v3.0.0
Compare Source
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
Simple Case
In simple cases, you just need to change default import to named import.
If you support IE, you need to transpile
node_modules
by Babel.Non-secure and asynchronous Nano ID need only import changes as well.
TypeScript
Remove
@types/nanoid
if you have it. Nano ID now have built-in types.React Native
For Expo you need to load the file by direct path:
For the non-Expo environment:
Change polyfill for hardware random generator from
expo-random
toreact-native-get-random-values
.Use sync Nano ID instead of async.
URL-Safe Alphabet
Our default URL-safe alphabet was moved as named export to
nanoid
path:Custom Alphabet
Now we use the currying API to change the alphabet. It improves performance by pre-calculating some caches for a new alphabet.
We hope the new API will be more readable compare to the old unclear “generate” word.
Non-secure and asynchronous APIs were also changed:
Custom Random Generator
Custom random generator API now is based on currying as well.
We removed a custom random generator from asynchronous API because we didn’t see that somebody used it.
New Features
A few good reasons, why you should migrate to Nano ID 3.0:
.d.ts
files.v2.1.11
Compare Source
v2.1.10
Compare Source
v2.1.9
Compare Source
format
andasync/format
size (by Dair Aidarkhanov).v2.1.8
Compare Source
v2.1.7
Compare Source
index
,async
andnon-secure
size (by @polemius).v2.1.6
Compare Source
v2.1.5
Compare Source
v2.1.4
Compare Source
generate
size (by Vsevolod Rodionov).format
andformat
size (by Victor).async
,non-secure
andnon-secure/generate
size.format
andasync/format
(by Max Graey).v2.1.3
Compare Source
v2.1.2
Compare Source
v2.1.1
Compare Source
v2.1.0
Compare Source
v2.0.4
Compare Source
Renovate configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.