Skip to content

Commit 0d7655e

Browse files
authored
docs: Add @rest-hooks/legacy directions (#929)
1 parent d291970 commit 0d7655e

File tree

7 files changed

+118
-2
lines changed

7 files changed

+118
-2
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Upgrading @rest-hooks/test to 6
3+
---
4+
5+
`@rest-hooks/test` uses `react-hooks-testing-library` internally. Version 7
6+
has a major version upgrade for this library, so the following [breaking changes](https://github.com/testing-library/react-hooks-testing-library/releases/tag/v7.0.0
7+
)
8+
also apply to `@rest-hooks/test@6`
9+
10+
- 'suppressErrorOutput will now work when explicitly called, even if the
11+
RHTL_DISABLE_ERROR_FILTERING env variable has been set' (from
12+
react-hooks-testing-library)
13+
- requires node 12 or above
14+
15+
16+
`@rest-hooks/test@6` [Release notes](https://github.com/coinbase/rest-hooks/releases/tag/%40rest-hooks%2Ftest%406.0.0)

docs/upgrade/upgrading-to-5.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,43 @@ class MyResource extends Resource {
362362

363363
</details>
364364

365+
### @rest-hooks/legacy
366+
367+
For v5 of Rest Hooks, the existing `Resource` and `SimpleResource` classes will
368+
be exported.
369+
370+
In v6, this will no longer be the case. However, they will continue to live in `@rest-hooks/legacy`, allowing
371+
easy safe upgrade to v6 by simply changing the import path. However, it is still recommended to
372+
try to migrate to `@rest-hooks/rest` as this is the future. v1 of @rest-hooks/rest will be the easiest to
373+
start with.
374+
375+
376+
<details><summary>yarn add @rest-hooks/legacy</summary>
377+
378+
379+
<!--DOCUSAURUS_CODE_TABS-->
380+
<!--before-->
381+
382+
```typescript
383+
import { Resource } from 'rest-hooks';
384+
385+
class MyResource extends Resource {
386+
}
387+
```
388+
389+
<!--after-->
390+
391+
```typescript
392+
import { Resource } from '@rest-hooks/legacy';
393+
394+
class MyResource extends Resource {
395+
}
396+
```
397+
398+
<!--END_DOCUSAURUS_CODE_TABS-->
399+
400+
</details>
401+
365402
### @rest-hooks/rest
366403

367404
Rest Hooks is protocol agnostic, so the REST/CRUD specific class [Resource](../api/resource)

website/i18n/en.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@
253253
"upgrade/upgrading-test-to-four": {
254254
"title": "Upgrading @rest-hooks/test to 4"
255255
},
256+
"upgrade/upgrading-test-to-six": {
257+
"title": "Upgrading @rest-hooks/test to 6"
258+
},
256259
"upgrade/upgrading-test-to-three": {
257260
"title": "Upgrading @rest-hooks/test to 3"
258261
},
@@ -1081,6 +1084,9 @@
10811084
"version-5.0/upgrade/version-5.0-upgrading-test-to-four": {
10821085
"title": "Upgrading @rest-hooks/test to 4"
10831086
},
1087+
"version-5.0/upgrade/version-5.0-upgrading-test-to-six": {
1088+
"title": "Upgrading @rest-hooks/test to 6"
1089+
},
10841090
"version-5.0/upgrade/version-5.0-upgrading-test-to-three": {
10851091
"title": "Upgrading @rest-hooks/test to 3"
10861092
},

website/sidebars.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@
163163
"Upgrade Guide": [
164164
"upgrade/upgrading-to-5",
165165
"upgrade/upgrading-test-to-three",
166-
"upgrade/upgrading-test-to-four"
166+
"upgrade/upgrading-test-to-four",
167+
"upgrade/upgrading-test-to-six"
167168
]
168169
}
169170
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Upgrading @rest-hooks/test to 6
3+
id: version-5.0-upgrading-test-to-six
4+
original_id: upgrading-test-to-six
5+
---
6+
7+
`@rest-hooks/test` uses `react-hooks-testing-library` internally. Version 7
8+
has a major version upgrade for this library, so the following [breaking changes](https://github.com/testing-library/react-hooks-testing-library/releases/tag/v7.0.0
9+
)
10+
also apply to `@rest-hooks/test@6`
11+
12+
- 'suppressErrorOutput will now work when explicitly called, even if the
13+
RHTL_DISABLE_ERROR_FILTERING env variable has been set' (from
14+
react-hooks-testing-library)
15+
- requires node 12 or above
16+
17+
18+
`@rest-hooks/test@6` [Release notes](https://github.com/coinbase/rest-hooks/releases/tag/%40rest-hooks%2Ftest%406.0.0)

website/versioned_docs/version-5.0/upgrade/upgrading-to-5.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,43 @@ class MyResource extends Resource {
364364

365365
</details>
366366

367+
### @rest-hooks/legacy
368+
369+
For v5 of Rest Hooks, the existing `Resource` and `SimpleResource` classes will
370+
be exported.
371+
372+
In v6, this will no longer be the case. However, they will continue to live in `@rest-hooks/legacy`, allowing
373+
easy safe upgrade to v6 by simply changing the import path. However, it is still recommended to
374+
try to migrate to `@rest-hooks/rest` as this is the future. v1 of @rest-hooks/rest will be the easiest to
375+
start with.
376+
377+
378+
<details><summary>yarn add @rest-hooks/legacy</summary>
379+
380+
381+
<!--DOCUSAURUS_CODE_TABS-->
382+
<!--before-->
383+
384+
```typescript
385+
import { Resource } from 'rest-hooks';
386+
387+
class MyResource extends Resource {
388+
}
389+
```
390+
391+
<!--after-->
392+
393+
```typescript
394+
import { Resource } from '@rest-hooks/legacy';
395+
396+
class MyResource extends Resource {
397+
}
398+
```
399+
400+
<!--END_DOCUSAURUS_CODE_TABS-->
401+
402+
</details>
403+
367404
### @rest-hooks/rest
368405

369406
Rest Hooks is protocol agnostic, so the REST/CRUD specific class [Resource](../api/resource)

website/versioned_sidebars/version-5.0-sidebars.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@
179179
"Upgrade Guide": [
180180
"version-5.0-upgrade/upgrading-to-5",
181181
"version-5.0-upgrade/upgrading-test-to-three",
182-
"version-5.0-upgrade/upgrading-test-to-four"
182+
"version-5.0-upgrade/upgrading-test-to-four",
183+
"version-5.0-upgrade/upgrading-test-to-six"
183184
]
184185
}
185186
}

0 commit comments

Comments
 (0)