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

Update Kibana code editor dependencies #171720

Conversation

eokoneyo
Copy link
Contributor

@eokoneyo eokoneyo commented Nov 22, 2023

Summary

This PR started out as an attempt to resolve #166559; which it does, the appropriate colours for the message prompt displayed when an edit attempt on read only content is made in the code editor for both dark and light mode are now set;

Light mode

Screenshot 2023-11-22 at 11 30 17

Dark mode

Screenshot 2023-11-22 at 11 29 31

Noteworthy**

  • See https://code.visualstudio.com/api/references/theme-color for more clarification on the style definitions added to this PR
  • There's also been accommodation made for consumers of the code editor to provide their own custom message through the prop readOnlyMessage.
  • That been said it's worth pointing out that this PR updates react-monaco-editor and monaco-editor packages to their latest version, primarily because the functionality that provides support to provide customization for the providing a color scheme that would support in our use case for setting colors for dark mode and light mode appropriately, shipped in version 0.40.0 of monaco editor, also for react-monaco-editor prior to it's current latest the pinned version of monaco editor was 0.38.0.
  • Monaco-yaml is also updated in the PR, matching the change in expectation of the underlying monaco-editor api.
    - Updates to the packages referenced above, in turn caused the installed version of prettier to be updated to the latest minor version 2.8.8. This change caused some lint changes to the project files where parentheses were added to types with Index Access on another type created using the typeof operator (more context here), for this reason I've opted to lockdown prettier version, so that this PR only contains the changes required for updating the code editor. A subsequent PR will be created to revert the package lockdown so that PR contains only the lint changes that will occur.

Checklist

@eokoneyo eokoneyo added release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) labels Nov 22, 2023
@eokoneyo eokoneyo self-assigned this Nov 22, 2023
Comment on lines -1104 to +1144
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-transform-class-properties": "^7.23.3",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The babel package @babel/plugin-proposal-class-properties was also switched for @babel/plugin-transform-class-properties as the former is now deprecated.

@eokoneyo eokoneyo force-pushed the feat/resolve-visual-discrepancy-with-code-editor-in-dark-mode branch from 941d21d to 64d1cb1 Compare November 22, 2023 10:58
@eokoneyo eokoneyo marked this pull request as ready for review November 22, 2023 11:06
@eokoneyo eokoneyo requested review from a team as code owners November 22, 2023 11:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@eokoneyo eokoneyo force-pushed the feat/resolve-visual-discrepancy-with-code-editor-in-dark-mode branch 2 times, most recently from c17e579 to 8edea5a Compare November 22, 2023 11:17
@eokoneyo eokoneyo marked this pull request as draft November 22, 2023 11:48
@eokoneyo eokoneyo force-pushed the feat/resolve-visual-discrepancy-with-code-editor-in-dark-mode branch 5 times, most recently from 6119f9c to b1dbf3b Compare November 24, 2023 14:33
@@ -0,0 +1,27 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Co-locate yaml implementation for code editor within kbn-monaco, similar to how other languages are setup but have it load on demand.

@eokoneyo eokoneyo force-pushed the feat/resolve-visual-discrepancy-with-code-editor-in-dark-mode branch from b1dbf3b to ba7575f Compare November 24, 2023 16:13
@eokoneyo eokoneyo force-pushed the feat/resolve-visual-discrepancy-with-code-editor-in-dark-mode branch 4 times, most recently from 12d6f90 to a370dc8 Compare November 28, 2023 11:10
@eokoneyo eokoneyo force-pushed the feat/resolve-visual-discrepancy-with-code-editor-in-dark-mode branch 5 times, most recently from 8e352c9 to a01058d Compare December 8, 2023 00:15
Copy link
Contributor

@kc13greiner kc13greiner left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

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

Desk-tested the Tines connector changes. Everything works as expected.

Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

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

The Security solution team tested and approved the Tines connector. Approving to unblock the PR.

@eokoneyo
Copy link
Contributor Author

@elasticmachine merge upstream

@eokoneyo
Copy link
Contributor Author

@elasticmachine merge upstream

@eokoneyo eokoneyo enabled auto-merge (squash) January 24, 2024 17:15
@eokoneyo eokoneyo disabled auto-merge January 25, 2024 08:18
@eokoneyo
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
cloudDefend 110 108 -2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/monaco 96 99 +3

Async chunks

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

id before after diff
cloudDefend 262.1KB 231.9KB -30.1KB
observabilityAIAssistant 150.9KB 150.9KB +1.0B
savedObjectsManagement 82.3KB 82.3KB +2.0B
stackConnectors 520.5KB 520.5KB +45.0B
total -30.1KB

Page load bundle

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

id before after diff
cloudDefend 9.0KB 8.9KB -63.0B
kbnUiSharedDeps-css 250.3KB 286.2KB +35.9KB
kbnUiSharedDeps-fonts 69.3KB 71.9KB +2.6KB
kbnUiSharedDeps-srcJs 2.3MB 2.9MB ⚠️ +595.8KB
kibanaReact 40.4KB 40.4KB +9.0B
total +634.3KB
Unknown metric groups

API count

id before after diff
@kbn/code-editor 34 35 +1
@kbn/monaco 98 99 +1
total +2

ESLint disabled line counts

id before after diff
stackConnectors 106 105 -1

Total ESLint disabled count

id before after diff
stackConnectors 111 110 -1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @eokoneyo

@eokoneyo eokoneyo merged commit b25407e into elastic:main Jan 25, 2024
39 checks passed
@eokoneyo eokoneyo deleted the feat/resolve-visual-discrepancy-with-code-editor-in-dark-mode branch January 25, 2024 09:30
@kibanamachine kibanamachine added v8.13.0 backport:skip This commit does not require backporting labels Jan 25, 2024
jloleysens added a commit that referenced this pull request Jan 25, 2024
* main: (520 commits)
  Update Kibana code editor dependencies (#171720)
  [SLOs] Hide view in app in slo alerts table in slo details page (#175441)
  [api-docs] 2024-01-25 Daily api_docs build (#175502)
  [DOCS] Add buildkite links to doc preview comments (#175463)
  skip flaky suite (#175443)
  [Security Solution][Timeline] refactor timeline modal save timeline button (#175343)
  [RAM] Stack Management::Rules loses user selections when navigating back (#174954)
  [Security Solution][Timeline] refactor timeline modal attach to case button (#175163)
  Upgrade EUI to v92.1.1 (#174955)
  [Fleet]: Beta label is shown inconsistently while selecting proxy under Fleet settings. (#170634)
  [Cloud Security] Rules Combo Box filters Custom component (#175175)
  skip flaky suite (#175407)
  [Security Solution][Timeline] refactor timeline modal open timeline button (#175335)
  [Embedded Console] Introduce kbnSolutionNavOffset CSS variable (#175348)
  [Console] disable access to embedded console without dev tools capability (#175321)
  fix(x-pack/reporting): use FIPS-compliant ID generator `uuidv4` in Reporting plugin (#174809)
  [Security Solution] Data quality dashboard persistence (#173185)
  [RAM][Observability] Add alert fields table to Observability flyout (#174685)
  test: add missing await for connector table disappearance (#175430)
  [RAM][Maintenance Window] Fix maintenance window FE types and transforms  (#173888)
  ...
jbudz added a commit that referenced this pull request Jan 25, 2024
Adds the changes from
`packages/kbn-ui-shared-deps-src/webpack.config.js` in
#171720 to the canvas webpack
configuration. See inline comment for details.
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
## Summary

This PR started out as an attempt to resolve
elastic#166559; which it does, the
appropriate colours for the message prompt displayed when an edit
attempt on read only content is made in the code editor for both dark
and light mode are now set;

 ### Light mode
<img width="412" alt="Screenshot 2023-11-22 at 11 30 17"
src="https://github.com/elastic/kibana/assets/7893459/8675dd9f-b413-4098-a903-7ac63dc367fb">

### Dark mode
<img width="843" alt="Screenshot 2023-11-22 at 11 29 31"
src="https://github.com/elastic/kibana/assets/7893459/64fd39e0-d5dd-4556-b6ca-75ba8fc55c94">

#### Noteworthy**

- See https://code.visualstudio.com/api/references/theme-color for more
clarification on the style definitions added to this PR
- There's also been accommodation made for consumers of the code editor
to provide their own custom message through the prop `readOnlyMessage`.
- That been said it's worth pointing out that this PR updates
react-monaco-editor and monaco-editor packages to their latest version,
primarily because the functionality that provides support to provide
customization for the providing a color scheme that would support in our
use case for setting colors for dark mode and light mode appropriately,
shipped in version 0.40.0 of monaco editor, also for react-monaco-editor
prior to it's current latest the pinned version of monaco editor was
0.38.0.
- Monaco-yaml is also updated in the PR, matching the change in
expectation of the underlying monaco-editor api.
~- Updates to the packages referenced above, in turn caused the
installed version of prettier to be updated to the latest minor version
2.8.8. This change caused some lint changes to the project files where
parentheses were added to types with Index Access on another type
created using the typeof operator (more context
[here](prettier/prettier#14990)), for this
reason I've opted to lockdown prettier version, so that this PR only
contains the changes required for updating the code editor. A subsequent
PR will be created to revert the package lockdown so that PR contains
only the lint changes that will occur.~

### Checklist
<!--
Delete any items that are not applicable to this PR. -->

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
<!-- - [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios -->
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
<!-- - [ ] Any UI touched in this PR does not create any new axe
failures (run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
-->

---------

Co-authored-by: Aleh Zasypkin <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
Adds the changes from
`packages/kbn-ui-shared-deps-src/webpack.config.js` in
elastic#171720 to the canvas webpack
configuration. See inline comment for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Embedding Embedding content via iFrame Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-ux-management Observability Management User Experience Team Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Saved Objects] Difficult to read popup text when inspecting saved object in dark mode