usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
21.83k stars 1.03k forks source link

[Feature request]: migrate to react-codemirror #1212

Open bpoulaindev opened 6 months ago

bpoulaindev commented 6 months ago

Migrate to react-codemirror instead of codemirror This would provide a react component, better suited for a react app instead of building the component through a function The current component is 300+ lines long and is getting harder and harder to maintain Linked issue : #1029

Its-treason commented 6 months ago

Sounds like a good idea, this would also upgrade code-mirror to Version 6.

There are also some weird workarounds for code-mirror and Next.js Server-Side-Rendering: https://github.com/usebruno/bruno/blob/8ddec6bf0cf04be44ecf6d0b1777cf2c246e64e6/packages/bruno-app/src/pages/_app.js#L19-L31

https://github.com/usebruno/bruno/blob/8ddec6bf0cf04be44ecf6d0b1777cf2c246e64e6/packages/bruno-app/src/pages/Bruno/index.js#L13-L44

Maybe we can also think about moving from Next.js to Vite or something like this, because we are not using any Next.js features.

bpoulaindev commented 6 months ago

You're right @Its-treason , Next JS is better suited for SSR and SEO optimization, Vite would be lighter and faster, hence its name

bpoulaindev commented 6 months ago

I know the Typescript debate isn't settled yet, but i'de like to point out, this component would really benefit from having explicit types :

image
bpoulaindev commented 6 months ago

Trying out something, the following basic code can already provide the following render :

image image
bpoulaindev commented 6 months ago

Progress has been made :

image

Could use a bit more styling in the search component, about 20 themes are available, this isn't the definitive one for dark mode. We could also include, in the future, the possibility for users to switch between all of those 20 mods.

dan1xk commented 5 months ago

Is there a possibility for this feature to resolve this? #1347

bpoulaindev commented 5 months ago

@dan1xk Absolutely, i ended up using Monaco Editor, here's the PR : Monaco Editor