Skip to content

Commit 2314296

Browse files
authored
Merge pull request #224 from hiro08gh/update-docs-advanced-feautres-codemods-md
Chore: advanced/features/codemods.mdの差分追従
2 parents 11c8c05 + d8e3b07 commit 2314296

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

docs/advanced-features/codemods.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ Codemods are transformations that run on your codebase programmatically. This al
1717
- `--dry` Do a dry-run, no code will be edited
1818
- `--print` Prints the changed output for comparison
1919

20+
## Next.js 11
21+
22+
### `cra-to-next` (experimental)
23+
24+
Migrates a Create React App project to Next.js; creating a pages directory and necessary config to match behavior. Client-side only rendering is leveraged initially to prevent breaking compatibility due to `window` usage during SSR and can be enabled seamlessly to allow gradual adoption of Next.js specific features.
25+
26+
Please share any feedback related to this transform [in this discussion](https://github.com/vercel/next.js/discussions/25858).
27+
2028
## Next.js 10
2129

2230
### `add-missing-react-import`
@@ -132,7 +140,7 @@ npx @next/codemod withamp-to-config
132140

133141
### `url-to-withrouter`
134142

135-
Transforms the deprecated automatically injected `url` property on top level pages to using `withRouter` and the `router` property it injects. Read more here: [err.sh/next.js/url-deprecated](https://err.sh/next.js/url-deprecated)
143+
Transforms the deprecated automatically injected `url` property on top level pages to using `withRouter` and the `router` property it injects. Read more here: [https://nextjs.org/docs/messages/url-deprecated](https://nextjs.org/docs/messages/url-deprecated)
136144

137145
For example:
138146

@@ -161,7 +169,7 @@ export default withRouter(
161169
)
162170
```
163171

164-
This is just one case. All the cases that are transformed (and tested) can be found in the [`__testfixtures__` directory](https://github.com/vercel/next.js/tree/canary/packages/next-codemod/transforms/__testfixtures__/url-to-withrouter).
172+
This is one case. All the cases that are transformed (and tested) can be found in the [`__testfixtures__` directory](https://github.com/vercel/next.js/tree/canary/packages/next-codemod/transforms/__testfixtures__/url-to-withrouter).
165173

166174
#### Usage
167175

@@ -175,4 +183,4 @@ Run the codemod:
175183

176184
```
177185
npx @next/codemod url-to-withrouter
178-
```
186+
```

0 commit comments

Comments
 (0)