Skip to content

[Feature Request] Use Monaco editor for Request Body #1010

Open

Description

@douglasg14b

The textarea could utilize the Monaco editor to provide syntax highlighting and "normal" text editor features for request JSON (or other languages).

Editor preview: https://microsoft.github.io/monaco-editor/

This would be a much improved user experience when writing requests both for syntax highlighting, code formatting, syntax errors, intellisense, and other "sugar" features that make the request body more pleasant to write.

image

vs

image

Activity

  1. changed the title [-][Feature] Use text editor for Request Body[/-] [+][Feature Request] Use text editor for Request Body[/+] on May 23, 2024
  2. changed the title [-][Feature Request] Use text editor for Request Body[/-] [+][Feature Request] Use Monaco editor for Request Body[/+] on May 23, 2024
  3. emericcolombe commented on May 31, 2024

    @emericcolombe

    Awesome idea !

  4. mrin9 commented on Sep 18, 2024

    @mrin9
    Collaborator

    one of the goal of this web-component is to be extremely lightweight in size. So that the entire thing can be bundled into a single file . Therefore we are very careful in choosing dependencies or even upgrading them.

    Monaco dont bring us a lot of advantage compared to its size penalty.

  5. douglasg14b commented on Sep 18, 2024

    @douglasg14b
    Author

    @mrin9 I think this is value to keep open, there is a big gap here that remains unfilled. Such QoL could also be bundle/option dependent if the only option is monaco.

    It feels heavy handed to close this immediately in this manner before raising conversation, the problem persists, and there are ways to address bundle size concerns.


    That said:

    Monaco dont bring us a lot of advantage compared to its size penalty.

    Monaco can be bundled into a single file (19.9KB), which to be fair, is larger than prism or marked (6.9KB & 10.7KB) which this project already bundles. But not exactly by an egregious amount.

    Given the current bundle size is ~850KB, we're talking a change of 2%... to get fully featured syntax highlighting, JSON-schema, XML, and automcomplete/text-editor support for the currently bare request body. (You might actually be able to get this for "free" by minifying the currently unminified CSS as well, reducing the bundle size, potentially by more than 2%)

    Now, is that's still too large, then there are likely other ways to perform syntax highlighting or editor-like features on JSON that would improve the experience here. Which should be discussed, unless the stance is that such QoL is not within the scope of what RapiDoc is trying to achieve?

  6. mrin9 commented on Sep 19, 2024

    @mrin9
    Collaborator

    @douglasg14b agree with you, therefore reopening.
    If you would like to take a dig at it, I am open for a PR.
    If not i have added to my queue, have never worked with monaco, but I hope it works well with lit's reactivity

  7. reopened this on Sep 19, 2024
  8. douglasg14b commented on Sep 20, 2024

    @douglasg14b
    Author

    This seems like something I could stab at next time I have a schedule gap, don't hold your breath though, on crunch-time right now 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions