-
Notifications
You must be signed in to change notification settings - Fork 69
lib!: refactor HTTP bindings and specifications #165
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
lib!: refactor HTTP bindings and specifications #165
Conversation
f7eb9ca
to
8c8cb2e
Compare
f0a2be4
to
7da3127
Compare
This is a breaking change. This commit makes a number of changes to the HTTP bindings code in an attempt to simplify its usage and implementation. From a very high level, this inverts the existing dependencies. As an example, consider `lib/bindings/http/receiver_structured_1.js`. https://github.com/cloudevents/sdk-javascript/blob/v1.0.0/lib/bindings/http/receiver_structured_0_3.js This class instantiates `lib/bindings/http/receiver_structured.js` and delegates its function invokations to it. This had the effect of requiring a user to know what event versions they would be receiving. And for me personally was a little confusing as a maintainer. The change introduced here reverses that logic, so that the version agnostic receiver is what the user instantiates. It instantiates the approrpiate version of a specific receiever and delegates to it - reversing the dependencies. I've also moved all of the top level directories related to HTTP versions into `lib/bindings/http/v1` and `lib/bindings/http/v03` and generally done some rearranging to make the repository structure cleaner and more organized. Signed-off-by: Lance Ball <lball@redhat.com>
Signed-off-by: Lance Ball <lball@redhat.com>
7da3127
to
ecd2b2c
Compare
Signed-off-by: Lance Ball <lball@redhat.com>
Signed-off-by: Lance Ball <lball@redhat.com>
<dl class="details"> | ||
|
||
|
||
|
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.
Why is there all of this whitespace?
Sorry I didn't get to review this in time. It seems like this PR has a lot of autogenerated HTML that will be in the npm package that isn't useful for consumers. Is that on purpose? |
Hey @grant. With @helio-frota's PR #147 last week, the package.json has been modified so that it will only include the source code - no docs or tests or examples. The |
😉 this is why I was proposing a grace period - after a PR is reviewed, but before it can be landed. |
This is a breaking change.
This commit makes a number of changes to the HTTP bindings code in an attempt
to simplify its usage and implementation. From a very high level, this inverts
the existing dependencies.
As an example, consider
lib/bindings/http/receiver_structured_1.js
.https://github.com/cloudevents/sdk-javascript/blob/v1.0.0/lib/bindings/http/receiver_structured_0_3.js
This class instantiates
lib/bindings/http/receiver_structured.js
and delegatesits function invokations to it. This had the effect of requiring a user to know what
event versions they would be receiving. And for me personally was a little confusing
as a maintainer.
The change introduced here reverses that logic, so that the version agnostic receiver
is what the user instantiates. It instantiates the approrpiate version of a specific
receiever and delegates to it - reversing the dependencies.
I've also moved all of the top level directories related to HTTP versions into
lib/bindings/http/v1
andlib/bindings/http/v03
and generally done some rearrangingto make the repository structure cleaner and more organized.
As a side effect:
Fixes: #162
Signed-off-by: Lance Ball lball@redhat.com