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

Transpile packages on demand, validate all TS projects #146212

Merged
merged 34 commits into from
Dec 23, 2022

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Nov 23, 2022

Dearest Reviewers 👋

I've been working on this branch with @mistic and @tylersmalley and we're really confident in these changes. Additionally, this changes code in nearly every package in the repo so we don't plan to wait for reviews to get in before merging this. If you'd like to have a concern addressed, please feel free to leave a review, but assuming that nobody raises a blocker in the next 24 hours we plan to merge this EOD pacific tomorrow, 12/22.

We'll be paying close attention to any issues this causes after merging and work on getting those fixed ASAP. 🚀


The operations team is not confident that we'll have the time to achieve what we originally set out to accomplish by moving to Bazel with the time and resources we have available. We have also bought ourselves some headroom with improvements to babel-register, optimizer caching, and typescript project structure.

In order to make sure we deliver packages as quickly as possible (many teams really want them), with a usable and familiar developer experience, this PR removes Bazel for building packages in favor of using the same JIT transpilation we use for plugins.

Additionally, packages now use kbn_references (again, just copying the dx from plugins to packages).

Because of the complex relationships between packages/plugins and in order to prepare ourselves for automatic dependency detection tools we plan to use in the future, this PR also introduces a "TS Project Linter" which will validate that every tsconfig.json file meets a few requirements:

  1. the chain of base config files extended by each config includes tsconfig.base.json and not tsconfig.json

  2. the include config is used, and not files

  3. the exclude config includes target/**/*

  4. the outDir compiler option is specified as target/types

  5. none of these compiler options are specified: declaration, declarationMap, emitDeclarationOnly, skipLibCheck, target, paths

  6. all references to other packages/plugins use their pkg id, ie:

    // valid
    {
      "kbn_references": ["@kbn/core"]
    }
    // not valid
    {
      "kbn_references": [{ "path": "../../../src/core/tsconfig.json" }]
    }
  7. only packages/plugins which are imported somewhere in the ts code are listed in kbn_references

This linter is not only validating all of the tsconfig.json files, but it also will fix these config files to deal with just about any violation that can be produced. Just run node scripts/ts_project_linter --fix locally to apply these fixes, or let CI take care of automatically fixing things and pushing the changes to your PR.

Example: 64e93e5 (#146212) When I merged main into my PR it included a change which removed the @kbn/core-injected-metadata-browser package. After resolving the conflicts I missed a few tsconfig files which included references to the now removed package. The TS Project Linter identified that these references were removed from the code and pushed a change to the PR to remove them from the tsconfig.json files.

No bazel? Does that mean no packages??

Nope! We're still doing packages but we're pretty sure now that we won't be using Bazel to accomplish the 'distributed caching' and 'change-based tasks' portions of the packages project.

This PR actually makes packages much easier to work with and will be followed up with the bundling benefits described by the original packages RFC. Then we'll work on documentation and advocacy for using packages for any and all new code.

We're pretty confident that implementing distributed caching and change-based tasks will be necessary in the future, but because of recent improvements in the repo we think we can live without them for at least a year.

Wait, there are still BUILD.bazel files in the repo

Yes, there are still three webpack bundles which are built by Bazel: the @kbn/ui-shared-deps-npm DLL, @kbn/ui-shared-deps-src externals, and the @kbn/monaco workers. These three webpack bundles are still created during bootstrap and remotely cached using bazel. The next phase of this project is to figure out how to get the package bundling features described in the RFC with the current optimizer, and we expect these bundles to go away then. Until then any package that is used in those three bundles still needs to have a BUILD.bazel file so that they can be referenced by the remaining webpack builds.

@spalger spalger force-pushed the implement/babel-register-packages branch 16 times, most recently from 274b3f4 to cd4ea7a Compare November 29, 2022 23:16
@spalger spalger force-pushed the implement/babel-register-packages branch 2 times, most recently from b05725d to 723f0e1 Compare December 5, 2022 15:55
@spalger spalger force-pushed the implement/babel-register-packages branch from 5a2270c to 82c4612 Compare December 7, 2022 20:10
@mistic
Copy link
Member

mistic commented Dec 16, 2022

I've made some progress on this PR. CI is now green and it is in sync with the latest main. The only thing that catch my eye with this PR and that probably need a bit more work is related to CI workers for Jest unit tests. They doubled with this PR and the CI is consistent around 1h30mins

@spalger spalger force-pushed the implement/babel-register-packages branch from 2fad901 to 92014fb Compare December 20, 2022 22:18
@kibana-ci
Copy link
Collaborator

kibana-ci commented Dec 22, 2022

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Security Solution Tests #2 / Import rules Imports a custom rule with exceptions

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 461 457 -4
canvas 1098 1096 -2
uiActionsEnhanced 162 160 -2
visTypeTimeseries 381 379 -2
total -10

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/cypress-config - 2 +2
@kbn/dev-utils 26 25 -1
@kbn/import-resolver 36 37 +1
@kbn/interpreter 41 43 +2
@kbn/kibana-manifest-schema 95 85 -10
@kbn/optimizer 46 45 -1
@kbn/peggy 10 0 -10
@kbn/repo-path - 8 +8
@kbn/shared-svg 0 2 +2
@kbn/test 221 225 +4
@kbn/ts-project-linter - 9 +9
@kbn/ts-projects - 16 +16
@kbn/type-summarizer 2 - -2
@kbn/type-summarizer-core 65 - -65
@kbn/utils 20 14 -6
total -51

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
@kbn/peggy 1 0 -1
@kbn/type-summarizer-core 1 - -1
total -2

Async chunks

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

id before after diff
aiops 750.6KB 737.7KB -12.9KB
apm 3.2MB 3.2MB -1.3KB
canvas 1.0MB 1023.2KB -4.9KB
cases 380.5KB 379.6KB -881.0B
charts 80.1KB 77.9KB -2.3KB
cloudFullStory 5.3KB 4.3KB -994.0B
cloudGainsight 2.7KB 2.1KB -615.0B
cloudSecurityPosture 131.8KB 131.8KB -1.0B
console 415.0KB 414.9KB -121.0B
core 145.6KB 145.5KB -143.0B
dashboard 377.5KB 364.0KB -13.6KB
data 52.7KB 52.7KB -2.0B
dataViewManagement 116.1KB 116.1KB -35.0B
dataVisualizer 380.0KB 379.2KB -794.0B
discover 418.6KB 414.2KB -4.4KB
enterpriseSearch 2.0MB 2.0MB -26.3KB
expressionGauge 18.7KB 18.6KB -139.0B
expressionHeatmap 91.3KB 89.1KB -2.2KB
expressionMetricVis 73.6KB 71.5KB -2.2KB
expressionPartitionVis 52.9KB 52.6KB -314.0B
expressions 28.4KB 28.4KB -4.0B
expressionXY 119.2KB 118.6KB -649.0B
filesManagement 94.2KB 83.4KB -10.8KB
fileUpload 851.3KB 850.9KB -357.0B
graph 461.2KB 450.5KB -10.7KB
home 161.5KB 153.3KB -8.2KB
imageEmbeddable 46.5KB 43.3KB -3.3KB
infra 1.2MB 1.2MB -6.1KB
kibanaOverview 46.8KB 40.5KB -6.3KB
kibanaUtils 60.8KB 60.8KB -2.0B
lens 1.3MB 1.3MB -9.2KB
lists 166.9KB 151.0KB -15.9KB
management 36.8KB 31.6KB -5.2KB
maps 2.7MB 2.7MB -10.7KB
ml 3.4MB 3.4MB -8.1KB
observability 525.3KB 520.5KB -4.7KB
osquery 1022.7KB 1022.7KB -3.0B
presentationUtil 130.3KB 129.7KB -646.0B
profiling 239.3KB 237.8KB -1.5KB
searchprofiler 160.9KB 160.9KB +10.0B
security 553.1KB 548.3KB -4.8KB
securitySolution 12.6MB 12.5MB -96.6KB
spaces 152.8KB 152.7KB -116.0B
stackAlerts 80.2KB 80.0KB -128.0B
stackConnectors 415.8KB 415.6KB -239.0B
synthetics 1.3MB 1.3MB -130.0B
telemetry 4.9KB 4.9KB -3.0B
transform 355.8KB 347.9KB -7.9KB
triggersActionsUi 685.5KB 685.5KB -3.0B
uiActionsEnhanced 138.9KB 135.1KB -3.8KB
unifiedFieldList 48.4KB 48.3KB -128.0B
unifiedSearch 249.3KB 249.1KB -178.0B
ux 163.3KB 162.0KB -1.3KB
visTypeTimeseries 511.7KB 507.7KB -4.0KB
visTypeVega 1.8MB 1.8MB +4.0B
visualizations 271.1KB 260.0KB -11.1KB
watcher 273.5KB 273.5KB -14.0B
total -306.6KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/bazel-packages 0 1 +1
@kbn/package-map - 1 +1
@kbn/synthetic-package-map 1 - -1
@kbn/test 11 12 +1
@kbn/ts-project-linter - 1 +1
@kbn/ts-projects - 1 +1
securitySolution 28 29 +1
total +5

Page load bundle

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

id before after diff
apm 30.8KB 28.9KB -1.8KB
cases 127.4KB 125.3KB -2.1KB
charts 45.8KB 45.8KB -77.0B
cloudExperiments 10.2KB 10.0KB -187.0B
cloudFullStory 3.4KB 3.4KB -1.0B
cloudGainsight 3.5KB 3.5KB -1.0B
cloudSecurityPosture 10.9KB 10.7KB -162.0B
core 391.0KB 347.1KB -43.9KB
data 408.0KB 408.3KB +208.0B
dataViewFieldEditor 22.8KB 23.1KB +297.0B
dataViews 45.6KB 45.8KB +214.0B
dataVisualizer 23.5KB 23.8KB +316.0B
esUiShared 159.1KB 154.0KB -5.1KB
expressions 98.7KB 97.3KB -1.3KB
fieldFormats 45.5KB 45.8KB +314.0B
fleet 118.5KB 118.5KB +2.0B
infra 85.9KB 84.1KB -1.9KB
kbnUiSharedDeps-srcJs 2.2MB 2.2MB -16.0KB
kibanaUtils 68.9KB 68.7KB -189.0B
ml 42.1KB 41.7KB -377.0B
observability 82.0KB 81.5KB -539.0B
osquery 48.3KB 48.2KB -125.0B
security 58.4KB 57.9KB -542.0B
stackConnectors 24.8KB 24.8KB -1.0B
synthetics 25.4KB 23.5KB -1.9KB
telemetry 21.7KB 19.7KB -2.0KB
timelines 87.4KB 87.1KB -300.0B
triggersActionsUi 114.6KB 114.0KB -628.0B
unifiedFieldList 36.2KB 36.5KB +316.0B
unifiedHistogram 4.8KB 4.7KB -81.0B
unifiedSearch 51.6KB 51.5KB -77.0B
visualizations 56.6KB 56.6KB -1.0B
total -77.7KB
Unknown metric groups

API count

id before after diff
@kbn/cypress-config - 2 +2
@kbn/dev-utils 30 28 -2
@kbn/import-resolver 43 45 +2
@kbn/kibana-manifest-schema 96 86 -10
@kbn/optimizer 47 45 -2
@kbn/peggy 21 0 -21
@kbn/repo-path - 11 +11
@kbn/test 265 269 +4
@kbn/ts-project-linter - 9 +9
@kbn/ts-projects - 27 +27
@kbn/type-summarizer 8 - -8
@kbn/type-summarizer-core 113 - -113
@kbn/utils 30 24 -6
total -107

ESLint disabled in files

id before after diff
@kbn/analytics-shippers-fullstory 1 2 +1
@kbn/analytics-shippers-gainsight 1 2 +1
@kbn/apm-synthtrace 3 4 +1
@kbn/babel-register - 2 +2
@kbn/bazel-packages 1 2 +1
@kbn/cli-dev-mode 1 2 +1
@kbn/core-deprecations-server-internal 2 3 +1
@kbn/core-metrics-collectors-server-internal 2 4 +2
@kbn/core-overlays-browser-internal 2 4 +2
@kbn/core-rendering-server-internal 2 4 +2
@kbn/core-saved-objects-api-server-internal 1 2 +1
@kbn/crypto-browser 1 2 +1
@kbn/docs-utils 3 4 +1
@kbn/es-query 1 2 +1
@kbn/eslint-plugin-disable 39 76 +37
@kbn/failed-test-reporter-cli 1 2 +1
@kbn/handlebars 5 9 +4
@kbn/i18n 2 3 +1
@kbn/monaco 5 10 +5
@kbn/optimizer 3 4 +1
@kbn/safer-lodash-set 5 8 +3
@kbn/securitysolution-io-ts-alerting-types 9 18 +9
@kbn/securitysolution-io-ts-list-types 14 28 +14
@kbn/shared-ux-file-picker 1 2 +1
@kbn/shared-ux-file-upload 1 2 +1
@kbn/shared-ux-link-redirect-app 1 2 +1
@kbn/storybook 1 2 +1
@kbn/ts-project-linter - 4 +4
actions 2 4 +2
apm 13 25 +12
bfetch 1 2 +1
canvas 4 7 +3
cases 17 27 +10
cloudFullStory 1 2 +1
cloudSecurityPosture 1 2 +1
console 3 5 +2
crossClusterReplication 2 4 +2
dashboardEnhanced 2 4 +2
data 2 4 +2
dataViewEditor 1 2 +1
dataViews 2 4 +2
discover 1 2 +1
embeddable 2 4 +2
embeddableEnhanced 2 4 +2
enterpriseSearch 1 2 +1
eventAnnotation 1 2 +1
expressionError 1 2 +1
expressionImage 1 2 +1
expressionMetric 1 2 +1
expressionRepeatImage 1 2 +1
expressionRevealImage 1 2 +1
expressions 5 9 +4
expressionTagcloud 1 2 +1
files 2 4 +2
fleet 9 15 +6
home 1 2 +1
indexLifecycleManagement 1 2 +1
indexManagement 4 8 +4
infra 8 15 +7
inspector 2 4 +2
kibanaReact 4 8 +4
kibanaUsageCollection 3 6 +3
kibanaUtils 2 4 +2
lens 3 6 +3
lists 5 10 +5
maps 28 42 +14
ml 3 6 +3
monitoring 7 14 +7
observability 7 10 +3
osquery 1 2 +1
reporting 1 2 +1
ruleRegistry 2 3 +1
savedSearch 1 2 +1
screenshotting 3 5 +2
securitySolution 76 134 +58
share 2 3 +1
snapshotRestore 1 2 +1
synthetics 6 11 +5
telemetry 6 11 +5
transform 3 6 +3
triggersActionsUi 3 5 +2
uiActionsEnhanced 4 8 +4
urlForwarding 1 2 +1
usageCollection 1 2 +1
ux 3 4 +1
visTypeTimelion 1 2 +1
visTypeTimeseries 3 6 +3
visTypeVislib 2 3 +1
visTypeXy 1 2 +1
visualizations 2 4 +2
total +322

ESLint disabled line counts

id before after diff
@kbn/alerts 2 3 +1
@kbn/analytics 1 2 +1
@kbn/analytics-client 18 36 +18
@kbn/analytics-shippers-elastic-v3-browser 4 8 +4
@kbn/analytics-shippers-elastic-v3-server 19 38 +19
@kbn/analytics-shippers-fullstory 5 10 +5
@kbn/apm-config-loader 2 4 +2
@kbn/apm-synthtrace 9 17 +8
@kbn/cases-components 1 2 +1
@kbn/cli-dev-mode 4 8 +4
@kbn/coloring 1 2 +1
@kbn/content-management-table-list 2 3 +1
@kbn/core-analytics-browser-internal 10 20 +10
@kbn/core-application-browser-internal 1 2 +1
@kbn/core-chrome-browser-internal 2 4 +2
@kbn/core-elasticsearch-client-server-internal 2 4 +2
@kbn/core-elasticsearch-server-internal 1 2 +1
@kbn/core-fatal-errors-browser-internal 4 8 +4
@kbn/core-http-server-internal 2 4 +2
@kbn/core-i18n-browser-internal 1 2 +1
@kbn/core-logging-browser-internal 3 6 +3
@kbn/core-logging-server-internal 8 16 +8
@kbn/core-metrics-collectors-server-internal 1 2 +1
@kbn/core-plugins-server-internal 4 8 +4
@kbn/core-root-browser-internal 4 8 +4
@kbn/core-root-server-internal 3 6 +3
@kbn/core-saved-objects-api-server-internal 6 12 +6
@kbn/core-saved-objects-base-server-internal 3 6 +3
@kbn/core-ui-settings-server-internal 1 2 +1
@kbn/datemath 1 2 +1
@kbn/docs-utils 8 16 +8
@kbn/es 0 2 +2
@kbn/eslint-plugin-disable 23 48 +25
@kbn/eslint-plugin-imports 1 2 +1
@kbn/handlebars 4 5 +1
@kbn/i18n 1 2 +1
@kbn/i18n-react 4 6 +2
@kbn/interpreter 5 8 +3
@kbn/journeys 1 2 +1
@kbn/ml-string-hash 2 4 +2
@kbn/optimizer 4 7 +3
@kbn/peggy-loader 1 2 +1
@kbn/rison 2 4 +2
@kbn/securitysolution-autocomplete 1 2 +1
@kbn/securitysolution-exception-list-components 2 3 +1
@kbn/securitysolution-io-ts-utils 1 2 +1
@kbn/securitysolution-list-api 6 12 +6
@kbn/securitysolution-list-hooks 1 2 +1
@kbn/securitysolution-t-grid 1 2 +1
@kbn/server-http-tools 1 2 +1
@kbn/shared-ux-avatar-user-profile-components 2 4 +2
@kbn/shared-ux-file-image 2 4 +2
@kbn/shared-ux-link-redirect-app 1 2 +1
@kbn/std 1 2 +1
@kbn/storybook 1 2 +1
@kbn/test 6 12 +6
@kbn/type-summarizer 2 - -2
@kbn/type-summarizer-core 1 - -1
@kbn/ui-shared-deps-npm 1 2 +1
@kbn/ui-shared-deps-src 2 3 +1
@kbn/ui-theme 2 4 +2
@kbn/user-profile-components 3 6 +3
actions 22 42 +20
advancedSettings 2 3 +1
aiops 30 58 +28
alerting 70 121 +51
apm 82 144 +62
canvas 32 52 +20
cases 58 97 +39
cloudChat 2 4 +2
cloudExperiments 4 8 +4
cloudFullStory 1 2 +1
cloudGainsight 1 2 +1
cloudSecurityPosture 11 15 +4
console 36 71 +35
controls 2 4 +2
core 7 14 +7
crossClusterReplication 7 14 +7
customIntegrations 11 20 +9
dashboard 6 10 +4
data 52 92 +40
dataViewFieldEditor 9 14 +5
dataViews 12 16 +4
dataVisualizer 46 92 +46
discover 40 81 +41
embeddable 7 14 +7
embeddableEnhanced 3 4 +1
enterpriseSearch 19 15 -4
esUiShared 13 24 +11
eventLog 4 7 +3
expressionError 5 7 +2
expressionGauge 2 3 +1
expressionHeatmap 2 3 +1
expressionLegacyMetricVis 5 8 +3
expressionMetricVis 2 4 +2
expressionPartitionVis 3 5 +2
expressions 16 25 +9
expressionTagcloud 2 3 +1
expressionXY 1 2 +1
fieldFormats 5 7 +2
fileUpload 4 7 +3
fleet 61 102 +41
globalSearch 3 4 +1
globalSearchBar 1 2 +1
graph 4 8 +4
grokdebugger 1 2 +1
home 10 17 +7
indexLifecycleManagement 1 2 +1
indexManagement 14 28 +14
infra 45 84 +39
ingestPipelines 15 30 +15
interactiveSetup 10 20 +10
kibanaReact 12 23 +11
kibanaUsageCollection 6 10 +4
kibanaUtils 12 23 +11
kubernetesSecurity 7 11 +4
lens 19 37 +18
licenseApiGuard 1 2 +1
lists 18 32 +14
maps 39 76 +37
ml 564 1124 +560
monitoring 18 36 +18
notifications 4 8 +4
observability 47 90 +43
osquery 109 199 +90
painlessLab 1 2 +1
presentationUtil 10 18 +8
profiling 9 15 +6
remoteClusters 2 3 +1
reporting 4 7 +3
rollup 5 10 +5
ruleRegistry 1 2 +1
savedObjectsFinder 1 2 +1
savedObjectsTagging 2 4 +2
savedObjectsTaggingOss 1 2 +1
screenshotMode 1 2 +1
screenshotting 6 12 +6
security 24 47 +23
securitySolution 436 760 +324
sessionView 6 9 +3
share 7 13 +6
snapshotRestore 3 6 +3
spaces 1 2 +1
stackAlerts 25 46 +21
stackConnectors 78 113 +35
synthetics 70 123 +53
taskManager 22 41 +19
telemetry 1 2 +1
telemetryCollectionManager 7 14 +7
telemetryManagementSection 1 2 +1
timelines 23 30 +7
transform 27 54 +27
triggersActionsUi 137 228 +91
uiActions 1 2 +1
uiActionsEnhanced 9 18 +9
unifiedFieldList 17 28 +11
unifiedHistogram 2 4 +2
unifiedSearch 23 42 +19
upgradeAssistant 9 17 +8
urlDrilldown 4 6 +2
usageCollection 2 3 +1
ux 9 16 +7
visDefaultEditor 4 7 +3
visTypeTable 4 5 +1
visTypeTimelion 5 7 +2
visTypeTimeseries 19 23 +4
visTypeVega 6 8 +2
visTypeXy 4 5 +1
visualizations 15 25 +10
watcher 3 6 +3
total +2374

References to deprecated APIs

id before after diff
@kbn/eslint-plugin-imports 0 1 +1
@kbn/find-used-node-modules 0 3 +3
@kbn/repo-source-classifier 0 1 +1
total +5

Total ESLint disabled count

id before after diff
@kbn/alerts 2 3 +1
@kbn/analytics 1 2 +1
@kbn/analytics-client 18 36 +18
@kbn/analytics-shippers-elastic-v3-browser 4 8 +4
@kbn/analytics-shippers-elastic-v3-server 19 38 +19
@kbn/analytics-shippers-fullstory 6 12 +6
@kbn/analytics-shippers-gainsight 1 2 +1
@kbn/apm-config-loader 2 4 +2
@kbn/apm-synthtrace 12 21 +9
@kbn/babel-register - 2 +2
@kbn/bazel-packages 1 2 +1
@kbn/cases-components 1 2 +1
@kbn/cli-dev-mode 5 10 +5
@kbn/coloring 1 2 +1
@kbn/content-management-table-list 2 3 +1
@kbn/core-analytics-browser-internal 10 20 +10
@kbn/core-application-browser-internal 1 2 +1
@kbn/core-chrome-browser-internal 2 4 +2
@kbn/core-deprecations-server-internal 2 3 +1
@kbn/core-elasticsearch-client-server-internal 2 4 +2
@kbn/core-elasticsearch-server-internal 1 2 +1
@kbn/core-fatal-errors-browser-internal 4 8 +4
@kbn/core-http-server-internal 2 4 +2
@kbn/core-i18n-browser-internal 1 2 +1
@kbn/core-logging-browser-internal 3 6 +3
@kbn/core-logging-server-internal 8 16 +8
@kbn/core-metrics-collectors-server-internal 3 6 +3
@kbn/core-overlays-browser-internal 2 4 +2
@kbn/core-plugins-server-internal 4 8 +4
@kbn/core-rendering-server-internal 2 4 +2
@kbn/core-root-browser-internal 4 8 +4
@kbn/core-root-server-internal 3 6 +3
@kbn/core-saved-objects-api-server-internal 7 14 +7
@kbn/core-saved-objects-base-server-internal 3 6 +3
@kbn/core-ui-settings-server-internal 1 2 +1
@kbn/crypto-browser 1 2 +1
@kbn/datemath 1 2 +1
@kbn/docs-utils 11 20 +9
@kbn/es 0 2 +2
@kbn/es-query 9 10 +1
@kbn/eslint-plugin-disable 62 124 +62
@kbn/eslint-plugin-imports 1 2 +1
@kbn/failed-test-reporter-cli 1 2 +1
@kbn/handlebars 9 14 +5
@kbn/i18n 3 5 +2
@kbn/i18n-react 4 6 +2
@kbn/interpreter 5 8 +3
@kbn/journeys 1 2 +1
@kbn/ml-string-hash 2 4 +2
@kbn/monaco 8 13 +5
@kbn/optimizer 7 11 +4
@kbn/peggy-loader 1 2 +1
@kbn/rison 2 4 +2
@kbn/safer-lodash-set 5 8 +3
@kbn/securitysolution-autocomplete 1 2 +1
@kbn/securitysolution-exception-list-components 2 3 +1
@kbn/securitysolution-io-ts-alerting-types 9 18 +9
@kbn/securitysolution-io-ts-list-types 14 28 +14
@kbn/securitysolution-io-ts-utils 1 2 +1
@kbn/securitysolution-list-api 6 12 +6
@kbn/securitysolution-list-hooks 1 2 +1
@kbn/securitysolution-t-grid 1 2 +1
@kbn/server-http-tools 1 2 +1
@kbn/shared-ux-avatar-user-profile-components 2 4 +2
@kbn/shared-ux-file-image 2 4 +2
@kbn/shared-ux-file-picker 1 2 +1
@kbn/shared-ux-file-upload 1 2 +1
@kbn/shared-ux-link-redirect-app 2 4 +2
@kbn/std 1 2 +1
@kbn/storybook 2 4 +2
@kbn/test 6 12 +6
@kbn/ts-project-linter - 4 +4
@kbn/type-summarizer 2 - -2
@kbn/type-summarizer-core 1 - -1
@kbn/ui-shared-deps-npm 1 2 +1
@kbn/ui-shared-deps-src 2 3 +1
@kbn/ui-theme 2 4 +2
@kbn/user-profile-components 3 6 +3
actions 24 46 +22
advancedSettings 2 3 +1
aiops 30 58 +28
alerting 71 122 +51
apm 95 169 +74
bfetch 6 7 +1
canvas 36 59 +23
cases 75 124 +49
cloudChat 2 4 +2
cloudExperiments 4 8 +4
cloudFullStory 2 4 +2
cloudGainsight 3 4 +1
cloudSecurityPosture 12 17 +5
console 39 76 +37
controls 2 4 +2
core 7 14 +7
crossClusterReplication 9 18 +9
customIntegrations 11 20 +9
dashboard 6 10 +4
dashboardEnhanced 7 9 +2
data 54 96 +42
dataViewEditor 3 4 +1
dataViewFieldEditor 9 14 +5
dataViews 14 20 +6
dataVisualizer 46 92 +46
discover 41 83 +42
embeddable 9 18 +9
embeddableEnhanced 5 8 +3
enterpriseSearch 20 17 -3
esUiShared 13 24 +11
eventAnnotation 1 2 +1
eventLog 4 7 +3
expressionError 6 9 +3
expressionGauge 2 3 +1
expressionHeatmap 2 3 +1
expressionImage 2 3 +1
expressionLegacyMetricVis 5 8 +3
expressionMetric 2 3 +1
expressionMetricVis 2 4 +2
expressionPartitionVis 3 5 +2
expressionRepeatImage 2 3 +1
expressionRevealImage 2 3 +1
expressions 21 34 +13
expressionTagcloud 3 5 +2
expressionXY 1 2 +1
fieldFormats 5 7 +2
files 3 5 +2
fileUpload 4 7 +3
fleet 70 117 +47
globalSearch 3 4 +1
globalSearchBar 1 2 +1
graph 4 8 +4
grokdebugger 1 2 +1
home 11 19 +8
indexLifecycleManagement 2 4 +2
indexManagement 18 36 +18
infra 53 99 +46
ingestPipelines 15 30 +15
inspector 3 5 +2
interactiveSetup 10 20 +10
kibanaReact 16 31 +15
kibanaUsageCollection 9 16 +7
kibanaUtils 14 27 +13
kubernetesSecurity 7 11 +4
lens 22 43 +21
licenseApiGuard 1 2 +1
lists 23 42 +19
maps 67 118 +51
ml 567 1130 +563
monitoring 25 50 +25
notifications 4 8 +4
observability 54 100 +46
osquery 110 201 +91
painlessLab 1 2 +1
presentationUtil 10 18 +8
profiling 9 15 +6
remoteClusters 2 3 +1
reporting 5 9 +4
rollup 5 10 +5
ruleRegistry 3 5 +2
savedObjectsFinder 1 2 +1
savedObjectsTagging 2 4 +2
savedObjectsTaggingOss 1 2 +1
savedSearch 1 2 +1
screenshotMode 1 2 +1
screenshotting 9 17 +8
security 26 49 +23
securitySolution 512 894 +382
sessionView 6 9 +3
share 9 16 +7
snapshotRestore 4 8 +4
spaces 1 2 +1
stackAlerts 25 46 +21
stackConnectors 82 117 +35
synthetics 76 134 +58
taskManager 22 41 +19
telemetry 7 13 +6
telemetryCollectionManager 7 14 +7
telemetryManagementSection 1 2 +1
timelines 23 30 +7
transform 30 60 +30
triggersActionsUi 140 233 +93
uiActions 1 2 +1
uiActionsEnhanced 13 26 +13
unifiedFieldList 17 28 +11
unifiedHistogram 2 4 +2
unifiedSearch 23 42 +19
upgradeAssistant 9 17 +8
urlDrilldown 4 6 +2
urlForwarding 1 2 +1
usageCollection 3 5 +2
ux 12 20 +8
visDefaultEditor 5 8 +3
visTypeTable 4 5 +1
visTypeTimelion 6 9 +3
visTypeTimeseries 22 29 +7
visTypeVega 6 8 +2
visTypeVislib 3 4 +1
visTypeXy 5 7 +2
visualizations 17 29 +12
watcher 3 6 +3
total +2696

History

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

@spalger spalger enabled auto-merge (squash) December 22, 2022 23:49
@spalger spalger disabled auto-merge December 23, 2022 01:00
@spalger spalger merged commit afb09cc into elastic:main Dec 23, 2022
@spalger spalger deleted the implement/babel-register-packages branch December 23, 2022 01:00
@kibanamachine kibanamachine added v8.7.0 backport:skip This commit does not require backporting labels Dec 23, 2022
cnasikas added a commit that referenced this pull request Dec 23, 2022
## Summary

In the new edit tags & edit assignees flyouts, I use `emotion` to add
CSS that makes the flyout body 100% in height. PR
#146212 introduces some changes
where `emotion` runs in development mode. Before this PR it wasn't. This
had as a result to break the styles in Cases. Our e2e tests did not
catch it because all tests in CI run in production mode.

### For maintainers

- [x] 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)
afgomez pushed a commit to afgomez/kibana that referenced this pull request Dec 27, 2022
Since elastic#146212 we use a development build of React. This has surfaced
some existing problems in the `UptimePageTemplateComponent`, namely a
`useMemo` hook that was calling other hooks inside it by caching a
component.

The wrapped component seems to have some extra styling for mobile users.
For now we will remove this change to make the Uptime plugin work again
and tackle the issues with mobile rendering in a different PR.
@vitaliidm
Copy link
Contributor

@spalger

It looks like this change broke Kibana debugging workflow

When I run debug-break command:

    "debug-break": "node --nolazy --inspect-brk scripts/kibana --dev",

and pausing application on break-point, in source file where break-point placed all imports are replaced with require imports

here is original codebase imports

/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */

import type {
  AlertInstanceContext,
  AlertInstanceState,
  RuleExecutorServices,
} from '@kbn/alerting-plugin/server';

import { firstValueFrom } from 'rxjs';
import type { LicensingPluginSetup } from '@kbn/licensing-plugin/server';
import { getFilter } from '../get_filter';
import type { BucketHistory } from '../alert_suppression/group_and_bulk_create';
import { groupAndBulkCreate } from '../alert_suppression/group_and_bulk_create';
import { searchAfterAndBulkCreate } from '../search_after_bulk_create';
import type { ITelemetryEventsSender } from '../../../telemetry/sender';
import type { UnifiedQueryRuleParams } from '../../rule_schema';
import type { ExperimentalFeatures } from '../../../../../common/experimental_features';
import { buildReasonMessageForQueryAlert } from '../reason_formatters';
import { withSecuritySpan } from '../../../../utils/with_security_span';
import { scheduleNotificationResponseActions } from '../../rule_response_actions/schedule_notification_response_actions';
import type { SetupPlugins } from '../../../../plugin_contract';
import type { RunOpts } from '../../rule_types/types';

