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
chores(TS) Remove more empty declarations #8593
Conversation
Build Stats
|
Moving forward with this, there isn't really nothing changed nor is optional right now. Maybe there is some extra optimization the browsers guts can do when they know a property will likely exists rather than appear from nothing. Happy to dig more there but absolutely not now |
Motivation
Consistency in property declaration in classes.
Avoid transpilers to pre-define and override definitions with undefined of certain props.
The issue to recap was:
This may be because our setOptions or other constructor practices are bad patterns, but we are not drilling into that now, this is a simpe way to be safe.
On top of that babel is doing this transpilation, so actually adding a property without declare or without a default value is a TS error that we are avoiding because we a flag in the compiler turned down.
So maybe turning that flag up is another thing we want to do.
Description
Make all property initialization the same.
If a property needs to be defined in the constructor at runtime, we will need to add declare in front of it, regardless that tests aren't failing.
At least we are consistent and we don't have unexpected behaviours only for some properties.
Changes
Gist
In Action