-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Strict null checks for coreutils #7607
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afshin There are multiple compile errors for the settings registry that I left in place. Would you mind having a look at those to figure out what the correct resolution is?
Great timing since the next release is a major one :) |
It was never a guarantee that the coreutils package would get a major version bump though... |
We bumped all the packages this time around:
|
fc330b7
to
4576da5
Compare
@afshin Do you have time to have a look at the current compile errors for |
@vidartf This should fix it: --- a/packages/coreutils/src/restorablepool.ts
+++ b/packages/coreutils/src/restorablepool.ts
@@ -138,7 +138,7 @@ export class RestorablePool<
if (objName) {
const name = `${this.namespace}:${objName}`;
- const data = this._restore.args(obj);
+ const data = this._restore.args?.(obj);
Private.nameProperty.set(obj, name);
await connector.save(name, { data });
@@ -298,7 +298,7 @@ export class RestorablePool<
Private.nameProperty.set(obj, newName);
if (newName) {
- const data = this._restore.args(obj);
+ const data = this._restore.args?.(obj);
await connector.save(newName, { data });
} |
Then this should be ready for review + merge and iterate for strict null checks for other packages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending minor comments.
It was broken and untested
4a77e12
to
83c8767
Compare
Inertia wins the day on the great content vs. contents debate of 2019. Thanks, @vidartf! |
References
Partially supersedes #7002.
Code changes
Some updated typings to be more clear about where null/undefined is expected/allowed, some bug fixes.
User-facing changes
None.
Backwards-incompatible changes
Strictly, these could all be categorized as bug fixes, but due to the number of minor tweaks, it might be better to do this as part of a major version release.
@afshin If this causes a major version release, it might be the timing for moving the settings registry etc, out of coreutils.
TODO before merging
Each type in the public facing API in the package should be re-evaluated if it should also accept null/undefined... or we can leave it as is, and issue bug fixes if we need to expand the accepted values to include undefined/null.(this should be done at the end of all strict null PRs)