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] Simplify and organize Canvas plugin lifecycle #105675

Closed
2 of 20 tasks
clintandrewhall opened this issue Jul 14, 2021 · 3 comments · Fixed by #108473
Closed
2 of 20 tasks

[canvas] Simplify and organize Canvas plugin lifecycle #105675

clintandrewhall opened this issue Jul 14, 2021 · 3 comments · Fixed by #108473
Assignees
Labels
Feature:Canvas impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:large Large Level of Effort Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas technical debt Improvement of the software architecture and operational architecture v7.15.0 v8.0.0

Comments

@clintandrewhall
Copy link
Contributor

clintandrewhall commented Jul 14, 2021

Canvas appears to use setup dependencies in its mount function. Part of the problem here is not that Canvas is actually using setup dependencies, but that they're called setup dependencies, or we're using setup when we should be using either start dependencies or our own services.

Another issue is that setup, start and mount are all combined in a confusing way, obfuscating the true purpose of each portion of the lifecycle.

This issue will be considered complete when:

  • Remove the internal CanvasSrcPlugin class in favor of services.
  • The Canvas setup function accurately reflects setup tasks:
    • Create the ExpressionsService fork.
    • Create registries and return the "Canvas API", a set of functions which allow external plugins to add functions/renderers/etc to Canvas from their plugins.
    • Set the nav link/register with home/etc.
    • Create the mount function.
    • Nothing else.
  • The Canvas start function accurately reflects start tasks:
    • Migrate legacy services that rely on setup dependencies to the new Service Abstraction architecture.
    • Start Canvas Services.
      • Provide the ExpressionsService fork to the expressions service.
    • Start the Loading Indicator.
    • Nothing else.
  • The Canvas mount function accurately reflects mount activities:
    • Register renderers, functions, types, Canvas UI, etc with the registries created in setup.
    • Register Expression renderers, functions and types to the expressions service.
    • Render the application.

This will at least make the divide between the concerns much clearer to those looking at the code, but also avoid any non-compliance with #105439.

@clintandrewhall clintandrewhall added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:large Large Level of Effort technical debt Improvement of the software architecture and operational architecture v8.0.0 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Feature:Canvas v7.15.0 labels Jul 14, 2021
@clintandrewhall clintandrewhall self-assigned this Jul 14, 2021
@elasticmachine
Copy link
Contributor

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

@ppisljar
Copy link
Member

registering renderers and expression function later than in setup phase will prevent you from doing reference extraction/injection and migration on your saved objects correctly.

This will need to be fixed before 8.0 due to change in saved objects id as else all existing workpads with expressions referencing other saved objects will break.

@ThomThomson
Copy link
Contributor

Closing this for the time being as we aren't prioritizing Canvas tech debt currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Canvas impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:large Large Level of Effort Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas technical debt Improvement of the software architecture and operational architecture v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants