Skip to content

Commit dbfb228

Browse files
committed
docs: updates to upgrade guide entry
1 parent 5f184c0 commit dbfb228

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed

www/content/docs/pages.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export async function getStaticProps() {
258258

259259
---
260260

261-
## Dynamic pages
261+
### Dynamic pages
262262

263263
You can use Next.js [dynamic route](https://nextjs.org/docs/basic-features/pages#pages-with-dynamic-routes) to build static pages for Drupal entity types.
264264

www/content/docs/upgrade-guide.mdx

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Upgrade Guide
3-
excerpt: Guide for upgrading your site to use DrupalClient.
3+
excerpt: Upgrading your site to use the latest version of Next.js for Drupal.
44
---
55

66
## next-drupal 2.0.0
@@ -17,7 +17,37 @@ yarn add next-drupal@latest
1717

1818
</Callout>
1919

20-
TODO - Outline breaking changes here.
20+
Breaking changes:
21+
22+
- When Drupal uses the Preview Url and the Revalidate Url, the "slug" search param
23+
has been renamed to "path".
24+
- The JsonApiWithAuthOptions type has been renamed to JsonApiWithAuthOption. The
25+
JsonApiWithLocaleOptions type is now considered deprecated for DrupalClient
26+
usage and can be replaced with the JsonApiOptions type.
27+
- The forceIframeSameSiteCookie option to DrupalClient has been removed. The
28+
DrupalClient now automatically makes this change when the Next.js website is
29+
running in development mode (and the change is not needed for production sites).
30+
- The options to the DrupalClient.preview() method were previously ignored. The
31+
options are now passed to the NextApiResponse.setDraftMode() method and their
32+
TypeScript definition have now changed to match the options parameter of the
33+
setDraftMode method.
34+
- DrupalClient previously had a debug property that indicated if debugging was
35+
enabled. This property has been removed and replaced with a debug() method that
36+
accepts a string and logs it as a debug message if debugging is enabled.
37+
- The useMenu() client hook has moved out of the main entry point and into its own
38+
entry point. Any import or require of that function needs to be updated:
39+
40+
Old usage:
41+
42+
```js
43+
import { useMenu } from "next-drupal"
44+
```
45+
46+
New usage:
47+
48+
```js
49+
import { useMenu } from "next-drupal/navigation"
50+
```
2151

2252
## next 2.0.0
2353

@@ -35,7 +65,11 @@ drush updb
3565

3666
<Callout>
3767

38-
TODO - Describe changes as that will occur as a result of this upgrade.
68+
Notable changes:
69+
70+
- A new 'tag' On-demand validation plugin is available to configure for use with Next.js entity types.
71+
- When Drupal uses the Preview Url and the Revalidate Url, the "slug" search param
72+
has been renamed to "path".
3973

4074
</Callout>
4175

@@ -199,3 +233,7 @@ export const drupal = new DrupalClient(
199233
6. Done. You are now ready to run your site using the new `DrupalClient`.
200234

201235
If you see any bugs during the upgrade, feel free to create an issue on [GitHub](https://github.com/chapter-three/next-drupal).
236+
237+
```
238+
239+
```

0 commit comments

Comments
 (0)