Skip to content
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

Migrate to new ECMA class fields #2825

Merged
merged 4 commits into from
Jul 21, 2023
Merged

Migrate to new ECMA class fields #2825

merged 4 commits into from
Jul 21, 2023

Conversation

CarsonF
Copy link
Member

@CarsonF CarsonF commented Jul 20, 2023

This opts in to the new (and future default) functionality.
This actually tells TS to emit properties at runtime.

This is opt-in because it's a breaking change for places we "override" a property.
We do this to narrow the parent type to a stricter one or just to declare a decorator.
With this new functionality, these spots would actually override the parents initial property.
Technically for us though it doesn't make a difference.
This TS says these are errors unless we give an initial value to these override spots.
Marking them as declare means no new runtime property will be emitted, and it's just the parent class's property that will be used. Which makes sense and would be what we want if it actually mattered (if these weren't just shapes).

Because these properties are non emitted to runtime, we probably could replace the static Props declarations in favor of this. But I'll leave that for a future PR.

┆Issue is synchronized with this Monday item by Unito

Since all keys will be declared now, this is necessary.
Undefined is only possible if caller has not declared a value on input.
Note that `nulls` are still valid inputs and are considered changes
in most cases.
@CarsonF CarsonF merged commit db90b14 into develop Jul 21, 2023
20 checks passed
@CarsonF CarsonF deleted the class-fields branch July 21, 2023 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants