-
Notifications
You must be signed in to change notification settings - Fork 69
Rethink Versioning #132
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
Comments
That's in some ways what this pull request that landed yesterday was about. const { CloudEvent, HTTPReceiver } = require('cloudevent-sdk');
const ce = new CloudEvent();
// Produces
// CloudEvent {
// spec:
// Spec1 {
// payload:
// { specversion: '1.0',
// id: '888798a5-0a22-463a-b2d5-bd9a443c736b' },
// caller: [Function: CloudEvent] },
// formatter: JSONFormatter {},
// extensions: {} } And you can see the Once a With the changes that landed yesterday, when a I think your direct object notation could be a nice change. But that's already covered by #65 isn't it? |
Glad we're making progress. #65 should make this much easier, yes. |
It seems like #65 should cover what you are asking for here right? Can this be closed? |
Also related #124 |
No, they are separate. The non-builder pattern won't fix |
Oh, I must be confused then. I was thinking you wanted, in addition to the direct object notation, something that looks like this. const { CloudEvent, HTTPReceiver } = require('cloudevent-sdk');
const ce = new CloudEvent(); That's what just landed recently. What else are you thinking here? |
That looks like it solves the issue. If it landed, that should fix the issue. I think the README is out of date from the implementation then. Or perhaps both styles work now. |
Yes it is. I added this issue earlier this week to deal with that before releasing 2.0.0. |
Closing this, as I think we have come to resolution. If not, feel free to reopen and we can discuss further. |
When a developer wants to use CloudEvents, they think about an event, not which version they're using. The way this module is written is highly segmented towards the version of CloudEvent.
Rather than this:
Where
const v1
doesn't make much sense.We should have
It should be easy to create a CloudEvent:
We should remove the
v03
andv1
folders in the repo and just have oneCloudEvent
that can support multiple versions.The text was updated successfully, but these errors were encountered: