-
Notifications
You must be signed in to change notification settings - Fork 29
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
update version of Monaco #639
Comments
@jeffmcaffer do you remember which kind of problem did you faced during the integration? I'd love to update the version since i'm on the way to made some work about loading large payloads. |
while we are in here can we make sure we get collapsing/folding for the json? |
@dabutvin sure! |
The were just challenges in getting the deployment working. Had to copy files around at build time etc. The was some fuss around syntax highlighting and content assist. +1 to @dabutvin suggestion about folding. That would be a huge win. |
@jeffmcaffer for the reason you mentioned i would suggest to eject the application from CRA. Things like this one could be addressed by working on the Webpack configuration rather than applying workarounds. I hope to have the chance to discuss with you further more on this topic. |
folding property and syntax highlighting could be enabled only by customizing the Webpack plugin configuration: |
Following the issue microsoft/monaco-editor#82 there are different approaches proposed. Someone injects the external Monaco Editor library instead using it as a dependency, but with that approach is not possible to customize options. Other guys uses https://github.com/timarney/react-app-rewired , or https://github.com/harrysolovay/rescripts , that allows to override part of the Webpack configuration without ejecting, but i'm not so happy about these solutions, they would lost all the benefits of using CRA like an ejection does, and they are not standards. |
@storrisi I have found this background to be useful in understanding the issues in CRA configuration and "ejecting". This is one of the alternatives listed for react-app-rewired. Another one which looks promising is craco. Both of these claim to support customizing without resorting to "eject". So my question to you is: what are the benefits of "eject" that outweigh the solutions of rescripts or craco? NOTE also this recent approach to using monaco-editor. And the second question is: would this "recent approach" (using the https://github.com/bitauth/create-react-app-bitauth-ide fork of CRA) be "better" then either of the above (eject and ??, rescripts -or- craco w/o eject)? Realize that you would be hoping that the fork would continue to track upstream CRA (which may be risky). The answers here should guide the next attempt at upgrading. |
To document our discussion on Discord today I plan to investigate https://www.npmjs.com/package/@monaco-editor/react |
Replaces accomodations based on react-monaco-editor.. - src/components/MonacoEditorWrapper.js - src/utils/install-monaco.js ... with @monaco-editor/react - Updates RawDataRenderer accordingly - Adds certain new Monaco Editor options + cursorSmoothCaretAnimation: true, + cursorStyle: 'block', + cursorSurroundingLines: 1, + mouseWheelZoom: true FFI: https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditoroptions.html NOTE: folding is true by default Adds explicit dependency on typescript - As required by transitive deps: tsutils, ts-pnp Resolves: #639 Signed-off-by: Tom Marble <[email protected]>
Lower priority but at some point here we should look to update the
monaco-editor
andreact-monaco-editor
packages we are using. They are very old. Not sure there are substantial new features but they are likely >1 year old.need to be careful thought. The integration was not altogether easy with some funky file copying and a helper build function etc. Perhaps in the new versions they have simplified this?
The text was updated successfully, but these errors were encountered: