sync: dev to extern-contrib#998
Open
github-actions[bot] wants to merge 7 commits into
Open
Conversation
Monaco 0.53.0 declares its minified helper variables with `var` at the top level of every chunk file. AMD chunks are plain scripts rather than modules, so those helpers land on `window`: a live load leaks h, m, r, o, p, s, i, f, u, w, M, y and C. Different chunks give the same name different meanings -- `m` is the field-setter helper in language/css/monaco.contribution.js but is Object.defineProperty in yaml.contribution.6f43d486.js -- so whichever chunk script evaluates last wins. When yaml wins, the css chunk's `r(this, "_options")` call resolves to Object.defineProperty(this, "_options", undefined) and throws "Property description must be an object: undefined". The editor.main callback then never fires, ensureMonaco() times out after 30s, and submitpage.php falls back to the bare textarea. Evaluation order depends on network timing, which is why it only reproduces on some page loads. This is upstream microsoft/monaco-editor#5015, fixed in 0.54.0. cdnjs has no stable release newer than 0.53.0, and the rest of the script sources from cdnjs, so pin back to 0.52.2 -- it ships as a single bundle and leaks no globals at all. Also make ensureMonaco() single-flight. Overlapping callers (submit editor, merge view, freopen snippets) each appended their own loader.js, and the second loader resets the AMD registry while the first is still resolving modules. A failed load clears the cached promise so later calls can retry. Closes #991 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fix: pin Monaco to 0.52.2 to stop intermittent editor load failures
Deploying xmoj-script-dev-channel with
|
| Latest commit: |
a8e9df1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e95b0306.xmoj-script-dev-channel.pages.dev |
Contributor
|
🧙 Sourcery has finished reviewing your pull request! Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider making
ensureMonaco()consistently return aPromise(e.g.,return Promise.resolve()in thetypeof monaco !== 'undefined'fast path) so that callers can safelyawaitit without needing to special-case the already-loaded scenario.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider making `ensureMonaco()` consistently return a `Promise` (e.g., `return Promise.resolve()` in the `typeof monaco !== 'undefined'` fast path) so that callers can safely `await` it without needing to special-case the already-loaded scenario.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Update to release 3.6.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sync-branches: New code has just landed in dev, so let's bring extern-contrib up to speed!
Summary by Sourcery
Address Monaco editor loading issues and release version 3.5.4.
Bug Fixes:
Enhancements: