Skip to content

Conversation

@jameskerr
Copy link
Contributor

Fixes #2915

The editor now loads without an internet connection. Instead of reaching out to a CDN, electron intercepts the request and serves it from node modules.

Here is the editor loaded.

CleanShot 2024-03-27 at 15 57 25@2x

And here is the sources tab revealing no network requests.

CleanShot 2024-03-27 at 15 57 17@2x

In order to get this working properly in development, I had to disable web security in the browser windows to allow for cross-origin javascript requests. This is only needed in development because we serve the html from a dev server. In production we serve the files from the same origin that we serve the monaco files, so they are on the same origin already.

I would love to test this in a release to make sure I stitched all the paths together correctly in a release environment.

Copy link
Contributor

@philrz philrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this out on Windows using an artifact from this Actions run and the editor came up fine with my Internet disconnected. LGTM! 👍

@jameskerr
Copy link
Contributor Author

Nice!

@jameskerr jameskerr merged commit d012848 into main Mar 28, 2024
@jameskerr jameskerr deleted the monaco branch March 28, 2024 16:18
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.

Monaco editor doesn't load when airgapped

3 participants