Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Next.js draft mode #502

Closed
JohnAlbin opened this issue May 30, 2023 · 3 comments
Closed

Support for Next.js draft mode #502

JohnAlbin opened this issue May 30, 2023 · 3 comments

Comments

@JohnAlbin
Copy link
Collaborator

The new App Router feature of Next.js 13.4 doesn't work with the old Preview Mode API. Instead Next.js apps that use the App directory need to use the new Draft Mode feature.

Here's a blog post mentioning the Draft Mode feature (under "other improvements") included with Next.js 13.4: https://nextjs.org/blog/next-13-4#other-improvements

And here is Next.js' Draft Mode documentation

This request is related to #442, but that issue specifically mentions the Server Components part of the App Router feature and Draft Mode isn't related to Server Components.

@dottodot
Copy link

dottodot commented Sep 1, 2023

Draft mode is also recommended for pages too https://nextjs.org/docs/pages/building-your-application/configuring/draft-mode but the implementations are slightly different which would need to be taken into account.

Also there doesn't seem to be a replacement for setPreviewData so revisions will need a rethink.

@JohnAlbin
Copy link
Collaborator Author

@dottodot Thanks so much for the link!

Somehow I had missed that Draft Mode was recommended for pages router. That simplifies what next-drupal needs to support when a website is only partially migrated from pages router to app router.

JohnAlbin added a commit that referenced this issue Jan 25, 2024
Issue #502

BREAKING CHANGE:
The options to the DrupalClient.preview() method were previously ignored. The
options are now passed to the NextApiResponse.setDraftMode() method and their
TypeScript definition have now changed to match the options parameter of the
setDraftMode method.
JohnAlbin added a commit that referenced this issue Jan 29, 2024
Issue #502

BREAKING CHANGE:
The options to the DrupalClient.preview() method were previously ignored. The
options are now passed to the NextApiResponse.setDraftMode() method and their
TypeScript definition have now changed to match the options parameter of the
setDraftMode method.
JohnAlbin added a commit that referenced this issue Jan 29, 2024
Issue #502

BREAKING CHANGE:
The options to the DrupalClient.preview() method were previously ignored. The
options are now passed to the NextApiResponse.setDraftMode() method and their
TypeScript definition have now changed to match the options parameter of the
setDraftMode method.
@JohnAlbin JohnAlbin mentioned this issue Jan 29, 2024
3 tasks
JohnAlbin added a commit that referenced this issue Jan 29, 2024
Issue #502

BREAKING CHANGE:
The options to the DrupalClient.preview() method were previously ignored. The
options are now passed to the NextApiResponse.setDraftMode() method and their
TypeScript definition have now changed to match the options parameter of the
setDraftMode method.
JohnAlbin added a commit that referenced this issue Jan 29, 2024
Issue #502

BREAKING CHANGE:
The options to the DrupalClient.preview() method were previously ignored. The
options are now passed to the NextApiResponse.setDraftMode() method and their
TypeScript definition have now changed to match the options parameter of the
setDraftMode method.
JohnAlbin added a commit that referenced this issue Jan 29, 2024
Issue #502

BREAKING CHANGE:
The options to the DrupalClient.preview() method were previously ignored. The
options are now passed to the NextApiResponse.setDraftMode() method and their
TypeScript definition have now changed to match the options parameter of the
setDraftMode method.
JohnAlbin added a commit that referenced this issue Jan 30, 2024
Issue #502

BREAKING CHANGE:
The options to the DrupalClient.preview() method were previously ignored. The
options are now passed to the NextApiResponse.setDraftMode() method and their
TypeScript definition have now changed to match the options parameter of the
setDraftMode method.
JohnAlbin added a commit that referenced this issue Jan 30, 2024
Issue #502

BREAKING CHANGE:
The options to the DrupalClient.preview() method were previously ignored. The
options are now passed to the NextApiResponse.setDraftMode() method and their
TypeScript definition have now changed to match the options parameter of the
setDraftMode method.
JohnAlbin added a commit that referenced this issue Jan 30, 2024
Issue #502

BREAKING CHANGE:
The options to the DrupalClient.preview() method were previously ignored. The
options are now passed to the NextApiResponse.setDraftMode() method and their
TypeScript definition have now changed to match the options parameter of the
setDraftMode method.
@JohnAlbin
Copy link
Collaborator Author

Fixed with #670

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants