Skip to content

Commit

Permalink
add migration-guide.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredh159 committed Feb 12, 2024
1 parent 8a5c264 commit 4fa5ba9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 43 deletions.
42 changes: 42 additions & 0 deletions migration-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## Migrating from V2

**Color renames**. In line with the
[upgrade guide](https://tailwindcss.com/docs/upgrade-guide#removed-color-aliases),
tailwind v3 has mapped `green`, `yellow`, and `purple` to their extended colors.
Additionally,
[gray colors](https://tailwindcss.com/docs/upgrade-guide#renamed-gray-scales) were renamed
in the extended colors to be more specific. Both of these can be resolved by following
tailwind's upgrade guide and optionally re-aliasing the colors in your
`tailwind.config.js`.

Other than checking on any changes caused by color renames in tailwindcss, there are no
breaking changes in V3 of this library, no further changes should be necessary.

New v3 prefixes and classes are being added as we identify use cases. If you do have a
feature that would help your development, please
[open an issue](https://github.com/jaredh159/tailwind-react-native-classnames/issues/new)
and include any libraries / hooks that could help someone in the community put a PR
together.

## Migrating from V1

**1.** During the rewrite, the package name on npm was changed to `twrnc`. To remove the
old library and install v2, run:

```
npm uninstall tailwind-react-native-classnames
npm install twrnc
```

**2.** Grep through your project replacing `from 'tailwind-react-native-classnames'` with
`from 'twrnc'`.

**3.** If you were using a `tailwind.config.js` you can `git rm` your `tw-rn-styles.json`
file, and switch to passing your config directly to `create` as shown below: (details
[here](#customization))

```js
const tw = create(require(`../../tailwind.config.js`));
```

That's it! 🎉 The core API and functionality should work exactly the same from v1 to v2.
46 changes: 3 additions & 43 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ const MyComponent = () => (
- [RN-Only Additions](#rn-only-additions)
- [JIT-style Arbitrary Values](#jit-style-arbitrary-values)
- [VS Code Intellisense](#vs-code-intellisense)
- [Migrating from V2](#migrating-from-v2)
- [Migrating from V1](#migrating-from-v1)
- [Migrating from previous versions](#migrating-from-previous-versions)
- [Prior Art](#prior-art)

## Installation
Expand Down Expand Up @@ -453,48 +452,9 @@ for VS Code.
More detailed instructions, including how to add snippets, are available
[here](https://github.com/jaredh159/tailwind-react-native-classnames/discussions/124).

## Migrating from V2
## Migrating from Previous Versions

**Color renames**. In line with the
[upgrade guide](https://tailwindcss.com/docs/upgrade-guide#removed-color-aliases),
tailwind v3 has mapped `green`, `yellow`, and `purple` to their extended colors.
Additionally,
[gray colors](https://tailwindcss.com/docs/upgrade-guide#renamed-gray-scales) were renamed
in the extended colors to be more specific. Both of these can be resolved by following
tailwind's upgrade guide and optionally re-aliasing the colors in your
`tailwind.config.js`.

Other than checking on any changes caused by color renames in tailwindcss, there are no
breaking changes in V3 of this library, no further changes should be necessary.

New v3 prefixes and classes are being added as we identify use cases. If you do have a
feature that would help your development, please
[open an issue](https://github.com/jaredh159/tailwind-react-native-classnames/issues/new)
and include any libraries / hooks that could help someone in the community put a PR
together.

## Migrating from V1

**1.** During the rewrite, the package name on npm was changed to `twrnc`. To remove the
old library and install v2, run:

```
npm uninstall tailwind-react-native-classnames
npm install twrnc
```

**2.** Grep through your project replacing `from 'tailwind-react-native-classnames'` with
`from 'twrnc'`.

**3.** If you were using a `tailwind.config.js` you can `git rm` your `tw-rn-styles.json`
file, and switch to passing your config directly to `create` as shown below: (details
[here](#customization))

```js
const tw = create(require(`../../tailwind.config.js`));
```

That's it! 🎉 The core API and functionality should work exactly the same from v1 to v2.
See [migration-guide.md](/migration-guide.md).

## Prior Art

Expand Down

0 comments on commit 4fa5ba9

Please sign in to comment.