-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Vega] Shim new platform #40032
[Vega] Shim new platform #40032
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is still a draft, so I just tried to answer questions and added a few notes. LMK if there are other questions that come up or when this is ready for a final review.
src/legacy/core_plugins/vega/public/vega_view/vega_base_view.js
Outdated
Show resolved
Hide resolved
4027d83
to
ee37f4e
Compare
import { VegaSetupPlugin } from './setup'; | ||
|
||
export class VegaPlugin { | ||
public async setup({ data, visualizations, legacy }: VegaSetupPlugin) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach where all legacy
stuff is injected into the shim instead of imported from ui/...
.
@elastic/kibana-app-arch Let's discuss it on Tuesday sync.
I would rename it to something like __LEGACY
and it would need to be a "plugin", not service. But I somehow like this much more than arbitrarily importing from ui/...
from various files within a shim. This way you explicitly see what legacy stuff your plugin still depends on.
Maybe we could have a convention where shims are in <legacy_plugin>/public/shim
folder and add a linter rule that does not allow to import anything from ui/...
in any of the <legacy_plugin>/public/shim/public/**
files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's certainly an option too. To prevent confusion, we should move this discussion over to #39554 and can report back here
|
||
// Temporary solution | ||
// It will be removed when all dependent services are migrated to the new platform. | ||
legacy: new LegacyDependenciesService(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we go with this legacy
approach, I guess it should be named "plugin", but does not really matter now.
Pinging @elastic/kibana-app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No other major concerns on my end, I think we just owe you some clarification on the conventions we want to be using for shimming. We are discussing this tomorrow and will follow up here with any final items; sorry for all the back and forth!
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
💔 Build Failed |
retest |
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me! There will be more shimming work to do later in the process (like removing some of the ui/chrome
imports), but those don't need to happen right now.
My only other comment would be that we should probably get rid of setup.ts
and either moving the contents of that file to legacy.ts
, or to the shim directory. This was one of the conventions we decided on recently... having legacy.ts
contain (or import) our shims and export the setup/start
contracts, rather than having a dedicated setup.ts
file.
Otherwise, everything LGTM!
💔 Build Failed |
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Summary
Part of #39915
1 Step of migrating to new Platform
What was done in this PR:
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers