-
Notifications
You must be signed in to change notification settings - Fork 17
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
App Router Preview Handler #797
Conversation
📦 Next.js Bundle Analysis for @10up/headstartwpThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
import { previewRouteHandler } from '../previewRouteHandler'; | ||
|
||
describe('previewRouteHandler', () => { | ||
it.skip('does not accepts POST requests', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having an issue with fetch where instantiating NextRequest is failling, will look into it afterwards.
📦 Next.js Bundle Analysis for @10up/headstartwpThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
📦 Next.js Bundle Analysis for @10up/headstartwpThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
<!-- Filling out this template is required. Any PR that does not include enough information to be reviewed may be closed at a maintainers' discretion. All new code requires documentation and tests to ensure against regressions. --> ### Description of the Change <!-- We must be able to understand the design of your change from this description. The maintainer reviewing this PR may not have worked with this code recently, so please provide as much detail as possible. Where possible, please also include: - verification steps to ensure your change has the desired effects and has not introduced any regressions - any benefits that will be realized - any alternative implementations or possible drawbacks that you considered - screenshots or screencasts --> <!-- Enter any applicable Issue number(s) here that will be closed/resolved by this PR. --> Closes #791 ### Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you are unsure about any of these, please ask for clarification. We are here to help! --> - [x] I agree to follow this project's [**Code of Conduct**](https://github.com/10up/.github/blob/trunk/CODE_OF_CONDUCT.md). - [ ] I have updated the documentation accordingly. - [x] I have added tests to cover my change. - [x] All new and existing tests pass.
<!-- Filling out this template is required. Any PR that does not include enough information to be reviewed may be closed at a maintainers' discretion. All new code requires documentation and tests to ensure against regressions. --> ### Description of the Change <!-- We must be able to understand the design of your change from this description. The maintainer reviewing this PR may not have worked with this code recently, so please provide as much detail as possible. Where possible, please also include: - verification steps to ensure your change has the desired effects and has not introduced any regressions - any benefits that will be realized - any alternative implementations or possible drawbacks that you considered - screenshots or screencasts --> <!-- Enter any applicable Issue number(s) here that will be closed/resolved by this PR. --> Partially Closes #791 This also refactors the test infrastructure to use absolute URLs instead of relative URL (closes #643 ) ### How to test the Change <!-- Please provide steps on how to test or validate that the change in this PR works as described. --> - Start up the wp-env - `npm run build -- --filter=@10up/wp-nextjs-app` to build the app - `npm run start -w=@10up/wp-nextjs-app` to start the app. - Make sure to set the headless front-end url in Settings. - Open any post on the admin interface and update it, ensure that the post on the front-end gets revalidated (yuou see the updated version) ### Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you are unsure about any of these, please ask for clarification. We are here to help! --> - [x] I agree to follow this project's [**Code of Conduct**](https://github.com/10up/.github/blob/trunk/CODE_OF_CONDUCT.md). - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my change. - [x] All new and existing tests pass.
packages/core/src/react/hooks/__tests__/useFetchAppSettings.tsx
Dismissed
Show dismissed
Hide dismissed
packages/core/src/react/hooks/__tests__/useFetchPostOrPosts.tsx
Dismissed
Show dismissed
Hide dismissed
packages/core/src/react/hooks/__tests__/useFetchPostOrPosts.tsx
Dismissed
Show dismissed
Hide dismissed
📦 Next.js Bundle Analysis for @10up/headstartwpThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Description of the Change
Partially addresses #791
How to test the Change
npm install
npm run dev:app
http://localhost:3000
localhot:8888/wp-admin
and preview both draft and published posts.app-router-preview.mp4
Checklist: