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

[FieldFormatters] Lazy load field formatter editors #106439

Merged
merged 11 commits into from
Jul 28, 2021

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented Jul 21, 2021

Summary

close #100366

  • Lazy load default field format editors separately only when we need to mount them
  • Also improve typescript a bit where the custom editor was mounted into editor tree

Page load bundle

Size improvement just 36Kb, but I still think it is worth it for such a simple change + it will add up as/if we get more field formatters and more complicated editors

Screen Shot 2021-07-26 at 12 59 23

How to test

I found the usages editors in the following places. Hope I am not missing anything. There is also a bit of code duplication between those:

  • src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.tsx:
    • Add runtime field
    • Edit existing field
  • src/plugins/index_pattern_field_editor/public/components/field_format_editor/format_editor.tsx:
    • Scripted field editor


export interface FormatEditorProps {
fieldType: string;
fieldFormat: FieldFormat;
fieldFormatId: string;
fieldFormatParams: { [key: string]: unknown };
fieldFormatEditors: any;
onChange: (change: { fieldType: string; [key: string]: any }) => void;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

After improving types, typescript highlighted type mismatch here. Looks like there is no fieldType: string; emitted from the editors so I removed it from here to fix types

};

describe('FieldFormatEditor', () => {
it('should render normally', async () => {
const component = shallow(
<FieldFormatEditor
fieldType="number"
fieldFormat={{} as DefaultFormatEditor}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently, this type was incorrect. Fixed casting in the test and in the file itself.


export class FieldFormatEditors {
private editors: Array<typeof DefaultFormatEditor> = [];
private editors: FieldFormatEditorFactory[] = [];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now instead of registering a component, we require to register a factory that creates the component. This allows to load the component async

@Dosant
Copy link
Contributor Author

Dosant commented Jul 26, 2021

@elasticmachine merge upstream

@Dosant Dosant marked this pull request as ready for review July 26, 2021 13:10
@Dosant Dosant requested a review from a team as a code owner July 26, 2021 13:10
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@Dosant Dosant changed the title lazy format editor [FieldFormatters] Lazy load field formatter editors Jul 26, 2021
@Dosant Dosant requested a review from mattkime July 26, 2021 13:10
@Dosant
Copy link
Contributor Author

Dosant commented Jul 27, 2021

@elasticmachine merge upstream

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

changes look good and work well

@Dosant
Copy link
Contributor Author

Dosant commented Jul 28, 2021

@elasticmachine merge upstream

@Dosant Dosant added the auto-backport Deprecated - use backport:version if exact versions are needed label Jul 28, 2021
@Dosant Dosant enabled auto-merge (squash) July 28, 2021 10:21
@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / Chrome UI Functional Tests.test/functional/apps/discover/_indexpattern_without_timefield·ts.discover app indexpattern without timefield should switch between with and without timefield using the browser back button

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:09:21]         └-: discover app
[00:09:21]           └-> "before all" hook in "discover app"
[00:09:21]           └-> "before all" hook in "discover app"
[00:29:43]           └-: indexpattern without timefield
[00:29:43]             └-> "before all" hook for "should not display a timepicker"
[00:29:43]             └-> "before all" hook for "should not display a timepicker"
[00:29:43]               │ info [test/functional/fixtures/es_archiver/index_pattern_without_timefield] Loading "mappings.json"
[00:29:43]               │ info [test/functional/fixtures/es_archiver/index_pattern_without_timefield] Loading "data.json"
[00:29:43]               │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [without-timefield] creating index, cause [api], templates [], shards [1]/[0]
[00:29:43]               │ info [o.e.c.r.a.AllocationService] [node-01] current.health="GREEN" message="Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[without-timefield][0]]])." previous.health="YELLOW" reason="shards started [[without-timefield][0]]"
[00:29:43]               │ info [test/functional/fixtures/es_archiver/index_pattern_without_timefield] Created index "without-timefield"
[00:29:43]               │ debg [test/functional/fixtures/es_archiver/index_pattern_without_timefield] "without-timefield" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:29:43]               │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [with-timefield] creating index, cause [api], templates [], shards [1]/[0]
[00:29:43]               │ info [o.e.c.r.a.AllocationService] [node-01] current.health="GREEN" message="Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[with-timefield][0]]])." previous.health="YELLOW" reason="shards started [[with-timefield][0]]"
[00:29:43]               │ info [test/functional/fixtures/es_archiver/index_pattern_without_timefield] Created index "with-timefield"
[00:29:43]               │ debg [test/functional/fixtures/es_archiver/index_pattern_without_timefield] "with-timefield" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:29:43]               │ info [o.e.c.m.MetadataMappingService] [node-01] [without-timefield/n2R6jA8eQHydU2EZWyYEiA] create_mapping
[00:29:43]               │ info [o.e.c.m.MetadataMappingService] [node-01] [with-timefield/OCgHLD_dQmO_MuFWBJPqVQ] update_mapping [_doc]
[00:29:43]               │ info [test/functional/fixtures/es_archiver/index_pattern_without_timefield] Indexed 1 docs into "without-timefield"
[00:29:43]               │ info [test/functional/fixtures/es_archiver/index_pattern_without_timefield] Indexed 1 docs into "with-timefield"
[00:29:43]               │ info [test/functional/fixtures/es_archiver/index_pattern_without_timefield] Indexed 2 docs into ".kibana"
[00:29:43]               │ debg Migrating saved objects
[00:29:43]               │ proc [kibana]   log   [10:55:43.132] [info][savedobjects-service] [.kibana_task_manager] INIT -> OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT. took: 2ms.
[00:29:43]               │ proc [kibana]   log   [10:55:43.136] [info][savedobjects-service] [.kibana] INIT -> OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT. took: 7ms.
[00:29:43]               │ proc [kibana]   log   [10:55:43.137] [info][savedobjects-service] [.kibana_task_manager] OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT -> OUTDATED_DOCUMENTS_SEARCH_READ. took: 5ms.
[00:29:43]               │ proc [kibana]   log   [10:55:43.138] [info][savedobjects-service] [.kibana] OUTDATED_DOCUMENTS_SEARCH_OPEN_PIT -> OUTDATED_DOCUMENTS_SEARCH_READ. took: 2ms.
[00:29:43]               │ proc [kibana]   log   [10:55:43.140] [info][savedobjects-service] [.kibana_task_manager] OUTDATED_DOCUMENTS_SEARCH_READ -> OUTDATED_DOCUMENTS_SEARCH_CLOSE_PIT. took: 3ms.
[00:29:43]               │ proc [kibana]   log   [10:55:43.142] [info][savedobjects-service] [.kibana_task_manager] OUTDATED_DOCUMENTS_SEARCH_CLOSE_PIT -> UPDATE_TARGET_MAPPINGS. took: 2ms.
[00:29:43]               │ proc [kibana]   log   [10:55:43.143] [info][savedobjects-service] [.kibana] Starting to process 2 documents.
[00:29:43]               │ proc [kibana]   log   [10:55:43.143] [info][savedobjects-service] [.kibana] OUTDATED_DOCUMENTS_SEARCH_READ -> OUTDATED_DOCUMENTS_TRANSFORM. took: 5ms.
[00:29:43]               │ proc [kibana]   log   [10:55:43.144] [info][savedobjects-service] [.kibana] OUTDATED_DOCUMENTS_TRANSFORM -> TRANSFORMED_DOCUMENTS_BULK_INDEX. took: 1ms.
[00:29:43]               │ proc [kibana]   log   [10:55:43.148] [info][savedobjects-service] [.kibana] TRANSFORMED_DOCUMENTS_BULK_INDEX -> OUTDATED_DOCUMENTS_SEARCH_READ. took: 4ms.
[00:29:43]               │ proc [kibana]   log   [10:55:43.149] [info][savedobjects-service] [.kibana_task_manager] UPDATE_TARGET_MAPPINGS -> UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK. took: 7ms.
[00:29:43]               │ info [o.e.t.LoggingTaskListener] [node-01] 24501 finished with response BulkByScrollResponse[took=968.3micros,timed_out=false,sliceId=null,updated=0,created=0,deleted=0,batches=0,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:29:43]               │ proc [kibana]   log   [10:55:43.152] [info][savedobjects-service] [.kibana] OUTDATED_DOCUMENTS_SEARCH_READ -> OUTDATED_DOCUMENTS_SEARCH_CLOSE_PIT. took: 4ms.
[00:29:43]               │ proc [kibana]   log   [10:55:43.154] [info][savedobjects-service] [.kibana] OUTDATED_DOCUMENTS_SEARCH_CLOSE_PIT -> OUTDATED_DOCUMENTS_REFRESH. took: 2ms.
[00:29:43]               │ proc [kibana]   log   [10:55:43.163] [info][savedobjects-service] [.kibana] OUTDATED_DOCUMENTS_REFRESH -> UPDATE_TARGET_MAPPINGS. took: 9ms.
[00:29:44]               │ proc [kibana]   log   [10:55:43.197] [info][savedobjects-service] [.kibana] UPDATE_TARGET_MAPPINGS -> UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK. took: 34ms.
[00:29:44]               │ info [o.e.t.LoggingTaskListener] [node-01] 24520 finished with response BulkByScrollResponse[took=19.7ms,timed_out=false,sliceId=null,updated=16,created=0,deleted=0,batches=1,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:29:44]               │ proc [kibana]   log   [10:55:43.252] [info][savedobjects-service] [.kibana_task_manager] UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK -> DONE. took: 103ms.
[00:29:44]               │ proc [kibana]   log   [10:55:43.253] [info][savedobjects-service] [.kibana_task_manager] Migration completed after 123ms
[00:29:44]               │ proc [kibana]   log   [10:55:43.301] [info][savedobjects-service] [.kibana] UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK -> DONE. took: 104ms.
[00:29:44]               │ proc [kibana]   log   [10:55:43.302] [info][savedobjects-service] [.kibana] Migration completed after 173ms
[00:29:44]               │ debg [test/functional/fixtures/es_archiver/index_pattern_without_timefield] Migrated Kibana index after loading Kibana data
[00:29:44]               │ debg [test/functional/fixtures/es_archiver/index_pattern_without_timefield] Ensured that default space exists in .kibana
[00:29:44]               │ debg replacing kibana config doc: {"defaultIndex":"without-timefield","timepicker:timeDefaults":"{  \"from\": \"2019-01-18T19:37:13.000Z\",  \"to\": \"now\"}"}
[00:29:44]               │ debg navigating to discover url: http://localhost:6111/app/discover#/
[00:29:44]               │ debg navigate to: http://localhost:6111/app/discover#/
[00:29:44]               │ debg browser[INFO] http://localhost:6111/app/discover?_t=1627469743452#/ 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:29:44]               │
[00:29:44]               │ debg browser[INFO] http://localhost:6111/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:29:44]               │ debg ... sleep(700) start
[00:29:45]               │ debg ... sleep(700) end
[00:29:45]               │ debg returned from get, calling refresh
[00:29:46]               │ debg browser[INFO] http://localhost:6111/app/discover?_t=1627469743452#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2019-01-18T19:37:13.000Z',to:now))&_a=(columns:!(),filters:!(),index:without-timefield,interval:auto,query:(language:kuery,query:''),sort:!()) 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:29:46]               │
[00:29:46]               │ debg browser[INFO] http://localhost:6111/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:29:46]               │ debg currentUrl = http://localhost:6111/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:%272019-01-18T19:37:13.000Z%27,to:now))&_a=(columns:!(),filters:!(),index:without-timefield,interval:auto,query:(language:kuery,query:%27%27),sort:!())
[00:29:46]               │          appUrl = http://localhost:6111/app/discover#/
[00:29:46]               │ debg TestSubjects.find(kibanaChrome)
[00:29:46]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:29:46]               │ debg ... sleep(501) start
[00:29:47]               │ debg ... sleep(501) end
[00:29:47]               │ debg in navigateTo url = http://localhost:6111/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:%272019-01-18T19:37:13.000Z%27,to:now))&_a=(columns:!(),filters:!(),index:without-timefield,interval:auto,query:(language:kuery,query:%27%27),sort:!())
[00:29:47]             └-> should not display a timepicker
[00:29:47]               └-> "before each" hook: global before each for "should not display a timepicker"
[00:29:47]               │ debg TestSubjects.exists(superDatePickerToggleQuickMenuButton)
[00:29:47]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerToggleQuickMenuButton"]') with timeout=2500
[00:29:48]               │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_task_manager_8.0.0_001/PnGGS59pQ1mgKF4RuTbyRQ] update_mapping [_doc]
[00:29:49]               │ debg --- retry.tryForTime error: [data-test-subj="superDatePickerToggleQuickMenuButton"] is not displayed
[00:29:50]               └- ✓ pass  (3.0s) "discover app indexpattern without timefield should not display a timepicker"
[00:29:50]             └-> should adapt sidebar fields when switching
[00:29:50]               └-> "before each" hook: global before each for "should adapt sidebar fields when switching"
[00:29:50]               │ debg TestSubjects.click(indexPattern-switch-link)
[00:29:50]               │ debg Find.clickByCssSelector('[data-test-subj="indexPattern-switch-link"]') with timeout=10000
[00:29:50]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switch-link"]') with timeout=10000
[00:29:50]               │ debg Find.setValue('[data-test-subj="indexPattern-switcher"] input', 'with-timefield')
[00:29:50]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switcher"] input') with timeout=10000
[00:29:50]               │ debg Find.clickByCssSelector('[data-test-subj="indexPattern-switcher"] [title="with-timefield"]') with timeout=10000
[00:29:50]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switcher"] [title="with-timefield"]') with timeout=10000
[00:29:50]               │ debg isGlobalLoadingIndicatorVisible
[00:29:50]               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:29:50]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:29:52]               │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:29:52]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:29:52]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:29:52]               │ debg TestSubjects.exists(field-@timestamp)
[00:29:52]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="field-@timestamp"]') with timeout=2500
[00:29:52]               │ debg TestSubjects.click(indexPattern-switch-link)
[00:29:52]               │ debg Find.clickByCssSelector('[data-test-subj="indexPattern-switch-link"]') with timeout=10000
[00:29:52]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switch-link"]') with timeout=10000
[00:29:52]               │ debg Find.setValue('[data-test-subj="indexPattern-switcher"] input', 'without-timefield')
[00:29:52]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switcher"] input') with timeout=10000
[00:29:53]               │ debg Find.clickByCssSelector('[data-test-subj="indexPattern-switcher"] [title="without-timefield"]') with timeout=10000
[00:29:53]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switcher"] [title="without-timefield"]') with timeout=10000
[00:29:53]               │ debg isGlobalLoadingIndicatorVisible
[00:29:53]               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:29:53]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:29:54]               │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:29:55]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:29:55]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:29:55]               │ debg Find.waitForAttributeToChange('[data-test-subj="discoverDocTable"]', 'data-render-complete', 'true')
[00:29:55]               │ debg Waiting up to 20000ms for data-render-complete to equal "true"...
[00:29:55]               │ debg Find.findByCssSelector('[data-test-subj="discoverDocTable"]') with timeout=10000
[00:29:55]               │ debg TestSubjects.exists(field-@timestamp)
[00:29:55]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="field-@timestamp"]') with timeout=2500
[00:29:57]               │ debg --- retry.tryForTime error: [data-test-subj="field-@timestamp"] is not displayed
[00:29:58]               └- ✓ pass  (8.3s) "discover app indexpattern without timefield should adapt sidebar fields when switching"
[00:29:58]             └-> should display a timepicker after switching to an index pattern with timefield
[00:29:58]               └-> "before each" hook: global before each for "should display a timepicker after switching to an index pattern with timefield"
[00:29:58]               │ debg TestSubjects.click(indexPattern-switch-link)
[00:29:58]               │ debg Find.clickByCssSelector('[data-test-subj="indexPattern-switch-link"]') with timeout=10000
[00:29:58]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switch-link"]') with timeout=10000
[00:29:58]               │ debg Find.setValue('[data-test-subj="indexPattern-switcher"] input', 'with-timefield')
[00:29:58]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switcher"] input') with timeout=10000
[00:29:58]               │ debg Find.clickByCssSelector('[data-test-subj="indexPattern-switcher"] [title="with-timefield"]') with timeout=10000
[00:29:58]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switcher"] [title="with-timefield"]') with timeout=10000
[00:29:58]               │ debg isGlobalLoadingIndicatorVisible
[00:29:58]               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:29:58]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:30:00]               │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:30:00]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:30:00]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:30:00]               │ debg TestSubjects.exists(superDatePickerToggleQuickMenuButton)
[00:30:00]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerToggleQuickMenuButton"]') with timeout=2500
[00:30:00]               └- ✓ pass  (2.5s) "discover app indexpattern without timefield should display a timepicker after switching to an index pattern with timefield"
[00:30:00]             └-> should switch between with and without timefield using the browser back button
[00:30:00]               └-> "before each" hook: global before each for "should switch between with and without timefield using the browser back button"
[00:30:00]               │ debg TestSubjects.click(indexPattern-switch-link)
[00:30:00]               │ debg Find.clickByCssSelector('[data-test-subj="indexPattern-switch-link"]') with timeout=10000
[00:30:00]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switch-link"]') with timeout=10000
[00:30:00]               │ debg Find.setValue('[data-test-subj="indexPattern-switcher"] input', 'without-timefield')
[00:30:00]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switcher"] input') with timeout=10000
[00:30:01]               │ debg Find.clickByCssSelector('[data-test-subj="indexPattern-switcher"] [title="without-timefield"]') with timeout=10000
[00:30:01]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switcher"] [title="without-timefield"]') with timeout=10000
[00:30:01]               │ debg isGlobalLoadingIndicatorVisible
[00:30:01]               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:30:01]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:30:02]               │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:30:03]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:30:03]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:30:03]               │ debg TestSubjects.exists(superDatePickerToggleQuickMenuButton)
[00:30:03]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerToggleQuickMenuButton"]') with timeout=2500
[00:30:05]               │ debg --- retry.tryForTime error: [data-test-subj="superDatePickerToggleQuickMenuButton"] is not displayed
[00:30:06]               │ debg TestSubjects.click(indexPattern-switch-link)
[00:30:06]               │ debg Find.clickByCssSelector('[data-test-subj="indexPattern-switch-link"]') with timeout=10000
[00:30:06]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switch-link"]') with timeout=10000
[00:30:06]               │ debg Find.setValue('[data-test-subj="indexPattern-switcher"] input', 'with-timefield')
[00:30:06]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switcher"] input') with timeout=10000
[00:30:06]               │ debg Find.clickByCssSelector('[data-test-subj="indexPattern-switcher"] [title="with-timefield"]') with timeout=10000
[00:30:06]               │ debg Find.findByCssSelector('[data-test-subj="indexPattern-switcher"] [title="with-timefield"]') with timeout=10000
[00:30:06]               │ debg isGlobalLoadingIndicatorVisible
[00:30:06]               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:30:06]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:30:08]               │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:30:08]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:30:08]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:30:08]               │ debg TestSubjects.exists(superDatePickerToggleQuickMenuButton)
[00:30:08]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerToggleQuickMenuButton"]') with timeout=2500
[00:30:09]               │ debg TestSubjects.exists(superDatePickerToggleQuickMenuButton)
[00:30:09]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerToggleQuickMenuButton"]') with timeout=2500
[00:30:09]               │ info Taking screenshot "/dev/shm/workspace/parallel/1/kibana/test/functional/screenshots/failure/discover app indexpattern without timefield should switch between with and without timefield using the browser back button.png"
[00:30:09]               │ info Current URL is: http://localhost:6111/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:%272019-01-18T19:37:13.000Z%27,to:now))&_a=(columns:!(),filters:!(),index:without-timefield,interval:auto,query:(language:kuery,query:%27%27),sort:!())
[00:30:09]               │ info Saving page source to: /dev/shm/workspace/parallel/1/kibana/test/functional/failure_debug/html/discover app indexpattern without timefield should switch between with and without timefield using the browser back button.html
[00:30:09]               └- ✖ fail: discover app indexpattern without timefield should switch between with and without timefield using the browser back button
[00:30:09]               │      Error: Expected timepicker not to exist
[00:30:09]               │       at Context.<anonymous> (test/functional/apps/discover/_indexpattern_without_timefield.ts:76:15)
[00:30:09]               │       at runMicrotasks (<anonymous>)
[00:30:09]               │       at processTicksAndRejections (internal/process/task_queues.js:95:5)
[00:30:09]               │       at Object.apply (node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:30:09]               │ 
[00:30:09]               │ 

Stack Trace

Error: Expected timepicker not to exist
    at Context.<anonymous> (test/functional/apps/discover/_indexpattern_without_timefield.ts:76:15)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Object.apply (node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
indexPatternFieldEditor 80 93 +13

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
indexPatternFieldEditor 29 36 +7

Async chunks

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

id before after diff
indexPatternFieldEditor 22.0KB 169.6KB +147.6KB
indexPatternManagement 546.7KB 547.4KB +649.0B
total +148.2KB

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
indexPatternFieldEditor 4 3 -1

Page load bundle

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

id before after diff
indexPatternFieldEditor 82.6KB 46.9KB -35.7KB
Unknown metric groups

API count

id before after diff
indexPatternFieldEditor 31 41 +10

async chunk count

id before after diff
indexPatternFieldEditor 1 13 +12

History

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

@Dosant Dosant merged commit ecea2e7 into elastic:master Jul 28, 2021
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:FieldFormatters release_note:skip Skip the PR/issue when compiling release notes v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[index patterns] Lazy load field format editor to reduce index pattern field editor bundle size
4 participants