Skip to content
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

BREAKING CHANGE: use string instead of enum for Version #561

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

lance
Copy link
Member

@lance lance commented Jul 19, 2023

TypeScript does not consider enum values equivalent, even if the string representation is the same. So, when a module imports cloudevents and also has a dependency on another module which also has a dependency on cloudevents this can cause conflicts where the CloudEvent.version attribute is not considered equal when, in fact, it is.

Changing the enum to a string is pretty straightforward, but should be considered a breaking change since TypeScript dependents will potentially fail the build with a change like this.

See: knative/func#1873 (comment)
Fixes: #323

TypeScript does not consider enum values equivalent, even if the string
representation is the same. So, when a module imports `cloudevents` and
also has a dependency on `cloudevents` this can cause conflicts where
the `CloudEvent.version` attribute is not considered equal when, in
fact, it is.

Changing the `enum` to a string is pretty straightforward, but should be
considered a breaking change since TypeScript dependents will
potentially fail the build with a change like this.

Signed-off-by: Lance Ball <[email protected]>
@lance lance requested a review from lholmquist July 19, 2023 02:51
Copy link
Contributor

@lholmquist lholmquist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lholmquist lholmquist merged commit 15f6505 into cloudevents:main Jul 19, 2023
6 checks passed
@lholmquist
Copy link
Contributor

@lance looks like the merging of this didn't have the effect we wanted(creating a major bump PR)

@lance
Copy link
Member Author

lance commented Jul 20, 2023

@lance looks like the merging of this didn't have the effect we wanted(creating a major bump PR)

I noticed that. I should have used BREAKING CHANGE!:. What do you think we should do here?

@lholmquist
Copy link
Contributor

maybe that "empty commit release as version" workflow, that we've done before?

lance added a commit to lance/sdk-javascript that referenced this pull request Jul 20, 2023
This is an empty commit that provides a reference to cloudevents#561
which was not considered a breaking change by release-please.

Release-As: 8.0.0

Signed-off-by: Lance Ball <[email protected]>
lholmquist pushed a commit that referenced this pull request Jul 20, 2023
This is an empty commit that provides a reference to #561
which was not considered a breaking change by release-please.

Release-As: 8.0.0

Signed-off-by: Lance Ball <[email protected]>
@lance
Copy link
Member Author

lance commented Jul 21, 2023

maybe that "empty commit release as version" workflow, that we've done before?

That didn't seem to work either... Hmm

@lholmquist
Copy link
Contributor

maybe the prefix of the commit should just be fix!: .......? I know that has worked in other repos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

const enums not supported in some transpilers
2 participants