[GH-ISSUE #1896] Generalize changes to lenses renderers #605

Closed
opened 2026-03-16 16:20:44 +03:00 by kerem · 3 comments
Owner

Originally created by @sguzmanm on GitHub (Oct 24, 2021).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1896

Originally assigned to: @RishabhAgarwal-2001 on GitHub.

Is your feature request related to a problem? Please describe.
Mostly maintainability and code readability. When you make a change to any of these renderers you are forced to copy the same code more than three times

Describe the solution you'd like
A global component for rendering the response that receives as inputs:

  • The response
  • List of actions and a callback for each of these actions
  • List of renderers. We could standardize these renderers by using an interface for specifying how to render the data received as input

Describe alternatives you've considered

  • Use v-ifs based on a specific type on a global component

Additional context
Currently these are the renderers of the repo:
image

Originally created by @sguzmanm on GitHub (Oct 24, 2021). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1896 Originally assigned to: @RishabhAgarwal-2001 on GitHub. **Is your feature request related to a problem? Please describe.** Mostly maintainability and code readability. When you make a change to any of these renderers you are forced to copy the same code more than three times **Describe the solution you'd like** A global component for rendering the response that receives as inputs: - The response - List of actions and a callback for each of these actions - List of renderers. We could standardize these renderers by using an interface for specifying how to render the data received as input **Describe alternatives you've considered** - Use v-ifs based on a specific type on a global component **Additional context** Currently these are the renderers of the repo: ![image](https://user-images.githubusercontent.com/25377562/138614458-7c5894fc-04d3-4d61-b8aa-f6aa1466cf80.png)
kerem 2026-03-16 16:20:44 +03:00
Author
Owner

@AndrewBastin commented on GitHub (Oct 25, 2021):

Interesting, we were thinking of abstracting text based renderers actually to a more generalized system but never got around to it.

This is a low priority issue, but PRs are welcome!

<!-- gh-comment-id:950733637 --> @AndrewBastin commented on GitHub (Oct 25, 2021): Interesting, we were thinking of abstracting text based renderers actually to a more generalized system but never got around to it. This is a low priority issue, but PRs are welcome!
Author
Owner

@RishabhAgarwal-2001 commented on GitHub (Nov 25, 2021):

Hello!
I was looking to take up the task of refactoring lenses. I am initially planning to create an abstract text-based renderer as per the previous comment.
Can I get this issue assigned to me? @AndrewBastin

<!-- gh-comment-id:979219889 --> @RishabhAgarwal-2001 commented on GitHub (Nov 25, 2021): Hello! I was looking to take up the task of refactoring lenses. I am initially planning to create an abstract text-based renderer as per the previous comment. Can I get this issue assigned to me? @AndrewBastin
Author
Owner

@AndrewBastin commented on GitHub (Nov 25, 2021):

@RishabhAgarwal-2001 sure!

But just to make sure you get what I have in mind:

Generally our code is moving to take advantage of Vue 3 Composables and Composition API more along with TypeScript. So abstracting out the lens renderers to a composable we can apply easily.
Second of all, lenses should work for non-text content, for example we have the ImageLensRenderer and maybe in the future we might add other binary formats as well. So, we need to keep support for them.

Anyways, feel free to ping me on Discord or Telegram if you want any help!

Assigning!

<!-- gh-comment-id:979241087 --> @AndrewBastin commented on GitHub (Nov 25, 2021): @RishabhAgarwal-2001 sure! But just to make sure you get what I have in mind: Generally our code is moving to take advantage of Vue 3 Composables and Composition API more along with TypeScript. So abstracting out the lens renderers to a composable we can apply easily. Second of all, lenses should work for non-text content, for example we have the ImageLensRenderer and maybe in the future we might add other binary formats as well. So, we need to keep support for them. Anyways, feel free to ping me on Discord or Telegram if you want any help! Assigning!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#605
No description provided.