Convert staging to app router [#1067]#1131
Merged
Conversation
…1067] Note: this will leave the site in a broken state; doing this to ensure better Git tracking of file renames.
a0120e2 to
229739a
Compare
victorlin
reviewed
Mar 17, 2025
This was referenced Mar 20, 2025
229739a to
53b174c
Compare
53b174c to
bf10ac9
Compare
bf10ac9 to
67088fd
Compare
67088fd to
ace67be
Compare
Contributor
Author
|
Okay, @victorlin, I think I addressed all the issues you raised; particularly interested in any feedback on the comment about how /staging versus /staging/foo works now. I will plan to merge this early next week, sans additional feedback. |
This was referenced Mar 21, 2025
victorlin
approved these changes
Mar 21, 2025
Member
victorlin
left a comment
There was a problem hiding this comment.
Didn't test anything but the code looks good. Only comments are a non-blocking discussion for naming and a small typo correction.
* Split the callback out into a distinct React Client Component, to enable passing it to the <ListResources> component * Split the page content out into a distinct React Server Component, so that it can be used in both the staging page.tsx file _and_ the staging not-found.tsx file * Split the error banner handling out into a distinct React Client Component, so it can call `useParams()` * Add a custom not-found.tsx` component to allow displaying an error message when a bogus URL is requested, in addition to displaying the default staging page content * Add Metadata API to the staging page * Add a 'validateStagingUrl' "component", which detects when a bogus URL (e.g., /staging/foo) is requested, and calls the Next.js notFound() method so that the request renders the `not-found` component and sets a 404 status code on the response NOTE: as of this commit, the site will be broken; there are additional changes to the <ListResources> component that are required for this code to work.
…ram [#1067] This walks back a change that was made when converting the /pathogens page to App Router syntax, moving back to an approach more similar to the previous code, where a callback to list resources is passed into this component.
#1067] This switches the pathogens page back to passing a callback to the <ListResources> component, rather than having that component directly import the callback itself.
Currently, trying to load something like `/pathogens/foo` results in a 404 error. If we _were_ to add display of an error banner instead (the way we do for `/staging/foo`), using a fully-specified URL will be required to still be able to load the normal `/pathogens` data under the error message.
ace67be to
b281971
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of proposed changes
Converts
/stagingover to the App Router style; see individual commit comments for details.Preview — note that the error message for a bad dataset looks slightly different, due to how the base App Router layout is done. This feels like an acceptable modification.
Related issue(s)
Closes #1067
Checklist