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

Make monaco editor work offline #619

Merged
merged 37 commits into from
Jul 5, 2022
Merged

Make monaco editor work offline #619

merged 37 commits into from
Jul 5, 2022

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Jul 1, 2022

Get rid of the @monaco-editor/react wrapper and write a custom React/Monaco integration.

Fixes #615

@render
Copy link

render bot commented Jul 1, 2022

@oliviertassinari oliviertassinari deployed to monaco-offline-wip - toolpad-db PR #619 July 1, 2022 23:34 — with Render Active
@mbrookes
Copy link
Member

mbrookes commented Jul 2, 2022

write a custom React/Monaco integration

🤯

@Janpot Janpot marked this pull request as draft July 2, 2022 10:14
@Janpot
Copy link
Member Author

Janpot commented Jul 2, 2022

Having more issues in CI than expected, converting to draft again

challenges faced in this PR:

  • monaco requires being able to load workers from url. It also imports CSS in its source files.
  • There is no official microsoft react wrapper for monaco, despite its name @monaco-editor/react is a 3rd party wrapper.
  • I'm using monaco-editor-webpack-plugin to build the workers. Next.js webpack setup supports loading workers now.
  • I inlined the css parts from next-transpile-modules. Using next-transpile-modules directly has too many issues. It makes it so the javascript is compiled as well and the the SWC compiler in next.js seems to compile them incorrectly. babel is too slow. We only need the css extracted.
    • yet it's still causing memory issues in CI. upgrading to a medium+ resource class helped. Trying to optimize the setup.
  • The react wrapper interface itself is similar to the @monaco-editor/react. We're going to use suspense to load the component instead.
  • Works well locally, in dev mode. But the docker smoke test is still failing and I'm seeing weird artificts in render.com. getting rid of monaco-editor-webpack-plugin seems to have solved this.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 3, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 3, 2022
@Janpot Janpot marked this pull request as ready for review July 3, 2022 14:27
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 4, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 4, 2022
@Janpot Janpot mentioned this pull request Jul 4, 2022
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 4, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 5, 2022
@Janpot Janpot merged commit 1d480cf into master Jul 5, 2022
@Janpot Janpot deleted the monaco-offline-wip branch July 5, 2022 15:38
@mbrookes
Copy link
Member

mbrookes commented Jul 9, 2022

Awesome work @Janpot !

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.

Make monaco work offline
3 participants