Skip to content

Conversation

@davidsklar99
Copy link
Member

All lexicon main pages and individual pages use a +data.ts handler to allow for better web search crawlability

Also, fixing linking issue with new strat-names page

@davidsklar99 davidsklar99 marked this pull request as ready for review June 5, 2025 16:59
Copy link
Member

@davenquinn davenquinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a decent start but you need to update the `IndividualPage' function to be a proper React component.

Also it's worth noting that server-side loading won't be fully achieved until you switch Pages from +Page.client.ts to +Page.ts. This may require making the map and other page elements load lazily – see the columns page for how to do this.

if (type === "concept_id") {
type = "strat_name_concept_id";
}
export function IndividualPage(id, header, res, fossilRes, colData, taxaData) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has some architectural challenges:

  • The IndividualPage should be a React component but it is not. Make all of the arguments into props instead, and create a Typescript type to guide the user on what the props should be. Having this as a function that returns React elements based on arguments is a sketchy design
  • IndividualPage is not a very descriptive name
  • This is a subsidiary problem, at least for now, but this component suffers from a little bit of bloat in trying to create a "one size fits all" approach to rendering a lexicon page

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First two points fixed in new commits

@davidsklar99
Copy link
Member Author

All page.client.ts pages changes to regular page.ts

@davenquinn davenquinn merged commit 033928a into main Jun 9, 2025
1 check passed
@davidsklar99 davidsklar99 deleted the data-handler branch June 9, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants