Skip to content

feat: item.type se to "DRAFT_ISSUE" when item is a draft#40

Merged
gr2m merged 1 commit intomainfrom
remove-is-draft
Mar 26, 2022
Merged

feat: item.type se to "DRAFT_ISSUE" when item is a draft#40
gr2m merged 1 commit intomainfrom
remove-is-draft

Conversation

@mikesurowiec
Copy link
Copy Markdown
Collaborator

@mikesurowiec mikesurowiec commented Mar 25, 2022

This fixes the discriminated union type and reduces confusion of the data model since .isDraft exists on projectItem.content when the item is a PULL_REQUEST.

This also makes it possible to further break-out the types in the future if needed (for example: if type: "PULL_REQUEST" has different fields).

Note: this is a breaking change!

Initial discussion on previous PR #38 (comment)

fixes discriminated union type, reduces confusion since isDraft exists on projectItem.content when item is a PR
Copy link
Copy Markdown
Owner

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

Thanks 👍🏼

@gr2m gr2m changed the title BREAKING CHANGE: remove .isDraft from projectItem feat: item.type se to "DRAFT_ISSUE" when item is a draft Mar 26, 2022
Copy link
Copy Markdown
Owner

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

Usually I'd deprecate item.isDraft first and would log a deprecation message, then in another release remove the deprecated API. Ideally breaking changes include only removal of previously deprecated APIs. But this is still a new project without a lot of usage, it's not worth the trouble

@gr2m gr2m merged commit 514dd18 into main Mar 26, 2022
@gr2m gr2m deleted the remove-is-draft branch March 26, 2022 05:08
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants