-
Notifications
You must be signed in to change notification settings - Fork 50
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
Convert /pathogens
to App Router
#1066
Comments
I have some ListResources TypeScript work that I plan to make a PR for soon. Hopefully the app router work can wait for that. |
yeah, i'm gonna jump back into the blog PR and deal with the redirect issue there before i pick this back up — yesterday i got right to the point where i was gonna touch ListResources and ran out of day, so once that other PR is merged, i can rebase my WIP on top of it. |
PR for the TypeScript work: #1073 |
Adding this rule stops a small code bit in the rabies/lassa/et al blog post (`mafft --extend-alignment`) from having an awkward line break inserted between the command name and the argument. It's scoped fairly narrowly (`p > code`) so that it (ideally!) will not have an impact on larger code blocks.
Adds a `blogPost` style to `app/blog/[id]/styles.module.css`, which includes several additional styling rules, and adds the resulting class to the `<article>` tag that wraps each blog article. Added styles improve the visual formatting of tables; see comment in the `app/blog/[id]/styles.module.css` for specifics. Additional added style for `<code>` tags inside `<p>` tags stops a small code bit in the rabies/lassa/et al blog post (`mafft --extend-alignment`) from having an awkward line break inserted between the command name and the argument. The narrow scoping is so that it (ideally!) will not have an impact on larger code blocks.
Note: this will leave the site in a broken state; doing this to ensure better Git tracking of file renames.
Note: this is a copy, not a move, as `<ExpandableTiles>` is also used in the `splash` and `Groups` components in addition to the `ListResources` component that is consumed by the `/pathogens` page.
Note: this is a copy, not a move, as `<ErrorBoundary>` is used elsewhere in the site, in addition to the `ListResources` component that is consumed by the `/pathogens` page.
Note: this is a copy, not a move, as `<ListResources>` is used elsewhere in the site, in addition to the `/pathogens` page.
Note: despite the placement of the component outside the <ListResources> component, it is only used within that component. I considered relocating it to `static-site/components/list-resources/spinner.tsx` but elected to maintain it outside of the <ListResources> component to better support future re-use, which seems not unlikely. Note also: the component is likely broken as of this commit, due to this move; doing this as a distinct commit to better track the file move.
* add `use client` because of use of `useState` * rename `Tile` type to `GenericTileBase`; rename `AnyTile` to `Tile` * converted styled components to CSS module * swap various prop-driven styled components bits to dynamic inline styles
* move `div.errorContainer` into global CSS file because it is used in multiple places
* segregate types and functions * update formatting
* adjust leading/trailing whitespace
* move styling from styled components to CSS module * refactor <ResourceModal> to `useContext` and `useCallback` to build `dismissModal()` function, rather than passing it in — this was necessary because all props of React Client Components need to be serializable (i.e., not functions), and <ResourceModal> needs to "use client" because it depends on `useState` and `useEffect` * refactor the `_draw` function out into a distinct file (`modal_draw.js`) to reflect the lack of typing in that code (I briefly explored converting that file to Typescript and concluded the juice was not worth the squeeze) * note that this also means we don't need to add @types/d3 to devDependencies
* export component as a function * convert to Typescript; light reformatting
* Refactor <Name>, <ResourceLinkWrapper>, and <ResourceLink> into <IndividualResourceLink>, and migrate into distinct file; in the future, <GroupLink> will also be refactored into that file, which is reflected in the `group-and-resource-links` file name * Refactor <IconContainer> into distinct file, rework to avoid need to pass non-serializable prop * Refactor <IndividualResource> and associated components from Styled to CSS Module * Refactor <IndividualResource> component to be passed `gapWidth` prop, which supports cleaner separation of concerns with where that constant is defined and used * Refactor <TooltipWrapper> into a distinct file, because it doesn't need to be a React Client component
* Refactored styles from structured component to CSS Module * Refactored <GroupLink> and <IndividualQuickLink> components out into `group-and-resource-links.tsx` * Refactored <ResourceGroup> and contained components
* convert `export const`` to `export default function` * add "use client" * refactor and update code
* convert to React Client Component * refactor code lightly
* convert from styled comp to css module * convert const fat-arrows to functions * update imports, etc.
* Refactor <Name>, <ResourceLinkWrapper>, and <ResourceLink> into <IndividualResourceLink>, and migrate into distinct file; in the future, <GroupLink> will also be refactored into that file, which is reflected in the `group-and-resource-links` file name * Refactor <IconContainer> into distinct file, rework to avoid need to pass non-serializable prop * Refactor <IndividualResource> and associated components from Styled to CSS Module * Refactor <IndividualResource> component to be passed `gapWidth` prop, which supports cleaner separation of concerns with where that constant is defined and used * Refactor <TooltipWrapper> into a distinct file, because it doesn't need to be a React Client component
* Refactored styles from structured component to CSS Module * Refactored <GroupLink> and <IndividualQuickLink> components out into `group-and-resource-links.tsx` * Refactored <ResourceGroup> and contained components
* convert `export const`` to `export default function` * add "use client" * refactor and update code
* segregate types and functions * update formatting
* move styling from styled components to CSS module * refactor <ResourceModal> to `useContext` and `useCallback` to build `dismissModal()` function, rather than passing it in — this was necessary because all props of React Client Components need to be serializable (i.e., not functions), and <ResourceModal> needs to "use client" because it depends on `useState` and `useEffect` * refactor the `_draw` function out into a distinct file (`modal_draw.js`) to reflect the lack of typing in that code (I briefly explored converting that file to Typescript and concluded the juice was not worth the squeeze) * note that this also means we don't need to add @types/d3 to devDependencies
* export component as a function * convert to Typescript; light reformatting
* Refactor <Name>, <ResourceLinkWrapper>, and <ResourceLink> into <IndividualResourceLink>, and migrate into distinct file; in the future, <GroupLink> will also be refactored into that file, which is reflected in the `group-and-resource-links` file name * Refactor <IconContainer> into distinct file, rework to avoid need to pass non-serializable prop * Refactor <IndividualResource> and associated components from Styled to CSS Module * Refactor <IndividualResource> component to be passed `gapWidth` prop, which supports cleaner separation of concerns with where that constant is defined and used * Refactor <TooltipWrapper> into a distinct file, because it doesn't need to be a React Client component
* Refactored styles from structured component to CSS Module * Refactored <GroupLink> and <IndividualQuickLink> components out into `group-and-resource-links.tsx` * Refactored <ResourceGroup> and contained components
* convert `export const`` to `export default function` * add "use client" * refactor and update code
* convert to React Client Component * refactor code lightly
* convert from styled comp to css module * convert const fat-arrows to functions * update imports, etc.
* Refactored styles from structured component to CSS Module * Refactored <GroupLink> and <IndividualQuickLink> components out into `group-and-resource-links.tsx` * Refactored <ResourceGroup> and contained components
* convert `export const`` to `export default function` * add "use client" * refactor and update code
* convert to React Client Component * refactor code lightly
* convert from styled comp to css module * convert const fat-arrows to functions * update imports, etc.
* convert from styled comp to css module * convert const fat-arrows to functions * update imports, etc.
This moves the resource listing callback into a distinct file; this is because Next.js Pages are limited in the types of methods that can be exported from them. The resource listing code was moved into a distinct method, which is imported by the `<ListResources>` component, so that this page file can remain a React Server Component, which allows for the Metadata API to be used to generate content in the page `<head>` during SSR, prior to hydration.
* move styling from styled components to CSS module * refactor <ResourceModal> to `useContext` and `useCallback` to build `dismissModal()` function, rather than passing it in — this was necessary because all props of React Client Components need to be serializable (i.e., not functions), and <ResourceModal> needs to "use client" because it depends on `useState` and `useEffect` * refactor the `_draw` function out into a distinct file (`modal_draw.js`) to reflect the lack of typing in that code (I briefly explored converting that file to Typescript and concluded the juice was not worth the squeeze) * note that this also means we don't need to add @types/d3 to devDependencies
* export component as a function * convert to Typescript; light reformatting
* Refactor <Name>, <ResourceLinkWrapper>, and <ResourceLink> into <IndividualResourceLink>, and migrate into distinct file; in the future, <GroupLink> will also be refactored into that file, which is reflected in the `group-and-resource-links` file name * Refactor <IconContainer> into distinct file, rework to avoid need to pass non-serializable prop * Refactor <IndividualResource> and associated components from Styled to CSS Module * Refactor <IndividualResource> component to be passed `gapWidth` prop, which supports cleaner separation of concerns with where that constant is defined and used * Refactor <TooltipWrapper> into a distinct file, because it doesn't need to be a React Client component
* Refactored styles from structured component to CSS Module * Refactored <GroupLink> and <IndividualQuickLink> components out into `group-and-resource-links.tsx` * Refactored <ResourceGroup> and contained components
* convert `export const`` to `export default function` * add "use client" * refactor and update code
* convert to React Client Component * refactor code lightly
* convert from styled comp to css module * convert const fat-arrows to functions * update imports, etc.
This moves the resource listing callback into a distinct file; this is because Next.js Pages are limited in the types of methods that can be exported from them. The resource listing code was moved into a distinct method, which is imported by the `<ListResources>` component, so that this page file can remain a React Server Component, which allows for the Metadata API to be used to generate content in the page `<head>` during SSR, prior to hydration.
…ter-1066 Convert pathogens to app router [#1066]
Context
This is part of the Convert static-site from Pages Router to App Router work. See there for additional context.
The
/pathogens
page uses only theGenericPage
andListResources
components.The
GenericPage
component is a simple bit of HTML and will be trivial to convert.ListResources
is a fairly massive component that uses some client-side state. On the plus side, it depends on very few things outside itself, and it has already been rewritten in Typescript (albeit, still making extensive use of Styled Components). Converting this component over is expected to be the bulk of the work.The text was updated successfully, but these errors were encountered: