Closed
Conversation
mshustov
reviewed
Jul 2, 2020
| * pros: | ||
| * - no need to use symbols in kibana core for accesssing properties | ||
| * cons: | ||
| * - hackier solution, it requires a lot of small adjustments for binding the client instance |
Contributor
There was a problem hiding this comment.
yeah. that looks rather fragile.
mshustov
reviewed
Jul 2, 2020
| } | ||
|
|
||
| get transport () { | ||
| return this[kTransport] |
Contributor
There was a problem hiding this comment.
it can be as simple as _transport instead of using Symbol. not 100% safe, but Symbol doesn't provide full safety either.
Member
Author
|
Closing in favor of #1239 for now as we decided to start simple and only ship a restricted type definition file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal for offering first-class support to Kibana.
Requirements
transportconnectionPoolserializerclosechildextendononceemitImplementation
Currently, the idea is that the Kibana client will extend the base Client and hide the properties that should not be accessed by plugin users.
The main counterargument of this approach is that if Kibana core needs to access these methods, we'll need to re-expose them via symbols, for example:
A different solution is to exclude the properties we don't want to be accessed with a builder function.
In my opinion, the first method is more elegant, as it uses idiomatic JavaScript to solve the issue, but will require you to use symbols for accessing "private" APIs. The second method feels hackier, as we'll need to bind the client in some places, but it removes the need to use Symbols at all.
@elastic/kibana-platform what do you think?