Skip to content

Add typing for templating context#8455

Merged
jackkav merged 20 commits into
Kong:developfrom
jackkav:typing-plugin-context
Mar 18, 2025
Merged

Add typing for templating context#8455
jackkav merged 20 commits into
Kong:developfrom
jackkav:typing-plugin-context

Conversation

@jackkav

@jackkav jackkav commented Mar 13, 2025

Copy link
Copy Markdown
Contributor

todo
in order to iterate on the web worker renderer and improve extensibility, we want move types into one file in order to avoid importing the mixed context db code into the worker and causing a call stack exception

in this PR im aiming to take a second pass at the worker with a focus on making the types stricter

getBodyBuffer was previously a syncronous function meaning it was not a promise and that meant react code didn't need to wait for it to execute or handle it in any special way during re-renders, since we need to promisify and serialise all calls to the plugin api we're now going to need this to be an async function which might have some side effects in the response pane rendering code TBD

  • co-locate types
  • deal with async bodyBuffer issue

related: INS-4963

@jackkav
jackkav force-pushed the typing-plugin-context branch from a6d1bd2 to 2cc7fd8 Compare March 13, 2025 14:51
@jackkav jackkav changed the title Add typing plugin context Add typing for templating context Mar 13, 2025
@jackkav
jackkav force-pushed the typing-plugin-context branch 4 times, most recently from c06ee1f to eefa533 Compare March 18, 2025 08:50
@jackkav
jackkav marked this pull request as ready for review March 18, 2025 08:50
@jackkav
jackkav force-pushed the typing-plugin-context branch from eefa533 to b9aaca7 Compare March 18, 2025 09:06
@jackkav
jackkav force-pushed the typing-plugin-context branch from 0eec749 to 8e1990f Compare March 18, 2025 12:18
@jackkav
jackkav merged commit 8f3a522 into Kong:develop Mar 18, 2025
@jackkav
jackkav deleted the typing-plugin-context branch March 18, 2025 13:50

export type NunjucksTagContextMenuAction = 'edit' | 'delete';

export interface nunjucksTagContextMenuOptions extends Exclude<ReturnType<typeof extractNunjucksTagFromCoords>, void> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: This interface does not follow PascalCase while other interfaces/types do

cwangsmv pushed a commit that referenced this pull request Apr 21, 2025
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