gitify-app / gitify

GitHub notifications on your menu bar. Available on macOS, Windows & Linux.
https://gitify.io
MIT License
4.49k stars 257 forks source link

refactor: introduce branded types #1223

Closed dammy95 closed 3 months ago

dammy95 commented 3 months ago

Closes https://github.com/gitify-app/gitify/issues/1141

Created the following branded types:

Follow-up question: While attempting to create the URL branded type, I observed it clashes with JavaScript's URL class. There are also different variations of url (i.e thread_url, html_url, upload_url, etc) in the project that I'm unsure of how to handle – do I ignore these variations and create the branded type for the occurrences with url: string?

setchy commented 3 months ago

Awesome work @dammy95 - thank you 🙏

re: Url - all of those are full html urls... Maybe to avoid the conflict with the JavaScript URL class we can name it differently... perhaps Link or WebUrl. @afonsojramos @bmulholland - what do you guys think?

bmulholland commented 3 months ago

Link reads less awkwardly than WebUrl, at least to me. I have no better ideas.

afonsojramos commented 3 months ago

Yep, agree with the above!

dammy95 commented 3 months ago

Thanks for the feedback @setchy @afonsojramos @bmulholland ⭐