Welcome to the Prismic community and thanks for adding this PR.
In fact, we are planning to move this kit to the Prismic community Github organization, and we are actively looking for community code maintainers for this kit.
In the meantime I will have a look at this PR and get back to you ASAP,
Fares
Hi
Of course.
So the idea is in the first time to ask developers to use the new method in the factory. This method is just a bridge to the old one. The goals are:
Long term goal (next major version of the SDK)
To use the best practice to have a factory instead of a singleton mixing both instantiation logic and logic (the Api::get() method has two different roles, which is not appropriate).
Short term goals:
Be able to mock easily the creation of the connector.
This way to proceed do not create BC breaks.
In the next major release of the SDK, the method get() in the factory will contain the new logic of instantiation of the connector while it would have been removed from the Api class. It would leave some time to developers to prepare to the transition.
Explanation: using indirectly the deprecated method allows to prepare this "migration" slowly and with minimal changes in the code, hence minimizing the risk of breaking something.
Note:
As explained in my PR, I am note sure if we should allow ...$args in parameters or be more accurate and duplicate the method signature of the target Api::get() method.
Thanks, @eric.courtial for this extensive explanation, that makes total sense.
As I have mentioned before we are planning to move this kit to the Prismic community organization to make it totally managed by the community (we need to update those kits before moving them).
And for that, we are looking for code maintainers for our kits.
In fact, have already moved some of our kits and assigned community code maintainers to them.
So my question is; do you have an active interest in being a code maintainer of this kit?
And regarding the PR I have added the information you have provided, reviewed it, and I asked our dev team to have a final review and merge.
Fares
closed , flag & select 'Something Else' to reopen.
15
This thread is being monitored as an open ticket in the issue tracker. We will update this post as we get more information. If you have a similar use-case, you can ‘Flag’ this topic to reopen.