This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ implement in-memory cache for /courses|instructors/{id}
- Loading branch information
Showing
10 changed files
with
132 additions
and
124 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
declare module "INSTRUCTORS" { | ||
declare const instructors: string[]; | ||
// These are the type declarations for the virtual modules | ||
// used by the `/courses/{id}` and `/instructors/{id}` routes. | ||
// The reason we have to use inline imports here is because with `import` statements, TypeScript | ||
// treats this as a normal module rather than an ambient module, and so the module declarations | ||
// don't actually work when consumed by other TypeScript source files. | ||
|
||
declare module "virtual:courses" { | ||
declare const courses: Record<string, import("@peterportal-api/types").Course>; | ||
} | ||
|
||
declare module "virtual:instructors" { | ||
declare const instructors: Record<string, import("@peterportal-api/types").Instructor>; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ApiPropsOverride } from "@bronya.js/api-construct"; | ||
|
||
import { esbuildOptions, constructs } from "../../../../../../bronya.config"; | ||
|
||
export const overrides: ApiPropsOverride = { | ||
esbuild: esbuildOptions, | ||
constructs: { | ||
functionPlugin: constructs.functionPlugin, | ||
restApiProps: constructs.restApiProps, | ||
}, | ||
}; |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ApiPropsOverride } from "@bronya.js/api-construct"; | ||
|
||
import { esbuildOptions, constructs } from "../../../../../../bronya.config"; | ||
|
||
export const overrides: ApiPropsOverride = { | ||
esbuild: esbuildOptions, | ||
constructs: { | ||
functionPlugin: constructs.functionPlugin, | ||
restApiProps: constructs.restApiProps, | ||
}, | ||
}; |
This file contains 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