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

Support Offline Usage by Making Monaco-Editor use Local Files #364

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

damionmounts
Copy link
Contributor

@damionmounts damionmounts commented Jan 19, 2024

By default, a dependency of Mquery, @monaco-editor/react, reaches to a CDN for files. This commit makes it so that these files (from monaco-editor, a peerDependency) are accessible locally under {URL}/monaco-vs/.... This allows for offline usage of Mquery.

Your checklist for this pull request

  • I've read the contributing guideline.
  • I've tested my changes by building and running mquery, and testing changed functionality (if applicable)
  • N/A: I've added automated tests for my change (if applicable, optional)
  • N/A: I've updated documentation to reflect my change (if applicable)

What is the current behaviour?

Mquery reaches out to a CDN (cdn.jsdelivr.net) for files necessary for the Monaco-Editor component to work.

What is the new behaviour?

Mquery grabs the files necessary for the Monaco-Editor component locally from {URL}/monaco-vs/....

Current → New Behavior: Network Activity

screenshot of Firefox network activity in Mquery

This image demonstrates network requests for editor files changing from the CDN to localhost.

Test plan

Use Mquery normally across each of these scenarios - witnessing the expected outcome.

  • Current Version
    • Use online - works fine
    • Use offline - CDN server not found
  • This Version
    • Use online - works fine
    • Use offline - works fine

Closing issues

Not related to any current issues.

By default, @monaco-editor/react reaches to a CDN for files.
This commit makes it so that these files (from monaco-editor, a peerDependency) are accessible locally via /public.
Copy link
Member

@msm-cert msm-cert left a comment

Choose a reason for hiding this comment

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

LGTM

@msm-cert
Copy link
Member

Hi,

thanks for doing this. It was on my mind for a long time, I just never had the time to fix this.

I will finally have more time to work on mquery over the coming months, so if you have any other problems/feature requests feel free to create an issue. But of course PRs are even more welcome 😄.

PR looks good, no comments there.

@msm-cert msm-cert merged commit 7cc923e into CERT-Polska:master Jan 19, 2024
10 checks passed
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.

2 participants