next.js
next.js copied to clipboard
feat: include LP SDK in Contentful example
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-previewpackage - Had to use "use client" for some components to enable the
postMessageiframe messaging that the Live Preview SDK relies on - For live updates to work we need to include the
sys.idand__typenamein our GraphQL queries
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
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