-
Notifications
You must be signed in to change notification settings - Fork 3
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
Enable exactOptionalPropertyTypes
option in tsconfig
#29
Comments
@wolfy1339 I would like to hear your thoughts on the migration plan. What would be the best way to do this? I want to give more priority to user's smoothness. If we need to do more work (like octoherd scripts, I'm fine with it). Also, I think you have a clear idea on the tree of octokit dependencies we have and what's the best order to start with a migration like this. |
I think a breaking change for this package is good. The whole octokit ecosystem starts at |
I don't think it's a |
If it's not a breaking change, would it be as easy as creating a breaking change for |
We will probably have some changes to do, but leave it up to renovate to start the process for us |
BREAKING CHANGE: Required, but potentially undefined does not have the same intent as optional. This rule will enforce us to be explicit in our type declarations and how we expect octokit APIs should be used. fix #29
Great. I will update this issue with subtasks of the corresponding PRs so we keep track of the updates. |
BREAKING CHANGE: Required, but potentially undefined does not have the same intent as optional. This rule will enforce us to be explicit in our type declarations and how we expect octokit APIs should be used. fix #29
🎉 This issue has been resolved in version 4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Re-opening to keep track of all the repos migration |
I think the option isn't working as intended, our tests aren't catching any errors |
Any repo in particular you are checking so I can take a look? |
I still see you are still merging the bump of the version. Does this mean we are good? |
https://github.com/octokit/app.js/actions/runs/11020750264/job/30606242843 Some of them are fine, while others aren't being caught |
It seems that some repos don't have a dry-run of the typescript build process which would catch these errors. It explains why the tests are passing but the release isn't |
Should we open PRs to dry-run the typescript build process first? |
Simply adding Let's make some PRs |
What’s missing?
To enable
exactOptionalPropertyTypes
option in Octokit'stsconfig
Why?
Promoted by octokit/request-error.js#461, @wolfy1339 and I think it can be a good plan to enable this option.
The benefits are:
exactOptionalPropertyTypes: true
option won't have problems. Here you can see an example with the option enabled when using@octokit/request-error.js
.undefined
does not have the same intent asoptional
. This rule will enforce us to be explicit in our type declarations and how we expect octokit APIs should be used.1Migration plan:
Enabling this feature, considering our multirepo architecture requires a progressive migration. The 2 alternatives I come up with are:
Upgrading each package
tsconfig
individually and finally upgrade@octokit/tsconfig
tsconfig.json
individually and adding the corresponding changes to the code, if any. Even this does not imply changes in code, I assume this should be aBREAKING CHANGE
because our types become more strict to our users. Is this correct?@octokit/tsconfig
by adding this new option.@octokit/tsconfig
in all our packages.tsconfig.json
Working with
beta
branchesbeta
version of@octokit/tsconfig
with the new propertybeta
branches for each of Octokit's packages using this new version, and we apply the corresponding changes to the code if necessary.BREAKING CHANGE
for all the packages.Warning
This change implies a
BREAKING CHANGE
to all packages. Is this correct?A good blog explaining its potential benefits it can be found here: https://tkdodo.eu/blog/optional-vs-undefined
Footnotes
https://tkdodo.eu/blog/optional-vs-undefined ↩
The text was updated successfully, but these errors were encountered: