-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Expose plugin contracts to Legacy platform #37218
Expose plugin contracts to Legacy platform #37218
Conversation
Pinging @elastic/kibana-platform |
671be56
to
c8a0c1b
Compare
💚 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.
LGTM.
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.
The changes within respect to the operations team LGTM
src/core/public/map_to_object.ts
Outdated
* under the License. | ||
*/ | ||
|
||
export function mapToObject(map: Map<string, unknown>) { |
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'd prefer this file to exist in src/core/utils
rather than litter the top-level public
directory of core.
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 can move, np. afair we were going to remove this folder. aren't we?
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.
as for me I'm fine to keep this folder for such env-agnostic utils
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.
We discussed real quick and decided we're fine with the src/core/utils
directory existing for only very generic vanilla JS utilities similar to what you'd find in lodash or a standard library.
src/core/public/map_to_object.ts
Outdated
|
||
export function mapToObject(map: Map<string, unknown>) { | ||
const result: Record<string, unknown> = Object.create(null); | ||
for (const [key, value] of map) { |
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.
Object.fromEntries(map.entries())
?
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 tried. but TS told me this is too fresh syntax 😄
another interesting case for you, TS allows me to use [].flatMap
, because:
// tsconfig.ts
// Node 8 should support everything output by esnext, we override this
// in webpack with loader-level compiler options
"target": "esnext",
but it's not implemented in node v10, they added it in v11.
so our TS setup is a bit misleading
💚 Build Succeeded |
* expose plugin contracts to Legacy platform * move mapToObject to src/core/utils
* expose plugin contracts to Legacy platform * move mapToObject to src/core/utils
Summary
Expose plugin contracts to Legacy platform and unify
LegacyService.setup/start
interfaces for server and client parts.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] Documentation was added for features that require explanation or tutorials[ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
Dev Docs
If you want to use a New Platform plugin in Legacy Platform you could access them