and these are imports during break-point:

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.queryExecutor = void 0;
var _rxjs = require("rxjs");
var _get_filter = require("../get_filter");
var _group_and_bulk_create = require("../alert_suppression/group_and_bulk_create");
var _search_after_bulk_create = require("../search_after_bulk_create");
var _reason_formatters = require("../reason_formatters");
var _with_security_span = require("../../../../utils/with_security_span");
var _schedule_notification_response_actions = require("../../rule_response_actions/schedule_notification_response_actions");
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */

Screenshot 2023-01-04 at 16 08 38

It makes very complicated to navigate between source files, as names of imported methods are changed and no longer referencing a file where they were imported from.

Is it a known issue or any workarounds available at this moment? Thanks

@spalger
Copy link
Contributor Author

spalger commented Jan 4, 2023

Sorry about that @vitaliidm, fixed in #148407

spalger pushed a commit that referenced this pull request Jan 4, 2023
…48407)

In #146212 the default
`sourceMaps` config for babel register changed from `both` to `true`,
which creates the source maps but does not embed them in the compiled
output so that dev-tools are able to inspect them even though they are
not on the filesystem.

cc @vitaliidm
spalger pushed a commit that referenced this pull request Feb 7, 2023
After #146212 it feels like the
babel-register cache is getting invalidated more frequently for some
reason. The current version of the cache only stores a single cache
entry for each file path, which shouldn't be too big of a problem but
with these changes several versions of a file will be cached. The
performance seems about equal, but because the cache contains multiple
versions of a single file we should spend less time transpiling files
when switching branches often.

---------

Co-authored-by: kibanamachine <[email protected]>
@andrewthad
Copy link

@Karql has done a pretty good job documenting a possible regression caused by this in #154325 and I've been able to confirm that this issue is present in both 8.7.0 and 8.7.1. @spalger Are you able to confirm whether or not this PR is the cause?

@kbujold
Copy link

kbujold commented Jun 8, 2023

We are experiencing issues with external plugin build and webpack, see forum post . Could these changes be causing our plugin failure? We do not see this issue when running kibana dev only with a build image. We have no issues with Kibana 8.6.2.

image

@brenoandrade-wdrv
Copy link

This is the issue where the PR that fixes the above errors resides.

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 release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.