-
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] Remove 'brace' from es_ui_shared public #78033
[ES UI Shared] Remove 'brace' from es_ui_shared public #78033
Conversation
- moved expand and collapse logic back to es_ui_shared. It has nothing to do with ace - refactor the useXJson hook which bundled XJsonMode with it. This was convenient but ultimately inflates the amount of code Kibana needs to first load up in the client. Users will need to import XJsonMode and instantiate it when they want to use it. Updated existing usage. - Cleaned up Monaco namespace from es_ui_shared because of how useXJsonMode was refactored -- no longer exporting an editor specific instance means this code does not know about anything to do with code editors so it is decoupled from ace and monaco.
Nice, I support this approach. It looks like the code is asynchronously loaded by plugins because they are all loading ace in their async bundles and now the code from es_ui_shared is also being loaded async as a by product. Thanks for working to find a good option and I hope that we can start to transition some of the existing ACE usage to monaco in the coming months. |
@elasticmachine merge upstream |
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
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.
triggers_actions_ui changes LGTM
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.
LGTM, the 500kb increases of specific application async assets is offset by the 500kb decrease in page load asset size in my eyes.
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
page load bundle size
distributable file count
History
To update your PR or re-run it, just comment with: |
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.
LGTM! Thanks for creating those packages 👍
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.
ML and Transforms changes LGTM
* major wip * major wip * fix worker creation leak * just copy the file over for now * Remove xjson from static and from es_ui_shared entirely - moved expand and collapse logic back to es_ui_shared. It has nothing to do with ace - refactor the useXJson hook which bundled XJsonMode with it. This was convenient but ultimately inflates the amount of code Kibana needs to first load up in the client. Users will need to import XJsonMode and instantiate it when they want to use it. Updated existing usage. - Cleaned up Monaco namespace from es_ui_shared because of how useXJsonMode was refactored -- no longer exporting an editor specific instance means this code does not know about anything to do with code editors so it is decoupled from ace and monaco. * fix export of collapse and expand string literals Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> # Conflicts: # .github/CODEOWNERS # src/plugins/es_ui_shared/kibana.json
…#78427) * [ES UI Shared] Remove 'brace' from es_ui_shared public (#78033) * major wip * major wip * fix worker creation leak * just copy the file over for now * Remove xjson from static and from es_ui_shared entirely - moved expand and collapse logic back to es_ui_shared. It has nothing to do with ace - refactor the useXJson hook which bundled XJsonMode with it. This was convenient but ultimately inflates the amount of code Kibana needs to first load up in the client. Users will need to import XJsonMode and instantiate it when they want to use it. Updated existing usage. - Cleaned up Monaco namespace from es_ui_shared because of how useXJsonMode was refactored -- no longer exporting an editor specific instance means this code does not know about anything to do with code editors so it is decoupled from ace and monaco. * fix export of collapse and expand string literals Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> # Conflicts: # .github/CODEOWNERS # src/plugins/es_ui_shared/kibana.json * import brace json mode in raw vis editor Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
Actions taken:
src/plugins/es_ui_shared/public/console_lang
topackages/kbn-ace
, creating@kbn/ace
. The primary reason for this move is to reduce the initial amount of JS loaded when first starting Kibana.useXJsonMode
to not bundle an editor specific mode with it.import ... 'brace'
statements to@kbn/ace
.The result of this is a ~50% shrink in es_ui_shared. From
1.9mb
to1.0mb
unoptimised JS. es_ui_shared will shrink by a further ~30% once #74539 is merged.To plugin owners