next.js icon indicating copy to clipboard operation
next.js copied to clipboard

feat: include LP SDK in Contentful example

Open YvesRijckaert opened this issue 1 year ago • 2 comments

What?

Changing the Contentful example to include the Live Preview SDK to enable inspector mode and live updates.

https://github.com/vercel/next.js/assets/22968325/4a85da5a-e394-46bf-8517-00d1f4c6e7b9

How?

  • import the @contentful/live-preview package
  • Had to use "use client" for some components to enable the postMessage iframe messaging that the Live Preview SDK relies on
  • For live updates to work we need to include the sys.id and __typename in our GraphQL queries

YvesRijckaert avatar Jun 27 '24 08:06 YvesRijckaert

Allow CI Workflow Run

  • [ ] approve CI run for commit: 9a2d33852a527d5643247803bf944bd8a9a4f142

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

ijjk avatar Jun 27 '24 08:06 ijjk

Allow CI Workflow Run

  • [ ] approve CI run for commit: 9a2d33852a527d5643247803bf944bd8a9a4f142

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

ijjk avatar Jun 27 '24 08:06 ijjk