Repository navigation
Interactivity: Strict type checking - #59865
Conversation
b46f01a to
393c6ba
Compare
| "strictNullChecks": false, | ||
| "strictPropertyInitialization": false, | ||
|
|
||
| "noImplicitAny": false |
There was a problem hiding this comment.
We'll gradually want to remove these so all strictness is enabled.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +126 B (+0.01%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
8fc589e to
67ab2b6
Compare
| * @param root The root element or node to start traversing on. | ||
| * @return The resulting vDOM tree. | ||
| */ | ||
| export function toVdom( root ) { | ||
| export function toVdom( root: Node ): [ string | VNode | null, Node | null ] { |
There was a problem hiding this comment.
I'm not happy with the changes here…
There was a problem hiding this comment.
toVdom is an internal function. So TS here is not critical. Don't let this block your PR 😄
67ab2b6 to
b681df1
Compare
b681df1 to
8110436
Compare
|
This needs a changelog entry. It's strict null type checked now so the generated types should be better. I think there was an issue around some possible nulls not being reflected in types (around getElement?) that should be fixed now. |
Done in 982606e |
|
This should fix the types that were a problem in #59757 |
|
|
||
| for ( let i = 0; i < attributes.length; i++ ) { | ||
| const n = attributes[ i ].name; | ||
| const attributeName = attributes[ i ].name; |
There was a problem hiding this comment.
🚀 Thanks for making this easier to read.
There was a problem hiding this comment.
We need this PR (we can iterate later if needed) merged asap so it does not conflict with future developments.
Great work @sirreal
What?
Typecheck more of the interactivity package.
Part of #60219
Why?
The package is partially TypeScript and has relaxed strictness that reduces the quality of the produced type declarations.
Types get better!
How?
Migrate more file to TypeScript and fix type errors.
Testing Instructions
CI should be sufficient.