Skip to content

[WIP]Update monaco latest#242860

Draft
paulinashakirova wants to merge 17 commits into
elastic:mainfrom
paulinashakirova:update-monaco-latest
Draft

[WIP]Update monaco latest#242860
paulinashakirova wants to merge 17 commits into
elastic:mainfrom
paulinashakirova:update-monaco-latest

Conversation

@paulinashakirova
Copy link
Copy Markdown
Contributor

@paulinashakirova paulinashakirova commented Nov 13, 2025

Summary

This is a collaborative PR with some of the code from @eokoneyo's draft PR.

The main goal is to upgrade monaco editor that Renovate requested.
Here is the PR from Renovate with version bump, but because we have breaking changes and need more updates this PR is necessary.

@paulinashakirova paulinashakirova self-assigned this Nov 13, 2025
@paulinashakirova paulinashakirova added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Nov 13, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Nov 13, 2025

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!

Comment on lines +669 to +671
bracketPairColorization: {
enabled: false,
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have't tried out your PR however I noticed the former linked issue is still open, if it works somehow we'll need to apply this change in other places in the codebase that do the same for their custom implementation, see


// Mock navigator.clipboard for Monaco Editor 0.45.0+
// Monaco's Safari workaround cancels internal DeferredPromises, causing unhandled rejections in tests
Object.defineProperty(navigator, 'clipboard', {
Copy link
Copy Markdown
Contributor Author

@paulinashakirova paulinashakirova Nov 19, 2025

Choose a reason for hiding this comment

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

This workaround is defined in node_modules/monaco-editor/esm/vs/platform/clipboard/browser/clipboardService.js (lines 41-43 and 68 - 92)

   if (isSafari || isWebkitWebView) {
            this.installWebKitWriteTextWorkaround();
        }

},
],
},
});
Copy link
Copy Markdown
Contributor Author

@paulinashakirova paulinashakirova Nov 19, 2025

Choose a reason for hiding this comment

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

Removing this optimization because as @eokoneyo explained

in the version we upgrading away from, the file referenced in the exclude pattern because it was already transformed to ESM, so when we include it to be optimized (i.e treeshaking and the likes) it would break
hence why we excluded it from any kind of optimization and just use as is, and in the new version it doesn't cause any issues.

}

