Skip to content

Commit

Permalink
Add MIGRATING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
GhassenRjab committed Feb 4, 2021
1 parent e7516ba commit 48c8339
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
/babel.config.json
/rollup.config.js
/.gitattributes
/MIGRATING.md
31 changes: 31 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Migration guides

## From v2 to v3

No migrations needed with this version. We just added `rollup` as build tool and added the browser build in our examples.

## From v1 to v2

The first version of `categorize` used `yup` to validate users' input. With this, the library had two ways to categorize arrays:

- a synchronous way using `categorizeSync` function;
- and an asynchronous way using `categorize` function.

With the second version, we removed `yup` library in order to become a zero-dependency library and did the validation manually.

With this change we only have one way to categorize which is the sychronous way. So we removed the `categorizeSync` function and changed the `categorize` function to become a synchronous one.

### Usage from v1

```js
// asynchronous way
const asyncResult = await categorize(animals, categories);
// synchronous way
const syncResult = categorizeSync(animals, categories);
```

### Usage from v2

```js
const result = categorize(animals, categories);
```

0 comments on commit 48c8339

Please sign in to comment.