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

Enhancement: Update Monaco to a newer version (>= 0.20.0) #3097

Open
geckogreen opened this issue Dec 16, 2022 · 5 comments
Open

Enhancement: Update Monaco to a newer version (>= 0.20.0) #3097

geckogreen opened this issue Dec 16, 2022 · 5 comments
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request refactor Tech debt related tasks that need refactoring technical debt If not paid, jeapardizes long-term success and maintainability of the repository.

Comments

@geckogreen
Copy link

Currently, OSD is using the monaco editor component in version 0.17.0.
This version is pretty old and we encountered some bugs, in particular

  • horitontal scrolling with mousewheel does not work in Firefox
  • copying selected text into the clipboard with Ctrl+C not working reliably

With version 0.20 the API editor.getContentHeight() was added which helps a lot to correctly size the editor if you
use line-wrap.

I would like to propose to update monaco-editor to at least version 0.20.0.
The above mentioned issues seem to be fixed with an upgrade to that version.

Are there already any plans to do this?
If not I could try to provide a pull request.

@geckogreen geckogreen added the enhancement New feature or request label Dec 16, 2022
@joshuarrrr joshuarrrr added the dependencies Pull requests that update a dependency file label Dec 20, 2022
@joshuarrrr
Copy link
Member

@geckogreen I don't think there are any imminent plans to upgrade it, but a PR would be welcome. Note that monaco-editor and react-monaco-editor are both wrapped by the Code Editor Component. The sizing functionality, in particular, sounds like you might need to refactor the resize detector in the current component.

As part of the PR, you'd need to provide some research and potentially mitigations for the breaking changes between 0.17.0 and 0.20.0:

0.19.0:

  • getConfiguration() is replaced by getRawOptions(), which returns the passed in editor options.
  • Starting with this version, the Monaco Editor no longer supports IE 11. The last version that was tested in IE 11 is 0.18.1.

0.20.0:

  • Renamed onCompositionStart, onCompositionEnd to onDidCompositionStart, onDidCompositionEnd
  • Changed the argument passed in to onDidPaste
  • WorkspaceEdit.edits has now changed its shape such that edits must no longer be grouped by resource.
  • The Monaco Editor no longer supports IE 11. The last version that was tested in IE 11 is 0.18.1.

Note that any version bump above 0.18.1 will likely be a breaking change for plugins depending on monaco-editor directly, so we wouldn't be able to backport (to 2.x or 1.x branches) as-is.

@joshuarrrr joshuarrrr added refactor Tech debt related tasks that need refactoring technical debt If not paid, jeapardizes long-term success and maintainability of the repository. labels Dec 20, 2022
@joshuarrrr
Copy link
Member

Assuming some of the above changes are breaking, we'd want to do 2 separate PRs for main and 2.x (with an alias), something along the lines of

@SuZhou-Joe
Copy link
Member

Assuming some of the above changes are breaking, we'd want to do 2 separate PRs for main and 2.x (with an alias), something along the lines of

alias way has issues because the implementation of monaco-editor has side effects. Please check the Unit test error here.
#3438 .

@AMoo-Miki
Copy link
Collaborator

alias way has issues because the implementation of monaco-editor has side effects. Please check the Unit test error here. #3438 .

I think that aliasing is not done right.

@joshuarrrr
Copy link
Member

This is no longer a blocker for the ISM team. It's still something we want to do, but not currently prioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request refactor Tech debt related tasks that need refactoring technical debt If not paid, jeapardizes long-term success and maintainability of the repository.
Projects
None yet
Development

No branches or pull requests

4 participants