Skip to content

Commit

Permalink
Adapt next-adapter to work with slash API #354
Browse files Browse the repository at this point in the history
  • Loading branch information
pmi committed Oct 30, 2023
1 parent 5c7f190 commit 1b93024
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 96 deletions.
123 changes: 64 additions & 59 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"html-react-parser": "^4.2.9",
"lru-cache": "^10.0.1",
"next": "13.5.6",
"next": "13.4.12",
"react": "18.2.0",
"react-dom": "18.2.0",
"unescape": "^1.0.1"
Expand Down
3 changes: 0 additions & 3 deletions src/ComponentRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,12 @@ interface ComponentDictionary {
// NB! Always return null or empty object from processor for next is unable to serialize undefined
export type DataProcessor = (data: any, context?: Context, config?: any) => Promise<Record<string, any>>;

// TODO: also access as arguments: dataAsJson, pageAsJson, configAsJson from the first (meta) call here?
// Another option could be to let the component or page controller pass those values to NextJS by a header
export type VariablesGetter = (path: string, context?: Context, config?: any) => VariablesGetterResult;

export type QueryGetter = (path: string, context?: Context, config?: any) => string;

export type VariablesGetterResult = {
[variables: string]: any,
path: string,
};

export type SelectedQueryMaybeVariablesFunc = string | QueryGetter |
Expand Down

0 comments on commit 1b93024

Please sign in to comment.