Skip to content

Commit a543580

Browse files
Revise README for MSW v2 migration details
1 parent bc719a6 commit a543580

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

codemods/v2/README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
# @codemod/msw-v2
2-
31
This codemod migrates your project from MSW v1 to v2, handling the breaking changes:
42

5-
1- Updates import statements to new locations and names
6-
2- Fixes generic type arguments order
7-
3- Modernizes request object usage patterns
8-
4- Replaces `ctx.fetch()` with new `fetch(bypass())` pattern
9-
5- Updates passthrough method calls
10-
6- Converts response patterns to new `HttpResponse` API
11-
7- Updates handler callback signatures
12-
8- Modernizes event callback signatures
13-
9- Replaces deprecated handler printing methods
14-
3+
1. Updates import statements to new locations and names
4+
2. Fixes generic type arguments order
5+
3. Modernizes request object usage patterns
6+
4. Replaces `ctx.fetch()` with new `fetch(bypass())` pattern
7+
5. Updates passthrough method calls
8+
6. Converts response patterns to new `HttpResponse` API
9+
7. Updates handler callback signatures
10+
8. Modernizes event callback signatures
11+
9. Replaces deprecated handler printing methods
1512

16-
## Important Notes
13+
### Important Notes
1714

1815
⚠️ **Custom Factory Functions**: This codemod does not change signatures of MSW handlers when called through custom factory functions. You'll need to update these manually.
1916

@@ -22,10 +19,10 @@ This codemod migrates your project from MSW v1 to v2, handling the breaking chan
2219
⚠️ **Complete Migration**: This codemod performs all necessary transformations in the correct order to ensure your code properly migrates to MSW v2.
2320

2421

25-
## Resources
22+
### Resources
2623

2724
- [MSW v2 Migration Guide](https://mswjs.io/docs/migrations/1.x-to-2.x)
2825

29-
## License
26+
### License
3027

3128
MIT

0 commit comments

Comments
 (0)