-
Notifications
You must be signed in to change notification settings - Fork 17
Use BaseController class for controllers #388
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
Conversation
Codecov Report
@@ Coverage Diff @@
## 6-dev #388 +/- ##
==========================================
+ Coverage 96.65% 96.65% +<.01%
==========================================
Files 30 30
Lines 1435 1437 +2
==========================================
+ Hits 1387 1389 +2
Misses 48 48
Continue to review full report at Codecov.
|
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 the idea (and this looks more like an enhancement than a new feature to me), but I disagree with the actions exposure being implicit.
I would prefer that you add an init
function (possibly returning a promise?) that explicitly declares what actions can be performed for that registering controller.
Or any other method of your choice, as long as it's explicit. :)
@scottinet I didn't understand what you mean by explicitly declare what actions can be performed for that registering controller. Since the controller is a class, is not the SDK responsibility to allow or disallow method calling. If we weren't in JS, we would have the I could wrap the controller class with a Proxy or something but I didn't really see the point here. |
@Aschen > You have a point. |
Add a page about how to extend the JS SDK with custom controllers. https://deploy-preview-284--kuzzle-doc-v2.netlify.com/sdk-reference/js/6/extend-sdk/ Also document: - BaseController class - Kuzzle.useController method See kuzzleio/sdk-javascript#388
# [6.1.1](https://github.com/kuzzleio/sdk-javascript/releases/tag/6.1.1) (2019-04-29) #### Bug fixes - [ [#384](#384) ] [fix] search API: "sort" and "search_after" must be in the requests body ([scottinet](https://github.com/scottinet)) #### Enhancements - [ [#388](#388) ] Use BaseController class for controllers ([Aschen](https://github.com/Aschen)) - [ [#385](#385) ] Add Realtime.createRestrictedUser method ([Aschen](https://github.com/Aschen)) #### Others - [ [#387](#387) ] SearchResult.next returns a new instance ([Aschen](https://github.com/Aschen)) ---
* Add documentation page about mappings (#271) Adds a documentation essentials page about mappings: dynamic mapping policy collection metadata properties types definitions Also update SDKs See kuzzleio/kuzzle#1257 * Embedded protocols (#286) Documentation for embedded protocols, notably for MQTT. * Extending the JS SDK with controllers (#284) Add a page about how to extend the JS SDK with custom controllers. https://deploy-preview-284--kuzzle-doc-v2.netlify.com/sdk-reference/js/6/extend-sdk/ Also document: - BaseController class - Kuzzle.useController method See kuzzleio/sdk-javascript#388 * [KZL-907] Getting started dev plugin (#276) ## What does this PR do? This PR responds to this [ticket](https://jira.kaliop.net/browse/KZL-907). Also, it increases the readability of documentation's plugin part. ### How should this be manually tested? [Netify](https://deploy-preview-276--kuzzle-doc-v2.netlify.com/plugins/1/essentials/introduction/) ### Other changes - Re-arrange plugin documentation path - Update dead link in boilerplate repository ### Boyscout Prettier * Release 2.1.1
Release 6.1.2 Bug fixes [ #398 ] Fix bulk return (Aschen) [ #394 ] Add default values for from/size to document:search (Aschen) [ #384 ] Fix search API: "sort" and "search_after" must be in the requests body (scottinet) Enhancements [ #390 ] Add authenticated property on Kuzzle object (Aschen) [ #395 ] Proxify kuzzle to avoid mistyping error (thomasarbona) [ #389 ] Remove usage of _meta (Aschen) [ #391 ] Add isConnected (Aschen) [ #388 ] Use BaseController class for controllers (Aschen) [ #385 ] Add Security.createRestrictedUser method (Aschen) Others [ #400 ] Fix large document search using scroll (stafyniaksacha) [ #387 ] SearchResult.next returns a new instance (Aschen)
What does this PR do?
I'm not sure if this is a new feature or an enhancement
This PR intend to unify the way we add/use controllers with the SDK. In this way we can have the same API when using our core controllers (
document
,collection
, etc.) and custom controllers made by users.All existing controllers are now inheriting from the
BaseController
class and they are added to the SDK withKuzzle.useController
instead of been manually instantiated.Example of custom controller
I know this look like a breaking change but since we never documented this feature by now it is not really one.
Documentation kuzzleio/documentation#284
How should this be manually tested?