-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[ES UI Shared] Monaco XJSON #67485
[ES UI Shared] Monaco XJSON #67485
Conversation
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
@spalger I've created a new package |
Summary of changes I made:
Hope you don't mind me jumping in and applying these changes directly! |
@elasticmachine merge upstream |
Thanks a ton for sorting out the build and ops concerns @spalger ! This looks really great! I was thinking the worker would change very infrequently, but I think building at bootstrap is so cheap to do so happy with that change too 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Canvas changes look good to me
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KibanaApp Timelion usage LGTM, but in Painless lab I don't get the duplicate key message.
Thanks for the reviews all!
Looks like there was a minor issue with the worker bundle. Just fixed it, would you mind to taking another look @kertal @cjcenizal ? I saw that it was erroring; this commit ad9f4d2 fixed the grammar parsing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kibana App owned Code LGTM, tested locally with Chrome, last issue I reported is fixed, the duplicate JSON property is indicated 👍
import { shallow } from 'enzyme'; | ||
|
||
// disabled because this is a test, but also it seems we shouldn't need this? | ||
/* eslint-disable-next-line @kbn/eslint/module_migration */ | ||
import 'monaco-editor/esm/vs/basic-languages/html/html.contribution.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know if this is something we should add to @kbn/monaco
rather than importing it here? All other exclusions to this rule are in @kbn/monaco
itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, not sure. @poffdeluxe Do you have any guidance for us on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! It's extremely valuable for the ML and Transforms plugins.
monaco
setup code LGTM, but some basic unit tests for tokenizers would be nice to have as it involves regexps.
nit: I've observed a bunch of commented code inside of painless_lab
, you probably haven't finished with the clean up yet
Thanks for reviewing @darnautov !
Yep! I will need to revert all painless commits before merging. Good point about the unit tests! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally and looked through the code. Code organization generally made sense to me (the README helped, thanks!) though I'm not familiar with how Monaco works so not the best judge of code quality in this case. :)
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
I am going to merge this work, any other issues can be addressed in follow up PRs |
* First iteration of xjson in monaco * Throwaway implementation in painless lab - THIS MUST BE REVERTED * WiP on build process for new kbn-lang package * new @kbn/langs package and update ui-shared-deps * Update jest config for new work files * Update painless lab -- REVERT THIS COMMIT * Create shared useXJson mode hook * Final update to using the new shared useXJsonMode hook -- REVERT * Created @kbn/monaco and share through shared deps * always access monaco through `@kbn/monaco` * use path.resolve to create path * add basic readme * remove console.log call * remove typescript support from ui-shared-deps webpack config * use `@kbn/babel-preset` * include the monaco styles in the kbn-ui-shared-deps * sort package.json * build worker at bootstrap rather than commiting to repo * only build worker, don't pre-bundle monaco * fix type check errors * remove section from readme about committed dist * keep editor.worker.js postfix * forgot to save update to import * license package as apache-2.0 * Added regenerator runtime for worker bundle * revert changes to painless lab Co-authored-by: spalger <spalger@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* master: (26 commits) [Console]remove completion for type for filter queries and aggs (elastic#68103) [ML] Transforms: Filter aggregation support (elastic#67591) [ES UI Shared] Monaco XJSON (elastic#67485) [Index Management] Add data streams functionality to indices tab (elastic#67940) [Discover] Fix renaming of saved search not displayed in breadcrumb (elastic#67577) [SECURITY] Rename siem plugin to security_solution (elastic#67902) [Uptime] Fix Telemetry Api flaky test (elastic#67358) [Data plugin] Add configuration property to enable / disable autocomplete (elastic#67847) remove scripts. prettire update has been done (elastic#68130) Closes elastic#68055 by detecting the local Kibana version and using that as (elastic#68198) [apm] docs: add deployment annotation example (elastic#67408) [ML] Extend population preview chart to show actual and typical value (elastic#67569) Refactor index management client integration tests for scalability (elastic#67917) Add generator function that creates multiple alerts (elastic#67713) chore(NA): remove config arg from os packages (elastic#67871) [Reporting] Move code out of Legacy (elastic#67904) [Metrics UI] Add overrides to Snapshot API to support alert previews (elastic#68125) [Security] [Cases] Manage timeline UI API (elastic#67719) [ENDPOINT][INGEST]Task/endpoint ingest update (elastic#67234) Fix code coverage for jest, upload merged reports (elastic#68149) ...
* First iteration of xjson in monaco * Throwaway implementation in painless lab - THIS MUST BE REVERTED * WiP on build process for new kbn-lang package * new @kbn/langs package and update ui-shared-deps * Update jest config for new work files * Update painless lab -- REVERT THIS COMMIT * Create shared useXJson mode hook * Final update to using the new shared useXJsonMode hook -- REVERT * Created @kbn/monaco and share through shared deps * always access monaco through `@kbn/monaco` * use path.resolve to create path * add basic readme * remove console.log call * remove typescript support from ui-shared-deps webpack config * use `@kbn/babel-preset` * include the monaco styles in the kbn-ui-shared-deps * sort package.json * build worker at bootstrap rather than commiting to repo * only build worker, don't pre-bundle monaco * fix type check errors * remove section from readme about committed dist * keep editor.worker.js postfix * forgot to save update to import * license package as apache-2.0 * Added regenerator runtime for worker bundle * revert changes to painless lab Co-authored-by: spalger <spalger@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: spalger <spalger@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
Add XJSON mode support for Monaco. The intention is that this be used inside of Watcher, ML and any other new editors that we build so that we are able to use Monaco instead of Ace.
How to test
The XJSON should be highlighted correctly and indicate that there is a duplicate key "test".
Owners of specific sections
@kbn/langs
. In future I would like to put the grammar parsers for Console here too. This is similar to the@kbn/interpreter
folder which is apparently going to be removed before (8.0.0) CC (@ppisljar). The alternative is that we put this inside es-ui-shared too. Any alternate suggestions welcome of course. I was thinking we can also put SQL, EQL and any other parsers we build here (if we build them).useXJsonMode
works as expectedTODO
Screenshots
Additional Context
See this issue: #57435