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

Add monaco editor and remove old one #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

LuisDuarte1
Copy link

This PR removes the old editor, in favor of the Monaco editor. Monaco is the editor that powers VSCode, has many shortcuts that everybody is used to, and has some usability features that make the UX more pleasant.

@limwa limwa closed this May 11, 2024
@limwa limwa reopened this May 11, 2024
@limwa
Copy link
Owner

limwa commented May 11, 2024

Hey, thanks for your PR! I'll be testing this over the coming weeks (I'm a bit busy at the moment) to clarify some of my main concerns:

  • Usability on mobile
  • Bundle size
  • General UI/UX

I'll then let you know if this will be integrated as it is or if further changes are required! Thank you once again!

@limwa
Copy link
Owner

limwa commented May 11, 2024

I'll also be creating a new deployment at https://jmm-monaco-editor.up.railway.app/ with the changes in this PR. I'll post a message once this is done!

@limwa
Copy link
Owner

limwa commented May 12, 2024

Deployed to https://jmm-monaco-editor.up.railway.app/

@LuisDuarte1
Copy link
Author

Usability on mobile

I've noticed that tab switching doesn't work anymore on mobile 😅 probably due to some Monaco shenanigans, however, the editor itself is usable on mobile just more difficult to take advantage of Monaco's full features ^^

Bundle size

Compared with the main version the bundle increases from ~+-500KB to 1.25MB (with Gzip enabled) (a 2.5x increase) however, I've noticed that the monaco-editor bundle is not getting cached because for some reason it's getting fetched with a Pragma: no-cache header at least on Firefox. I can look at it later.

General UI/UX

In general, it maintains all UI/UX features from the old version with the bonus that you have powerful shortcuts, and the command palette and feel more at home if you are a VSCode user ^^.

src/app/inner.tsx Outdated Show resolved Hide resolved
@limwa
Copy link
Owner

limwa commented May 13, 2024

One thing that I immediately noticed is that the theme is different. I know that the themes used in shiki are compatible with VS Code. Any way to bring them back?

@LuisDuarte1
Copy link
Author

One thing that I immediately noticed is that the theme is different. I know that the themes used in Shiki are compatible with VS Code. Any way to bring them back?

Do you mean the editor theme itself or the code highlighting colors? The Monaco editor comes with two default themes vs-dark and light but you can add new ones manually.

It's possible to integrate back Shiki with @shikijs/monaco. I don't know if it's worth it considering the bundle size because the Monaco one is sufficiently good in my opinion, wdyt?

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