-
Notifications
You must be signed in to change notification settings - Fork 69
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
Use Direct Object Creation Pattern, Do Not Use Builder Pattern #65
Use Direct Object Creation Pattern, Do Not Use Builder Pattern #65
Comments
LGTM |
I agree that this would be an improvement in the API. It makes me think about versioning. This is a breakable change to the API. So, presumably it would need a major version number bump. Does this become problematic reconciling the module version with the spec version? What is the thinking here? |
Good questions. I've updated the exact sample to be more consistent with Go and normal versioning. When |
No problems @lance, we may have versions higher than spec. Now we are are a kit and we have our own lifecycle that supports some spec versions and features. |
@grant @fabiojose should we consider trying to get this in for a 2.0.0 release? I think it's a nice change, and since we are making big API changes with the upcoming release, this might be the place for it. My only concern is that this is probably a pretty big change, touching lots of the underlying code. It might be a big PR that takes some time to hash through. WDYT? |
@lance Glad you like the proposed change. So long as there are tests, any number of PRs to make the change are fine. |
The JavaScript SDK uses a Java-like builder pattern for creating events.
This is not ideal as it is not very JavaScript-like, and is unnecessarily wordy. As we are in JavaScript, we can use direct JSON objects for creating the CloudEvent payload.
Here is a sample taken from the README:
Actual
Expected
The text was updated successfully, but these errors were encountered: