mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
Closes https://github.com/elastic/kibana/issues/205531 Closes #219877. Closes https://github.com/elastic/kibana/issues/213153 Closes https://github.com/elastic/kibana/issues/150920 Closes https://github.com/elastic/kibana/issues/203130 ### Overview The embeddable framework has two types of state: `SerializedState` and `RuntimeState`. `SerializedState` is the form of the state when saved into a Dashboard saved object. I.e. the References are extracted, and state saved externally (by reference) is removed. In contrast `RuntimeState` is an exact snapshot of the state used by the embeddable to render. <b>Exposing SerializedState and RuntimeState was a mistake</b> that caused numerous regressions and architectural complexities. This PR simplifies the embeddable framework by only exposing `SerializedState`. `RuntimeState` stays localized to the embeddable implementation and is never leaked to the embeddable framework. ### Whats changed * `ReactEmbeddableFactory<SerializedState, RuntimeState, Api>` => `EmbeddableFactory<SerializedState, Api>` * `deserializeState` removed from embeddable factory. Instead, `SerializedState` is passed directly into `buildEmbeddable`. * `buildEmbeddable` parameter `buildApi` replaced with `finalizeApi`. `buildApi({ api, comparators })` => `finalizeApi(api)`. * The embeddable framework previously used its knowledge of `RuntimeState` to setup and monitor unsaved changes. Now, unsaved changes setup is pushed down to the embeddable implementation since the embeddable framework no longer has knowledge of embeddable RuntimeState. ### Reviewer instructions <b>Please prioritize reviews.</b> This is a large effort from our team and is blocking many other initiatives. Getting this merged is a top priority. This is a large change that would best be reviewed by manually testing the changes * adding/editing your embeddable types * Ensuring dashboard shows unsaved changes as expected * Ensuring dashboard resets unsaved changes as expected * Ensuring dashboard does not show unsaved changes after save and reset * Returning to a dashboard with unsaved changes renders embeddables with those unsaved changes --------- Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com> Co-authored-by: Nathan Reese <reese.nathan@elastic.co> Co-authored-by: Nick Peihl <nick.peihl@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Catherine Liu <catherine.liu@elastic.co> Co-authored-by: Ola Pawlus <98127445+olapawlus@users.noreply.github.com> |
||
---|---|---|
.. | ||
kbn-babel-preset | ||
kbn-bazel-runner | ||
kbn-capture-oas-snapshot-cli | ||
kbn-check-mappings-update-cli | ||
kbn-check-prod-native-modules-cli | ||
kbn-ci-stats-performance-metrics | ||
kbn-ci-stats-shipper-cli | ||
kbn-cli-dev-mode | ||
kbn-dependency-ownership | ||
kbn-dependency-usage | ||
kbn-docs-utils | ||
kbn-eslint-config | ||
kbn-eslint-plugin-disable | ||
kbn-eslint-plugin-eslint | ||
kbn-eslint-plugin-eui-a11y | ||
kbn-eslint-plugin-i18n | ||
kbn-eslint-plugin-imports | ||
kbn-eslint-plugin-telemetry | ||
kbn-failed-test-reporter-cli | ||
kbn-find-used-node-modules | ||
kbn-generate | ||
kbn-generate-console-definitions | ||
kbn-import-locator | ||
kbn-json-ast | ||
kbn-kibana-manifest-schema | ||
kbn-lint-packages-cli | ||
kbn-lint-ts-projects-cli | ||
kbn-lock-manager | ||
kbn-managed-vscode-config | ||
kbn-managed-vscode-config-cli | ||
kbn-manifest | ||
kbn-mock-idp-plugin | ||
kbn-optimizer | ||
kbn-peggy-loader | ||
kbn-performance-testing-dataset-extractor | ||
kbn-picomatcher | ||
kbn-plugin-check | ||
kbn-plugin-generator | ||
kbn-plugin-helpers | ||
kbn-relocate | ||
kbn-repo-file-maps | ||
kbn-repo-linter | ||
kbn-repo-source-classifier | ||
kbn-repo-source-classifier-cli | ||
kbn-set-map | ||
kbn-sort-package-json | ||
kbn-styled-components-mapping-cli | ||
kbn-ts-projects | ||
kbn-ts-type-check-cli | ||
kbn-validate-next-docs-cli | ||
kbn-web-worker-stub | ||
kbn-whereis-pkg-cli | ||
kbn-yarn-lock-validator |