// Monaco's Safari workaround (added in 0.45.0) uses ClipboardItem, which doesn't exist in JSDOM
if (!Object.hasOwn(global, 'ClipboardItem')) {
Copy link
Copy Markdown
Contributor Author

@paulinashakirova paulinashakirova Nov 19, 2025

Choose a reason for hiding this comment

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

Before 0.45.0: Tests didn't need ClipboardItem because Monaco either used navigator.clipboard.writeText() or fell back to execCommand.
In 0.45.0: Monaco added the Safari-specific workaround that uses navigator.clipboard.write([new ClipboardItem({...})]), which requires both the ClipboardItem class.

@eokoneyo
Copy link
Copy Markdown
Contributor

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

merge conflict between base and head

@eokoneyo eokoneyo force-pushed the update-monaco-latest branch from ab501d2 to c126d8b Compare February 5, 2026 08:39
@eokoneyo eokoneyo linked an issue Feb 10, 2026 that may be closed by this pull request
@eokoneyo eokoneyo mentioned this pull request Feb 10, 2026
@eokoneyo eokoneyo force-pushed the update-monaco-latest branch 3 times, most recently from bc8ecd2 to 3025a2d Compare February 20, 2026 13:59
@eokoneyo eokoneyo force-pushed the update-monaco-latest branch 2 times, most recently from 1cc0b47 to bbc29a2 Compare March 3, 2026 08:08
Comment thread src/platform/test/functional/services/monaco_editor.ts Outdated
Comment thread src/platform/test/functional/page_objects/console_page.ts
Comment thread x-pack/platform/test/functional/services/actions/jsm.ts
Comment thread src/platform/test/functional/page_objects/console_page.ts
Comment thread src/platform/test/functional/page_objects/console_page.ts
@macroscopeapp

This comment was marked as duplicate.

@macroscopeapp

This comment was marked as duplicate.

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#11658

[❌] src/platform/test/functional/apps/console/config.ts: 0/15 tests passed.
[✅] src/platform/test/functional/apps/visualize/replaced_vislib_chart_types_3/config.ts: 15/15 tests passed.
[✅] src/platform/test/functional/apps/bundles/config.ts: 15/15 tests passed.
[❌] x-pack/platform/test/functional/apps/lens/group4/config.ts: 0/15 tests passed.
[❌] x-pack/platform/test/functional/apps/lens/group5/config.ts: 0/15 tests passed.
[✅] x-pack/platform/test/functional/apps/index_management/config.ts: 15/15 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#11700

[✅] x-pack/platform/test/functional/apps/index_management/config.ts: 15/15 tests passed.
[❌] x-pack/platform/test/functional_with_es_ssl/apps/triggers_actions_ui/config.ts: 14/15 tests passed.
[✅] x-pack/platform/test/serverless/functional/configs/search/config.group1.ts: 15/15 tests passed.
[✅] x-pack/solutions/search/test/functional_search/config/config.search_playground.ts: 15/15 tests passed.
[❌] src/platform/plugins/shared/workflows_management/test/scout_workflows_ui/ui/parallel.playwright.config.ts: 0/15 tests passed.

see run history

@elastic elastic deleted a comment from paulinashakirova May 20, 2026
@elastic elastic deleted a comment from paulinashakirova May 20, 2026
@elastic elastic deleted a comment from paulinashakirova May 20, 2026
@elastic elastic deleted a comment from paulinashakirova May 20, 2026
@elastic elastic deleted a comment from paulinashakirova May 20, 2026
@elastic elastic deleted a comment from paulinashakirova May 20, 2026
@elastic elastic deleted a comment from paulinashakirova May 20, 2026
paulinashakirova and others added 14 commits May 21, 2026 10:10
…torWrapper, improving error handling for test subjects.
The **/prettier: 3.8.1 resolution forced eslint-plugin-prettier@4.2.1's
nested prettier to 3.x, but the plugin calls prettier.resolveConfig.sync
which was removed in prettier 3 — breaking every lint batch in CI with
"TypeError: prettier.resolveConfig.sync is not a function".

Removing the resolution lets eslint-plugin-prettier resolve its
expected prettier@^2.x peer (2.8.8), matching how main is configured.
yarn.lock regenerated and verified stable across two bootstrap passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…code-editor

- Updated import paths in `use_editor_config.ts` to consolidate Monaco-related imports from `@kbn/code-editor`.
- Modified `worker_factory.ts` to import language IDs from their respective constants files.
- Adjusted `supported.ts` to streamline language exports from `@kbn/monaco`.
- Changed import statements in `use_workflow_events_on_decorations.ts` and its test file to utilize `@kbn/code-editor` instead of `@kbn/monaco` for consistency.
- Updated the addColumn method to include retry logic when clicking the 'indexEditorAddColumnButton' and setting the column type, enhancing reliability in the index editor functionality.
- Added a check to ensure the 'indexEditorColumnTypeSelect' exists before setting the column type, improving the robustness of the addColumn method in the index editor functionality.
- Added a clear step for the 'indexEditorColumnTypeSelect' combo box to prevent desynchronization issues with React state during re-renders.
- Included a verification step to ensure the 'indexEditorColumnNameInput' appears after setting the column type, enhancing the reliability of the addColumn functionality.
…error handling in worker factory

- Updated the access method for the Monaco environment in `WorkflowEditorPage` to remove TypeScript's `any` type casting, enhancing type safety.
- Improved error handling in `getWorkerUrl` by throwing an error when the Monaco bundle directory cannot be resolved, instead of returning an empty string.
…ally, or add an exception to src/dev/yarn_deduplicate/index.ts and then commit the changes and push to your branch
@eokoneyo eokoneyo force-pushed the update-monaco-latest branch from 5213392 to c0eb8f0 Compare May 21, 2026 08:30
@eokoneyo
Copy link
Copy Markdown
Contributor

/ci

@eokoneyo
Copy link
Copy Markdown
Contributor

@elasticmachine merge upstream

@eokoneyo
Copy link
Copy Markdown
Contributor

/ci

@paulinashakirova
Copy link
Copy Markdown
Contributor Author

/ci

@kibanamachine
Copy link
Copy Markdown
Contributor

kibanamachine commented May 22, 2026

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #48 / console app Console variables with inline variable interpolation in request body should send a successful request
  • [job] [logs] FTR Configs #48 / console app Console variables with inline variable interpolation in request body should send a successful request
  • [job] [logs] FTR Configs #104 / discover/esql_2 discover esql view resource browser returns focus to the editor when the data source picker is closed via Escape
  • [job] [logs] FTR Configs #104 / discover/esql_2 discover esql view resource browser returns focus to the editor when the data source picker is closed via Escape
  • [job] [logs] FTR Configs #115 / discover/esql_3 Index editor allows editing an existing index
  • [job] [logs] FTR Configs #115 / discover/esql_3 Index editor allows editing an existing index
  • [job] [logs] Scout Lane #46 - serverless-observability_complete / default / local-serverless-observability_complete - Hosts Page - Empty State - should show onboarding page when no data is present
  • [job] [logs] Scout Lane #51 - serverless-observability_complete / workflows_ui / local-serverless-observability_complete - Sanity tests for workflows - should show root-level property suggestions on empty lines
  • [job] [logs] Scout Lane #51 - serverless-observability_complete / workflows_ui / local-serverless-observability_complete - Sanity tests for workflows - should show root-level property suggestions on empty lines
  • [job] [logs] Scout Lane #62 - serverless-security_complete / workflows_ui / local-serverless-security_complete - Sanity tests for workflows - should show root-level property suggestions on empty lines
  • [job] [logs] Scout Lane #62 - serverless-security_complete / workflows_ui / local-serverless-security_complete - Sanity tests for workflows - should show root-level property suggestions on empty lines
  • [job] [logs] Scout Lane #10 - stateful-classic / default / local-stateful-classic - Hosts Page - Empty State - should show onboarding page when no data is present
  • [job] [logs] Scout Lane #12 - stateful-classic / default / local-stateful-classic - Profiling is setup and data is loaded - Admin user
  • [job] [logs] Scout Lane #31 - stateful-classic / workflows_ui / local-stateful-classic - Sanity tests for workflows - should show root-level property suggestions on empty lines
  • [job] [logs] Scout Lane #31 - stateful-classic / workflows_ui / local-stateful-classic - Sanity tests for workflows - should show root-level property suggestions on empty lines

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
console 389 391 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
console 207.9KB 212.2KB +4.3KB
esql 920.2KB 920.3KB +39.0B
lens 2.1MB 2.1MB +34.0B
streamsApp 2.0MB 2.0MB +39.0B
workflowsManagement 2.4MB 2.4MB +31.0B
total +4.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
agentBuilderWorkflows 21.7KB 21.7KB +39.0B
console 28.5KB 28.6KB +69.0B
kbnUiSharedDeps-css 109.6KB 137.6KB +28.1KB
kbnUiSharedDeps-fonts 71.9KB 88.6KB +16.7KB
kbnUiSharedDeps-srcJs 4.2MB 4.9MB ⚠️ +680.1KB
kibanaReact 19.2KB 19.2KB -1.0B
total +725.0KB
Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/code-editor 5 3 -2
@kbn/test-suites-xpack-security 74 73 -1
workflowsManagement 133 125 -8
total -11

Total ESLint disabled count

id before after diff
@kbn/code-editor 6 4 -2
@kbn/test-suites-xpack-security 76 75 -1
workflowsManagement 156 148 -8
total -11

History

cc @paulinashakirova

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade Monaco

6 participants