Skip to content

Prefetching section information #2

@ninest

Description

@ninest

Currently, I am only fetching overall course info (number, title, description, lecture type), and a list of sections (term code and CRN)

export interface Course {
  // No term for courses. Terms are only required for sections
  subject: string;
  number: string;
  scheduleType: string;
  title: string;
  credits: number;
  nuPath: NUPath[];
  description?: string;

  sections: {
    term: string;
    crn: string;
  }[];
}

Should professor information also be added to the list of sections?

Yes because

  • it will allow to search for courses by professor (search is currently slow, but that's another issue)
  • The course page will load faster: no need to make an API call to view a list of professors teaching that course

No because

  • search is already slow and adding another field to search through will make it even slower (maybe make a search API for this?)
  • sections can be added/change during the semester, so the data will become outdated

Leaning towards yes if

  • search can be improved
  • use getStaticProps to get possible stale data, then update it with React Query

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions