Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
douglasg14b opened this issue May 23, 2024 · 5 comments
Open

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

douglasg14b opened this issue May 23, 2024 · 5 comments

Comments

@douglasg14b
Copy link

douglasg14b commented May 23, 2024

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

@douglasg14b douglasg14b changed the title [Feature] Use text editor for Request Body [Feature Request] Use text editor for Request Body May 23, 2024
@douglasg14b douglasg14b changed the title [Feature Request] Use text editor for Request Body [Feature Request] Use Monaco editor for Request Body May 23, 2024
@emericcolombe
Copy link

Awesome idea !

@mrin9
Copy link
Collaborator

mrin9 commented Sep 18, 2024

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.

@mrin9 mrin9 closed this as completed Sep 18, 2024
@douglasg14b
Copy link
Author

douglasg14b commented Sep 18, 2024

@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?

@mrin9
Copy link
Collaborator

mrin9 commented Sep 19, 2024

@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

@mrin9 mrin9 reopened this Sep 19, 2024
@douglasg14b
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants