-
Notifications
You must be signed in to change notification settings - Fork 408
Add readonly to interfaces properties in index.d.ts #537
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
Conversation
hiranya911
left a comment
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.
In general we shouldn't mark fields of input types readonly. I've pointed out several of those instances, but there are more. Lets only mark fields of output types as readonly.
|
@nbegley, @hiranya911, I reverted the readonly on the types that are used as input arguments for functions, thus allow user to modify those objects if necessary. Please check if my update is reasonable, and if I need to add/remove readonly on some other fields. |
hiranya911
left a comment
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.
Looks good to me. Just one question to @nbegley.
|
We'll probably have to consider this a breaking change. Even though users shouldn't be relying on any of these fields being mutable, it's possible that some of them may be. |
|
I agree @nbegley. On a second thought, I'm even reluctant to do this change for output types. Somebody may have written code like this: Having said that I do believe this is a good change, and something we ought to do at some point (possibly for the next major release). @TrCaM can you create an issue for this, so we will remember to revisit it in the future? |
|
Sure, I can add an issue |
|
Thanks. We will track this requirement via the internal issue you've reported, and get it done for the next major release. |
Description