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

[Canvas] Cleanup services #194634

Merged
merged 45 commits into from
Oct 8, 2024

Conversation

Heenawter
Copy link
Contributor

@Heenawter Heenawter commented Oct 1, 2024

Closes #194050

Summary

This PR refactors the Canvas services to no longer use the PluginServiceProvider from the PresentationUtil plugin. Note that the Canvas storybooks are broken on main (and they have been for who knows how long) and so, while I did make some changes to the storybooks to make them compile, I didn't bother to get them fully functional.

Note that the Ecommerce workpad is broken - this is not due to this PR, it is a bug that is present on main.

Checklist

For maintainers

@Heenawter Heenawter added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:medium Medium Level of Effort technical debt Improvement of the software architecture and operational architecture release_note:skip Skip the PR/issue when compiling release notes impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 1, 2024
@elastic elastic deleted a comment from kibana-ci Oct 7, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We had to seperate this code out to avoid circular dependencies 🫠

@Heenawter Heenawter marked this pull request as ready for review October 7, 2024 22:03
@Heenawter Heenawter requested a review from a team as a code owner October 7, 2024 22:03
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@nreese nreese self-requested a review October 8, 2024 17:27
Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM - just a couple of nits that can be ignored
code review only

x-pack/plugins/canvas/public/components/app/index.tsx Outdated Show resolved Hide resolved
@@ -94,6 +96,7 @@ export const createDispatchedHandlerFactory = (
break;
case 'applyFilterAction':
filters.updateFilter(element.id, event.data);
dispatch(fetchAllRenderables());
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this a fix for something else? Why was dispatch added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was part of the circular dependencies fix, since we had to move fetchAllRenderables from updateFilter

@Heenawter Heenawter enabled auto-merge (squash) October 8, 2024 18:01
@Heenawter Heenawter merged commit 91c045d into elastic:main Oct 8, 2024
22 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11243312753

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
canvas 1291 1285 -6

Async chunks

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

id before after diff
canvas 1.1MB 1.1MB -13.6KB

Page load bundle

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

id before after diff
canvas 13.9KB 14.7KB +814.0B
Unknown metric groups

async chunk count

id before after diff
canvas 18 14 -4

ESLint disabled line counts

id before after diff
canvas 31 29 -2

References to deprecated APIs

id before after diff
canvas 96 90 -6

Total ESLint disabled count

id before after diff
canvas 35 33 -2

History

@Heenawter Heenawter deleted the cleanup-canvas-services_2024-09-26 branch October 8, 2024 20:37
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [Presentation Util] Cleanup services (#194201)

Manual backport

To create the backport manually run:

node scripts/backport --pr 194634

Questions ?

Please refer to the Backport tool documentation

@Heenawter
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

Heenawter added a commit to Heenawter/kibana that referenced this pull request Oct 9, 2024
Closes elastic#194050

## Summary

This PR refactors the Canvas services to no longer use the
`PluginServiceProvider` from the `PresentationUtil` plugin. Note that
the Canvas storybooks are broken on main (and they have been for who
knows how long) and so, while I did make some changes to the storybooks
to make them **compile**, I didn't bother to get them fully functional.

Note that the Ecommerce workpad is broken - this is not due to this PR,
it is a [bug](elastic#195297) that is
present on main.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [ ] 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)

<!--ONMERGE {"backportTargets":["8.x"]} ONMERGE-->

---------

Co-authored-by: Catherine Liu <[email protected]>
(cherry picked from commit 91c045d)
Heenawter added a commit that referenced this pull request Oct 9, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Canvas] Cleanup services
(#194634)](#194634)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-08T20:34:01Z","message":"[Canvas]
Cleanup services (#194634)\n\nCloses
https://github.com/elastic/kibana/issues/194050\r\n\r\n##
Summary\r\n\r\nThis PR refactors the Canvas services to no longer use
the\r\n`PluginServiceProvider` from the `PresentationUtil` plugin. Note
that\r\nthe Canvas storybooks are broken on main (and they have been for
who\r\nknows how long) and so, while I did make some changes to the
storybooks\r\nto make them **compile**, I didn't bother to get them
fully functional.\r\n\r\nNote that the Ecommerce workpad is broken -
this is not due to this PR,\r\nit is a
[bug](#195297) that
is\r\npresent on main.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n\r\n<!--ONMERGE
{\"backportTargets\":[\"8.x\"]}
ONMERGE-->\r\n\r\n---------\r\n\r\nCo-authored-by: Catherine Liu
<[email protected]>","sha":"91c045d698b2e68afd13f5d4bef9229d8a231abe","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","loe:medium","technical
debt","release_note:skip","impact:high","v9.0.0","backport:prev-minor"],"number":194634,"url":"https://github.com/elastic/kibana/pull/194634","mergeCommit":{"message":"[Canvas]
Cleanup services (#194634)\n\nCloses
https://github.com/elastic/kibana/issues/194050\r\n\r\n##
Summary\r\n\r\nThis PR refactors the Canvas services to no longer use
the\r\n`PluginServiceProvider` from the `PresentationUtil` plugin. Note
that\r\nthe Canvas storybooks are broken on main (and they have been for
who\r\nknows how long) and so, while I did make some changes to the
storybooks\r\nto make them **compile**, I didn't bother to get them
fully functional.\r\n\r\nNote that the Ecommerce workpad is broken -
this is not due to this PR,\r\nit is a
[bug](#195297) that
is\r\npresent on main.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n\r\n<!--ONMERGE
{\"backportTargets\":[\"8.x\"]}
ONMERGE-->\r\n\r\n---------\r\n\r\nCo-authored-by: Catherine Liu
<[email protected]>","sha":"91c045d698b2e68afd13f5d4bef9229d8a231abe"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194634","number":194634,"mergeCommit":{"message":"[Canvas]
Cleanup services (#194634)\n\nCloses
https://github.com/elastic/kibana/issues/194050\r\n\r\n##
Summary\r\n\r\nThis PR refactors the Canvas services to no longer use
the\r\n`PluginServiceProvider` from the `PresentationUtil` plugin. Note
that\r\nthe Canvas storybooks are broken on main (and they have been for
who\r\nknows how long) and so, while I did make some changes to the
storybooks\r\nto make them **compile**, I didn't bother to get them
fully functional.\r\n\r\nNote that the Ecommerce workpad is broken -
this is not due to this PR,\r\nit is a
[bug](#195297) that
is\r\npresent on main.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n\r\n<!--ONMERGE
{\"backportTargets\":[\"8.x\"]}
ONMERGE-->\r\n\r\n---------\r\n\r\nCo-authored-by: Catherine Liu
<[email protected]>","sha":"91c045d698b2e68afd13f5d4bef9229d8a231abe"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas technical debt Improvement of the software architecture and operational architecture v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Canvas] Simplify module level services
5 participants