Skip to content

Conversation

@bennothommo
Copy link
Member

@bennothommo bennothommo commented Dec 13, 2022

Fixes #431. Related: wintercms/wn-builder-plugin#73
Screenshot 2026-01-02 at 1 02 11 AM
Screenshot 2026-01-02 at 1 02 40 AM
Screenshot 2026-01-02 at 1 03 25 AM

This PR introduces the Monaco editor in replacement of the Ace Editor. At this stage for the PR, we are aiming for parity with the functionality previously provided by Ace, with the intention of increasing the functionality after this PR is merged.

Still to do:

  • Support all prior configuration options.
  • Re-implement all previous themes, or find suitable alternatives (see https://github.com/brijeshb42/monaco-themes)
  • Ensure code editor works in all current core locations (settings areas, CMS editor, Builder plugin)
  • Try and figure out how to remove the automated loading of the Codicon font, as it's being implemented in the widget's CSS assets.

Changes:

  • Auto-completing tags preference is no longer available, as Monaco doesn't have this as an option.
  • Autocompletion and code snippets preferences are no longer available, as these are more contextual and will be implemented based on what is being edited in the editor.
  • Code folding is now a simple boolean.
  • The Crimson Editor theme has been dropped - I couldn't find a complete replica of this theme, and it looks too similar to other themes in the list.

Summary by CodeRabbit

  • New Features

    • Replaced legacy editor with a modern Monaco-based editor: minimap, bracket colors, inline color previews, richer language services, and many new themes.
  • Improvements

    • Unified editor preferences into a single backend plugin and refreshed editor styling, toolbar, and tab collapse icon behavior.
    • Asset/loading initialization updated for improved editor packaging.
  • Bug Fixes

    • Fixed duplicated render invocations causing double render handling.
  • Documentation

    • Added a README for the new editor integration.

✏️ Tip: You can customize this high-level summary in your review settings.

@bennothommo bennothommo added enhancement PRs that implement a new feature or substantial change Status: In Progress labels Dec 13, 2022
@bennothommo bennothommo added this to the v1.2.2 milestone Dec 13, 2022
@what-the-diff

This comment was marked as outdated.

For anyone else trying to track down self being clobbered, this is very handy:

(function () {
  try {
    const desc = Object.getOwnPropertyDescriptor(window, 'self');
    console.log('window.self descriptor:', desc);

    let _selfValue = window;
    Object.defineProperty(window, 'self', {
      configurable: true,
      get() { return _selfValue; },
      set(v) {
        console.error('window.self set to:', v);
        console.trace('stack:');     // <- prints the exact script/line
        _selfValue = v;
      },
    });
  } catch (e) {
    console.warn('Failed to trap window.self:', e);
  }
})();
@LukeTowers LukeTowers marked this pull request as ready for review January 2, 2026 07:14
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Also added build cleanup step to build process to avoid leaving behind artifacts from previous builds.
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

In theory only used by the Winter.Notify plugin, and even then, only if someone has a custom action defined that makes use of a codeeditor field.
@LukeTowers LukeTowers modified the milestones: 1.3.0, 1.2.10 Jan 21, 2026
@LukeTowers LukeTowers merged commit 5131f13 into develop Jan 21, 2026
14 checks passed
@LukeTowers LukeTowers deleted the wip/monaco-editor branch January 21, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that implement a new feature or substantial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch code editor to Monaco

4 participants