Skip to content

Commit 7c44ac2

Browse files
committed
docs: add migration-guide.md
1 parent 241eac0 commit 7c44ac2

File tree

2 files changed

+45
-43
lines changed

2 files changed

+45
-43
lines changed

migration-guide.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## Migrating from 2.x.x
2+
3+
**Color renames**. In line with the
4+
[upgrade guide](https://tailwindcss.com/docs/upgrade-guide#removed-color-aliases),
5+
tailwind v3 has mapped `green`, `yellow`, and `purple` to their extended colors.
6+
Additionally,
7+
[gray colors](https://tailwindcss.com/docs/upgrade-guide#renamed-gray-scales) were renamed
8+
in the extended colors to be more specific. Both of these can be resolved by following
9+
tailwind's upgrade guide and optionally re-aliasing the colors in your
10+
`tailwind.config.js`.
11+
12+
Other than checking on any changes caused by color renames in tailwindcss, there are no
13+
breaking changes in v3 of this library, no further changes should be necessary.
14+
15+
New v3 prefixes and classes are being added as we identify use cases. If you do have a
16+
feature that would help your development, please
17+
[open an issue](https://github.com/jaredh159/tailwind-react-native-classnames/issues/new)
18+
and include any libraries / hooks that could help someone in the community put a PR
19+
together.
20+
21+
## Migrating from 1.x.x
22+
23+
**1.** During the rewrite, the package name on npm was changed to `twrnc`. To remove the
24+
old library and install v2, run:
25+
26+
```
27+
npm uninstall tailwind-react-native-classnames
28+
npm install twrnc
29+
```
30+
31+
**2.** Grep through your project replacing `from 'tailwind-react-native-classnames'` with
32+
`from 'twrnc'`.
33+
34+
**3.** If you were using a `tailwind.config.js` you can `git rm` your `tw-rn-styles.json`
35+
file, and switch to passing your config directly to `create` as shown below: (details
36+
[here](#customization))
37+
38+
```js
39+
const tw = create(require(`../../tailwind.config.js`));
40+
```
41+
42+
That's it! 🎉 The core API and functionality should work exactly the same from v1 to v2.

readme.md

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ const MyComponent = () => (
5353
- [RN-Only Additions](#rn-only-additions)
5454
- [JIT-style Arbitrary Values](#jit-style-arbitrary-values)
5555
- [VS Code Intellisense](#vs-code-intellisense)
56-
- [Migrating from V2](#migrating-from-v2)
57-
- [Migrating from V1](#migrating-from-v1)
56+
- [Migrating from previous versions](#migrating-from-previous-versions)
5857
- [Prior Art](#prior-art)
5958

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

456-
## Migrating from V2
455+
## Migrating from Previous Versions
457456

458-
**Color renames**. In line with the
459-
[upgrade guide](https://tailwindcss.com/docs/upgrade-guide#removed-color-aliases),
460-
tailwind v3 has mapped `green`, `yellow`, and `purple` to their extended colors.
461-
Additionally,
462-
[gray colors](https://tailwindcss.com/docs/upgrade-guide#renamed-gray-scales) were renamed
463-
in the extended colors to be more specific. Both of these can be resolved by following
464-
tailwind's upgrade guide and optionally re-aliasing the colors in your
465-
`tailwind.config.js`.
466-
467-
Other than checking on any changes caused by color renames in tailwindcss, there are no
468-
breaking changes in V3 of this library, no further changes should be necessary.
469-
470-
New v3 prefixes and classes are being added as we identify use cases. If you do have a
471-
feature that would help your development, please
472-
[open an issue](https://github.com/jaredh159/tailwind-react-native-classnames/issues/new)
473-
and include any libraries / hooks that could help someone in the community put a PR
474-
together.
475-
476-
## Migrating from V1
477-
478-
**1.** During the rewrite, the package name on npm was changed to `twrnc`. To remove the
479-
old library and install v2, run:
480-
481-
```
482-
npm uninstall tailwind-react-native-classnames
483-
npm install twrnc
484-
```
485-
486-
**2.** Grep through your project replacing `from 'tailwind-react-native-classnames'` with
487-
`from 'twrnc'`.
488-
489-
**3.** If you were using a `tailwind.config.js` you can `git rm` your `tw-rn-styles.json`
490-
file, and switch to passing your config directly to `create` as shown below: (details
491-
[here](#customization))
492-
493-
```js
494-
const tw = create(require(`../../tailwind.config.js`));
495-
```
496-
497-
That's it! 🎉 The core API and functionality should work exactly the same from v1 to v2.
457+
See [migration-guide.md](/migration-guide.md).
498458

499459
## Prior Art
500460

0 commit comments

Comments
 (0)