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

Add ReadOnlyProperty #377

Closed
pixelzoom opened this issue Mar 7, 2022 · 6 comments
Closed

Add ReadOnlyProperty #377

pixelzoom opened this issue Mar 7, 2022 · 6 comments

Comments

@pixelzoom
Copy link
Contributor

This work was started without an issue, but seemed like we should have one, so here it is.

@pixelzoom
Copy link
Contributor Author

pixelzoom commented Mar 7, 2022

@jonathanolson commited ReadOnlyProperty in the above commit, but there were some problems. See Slack discussion below.

Slack

Jonathan Olson 6:09 PM
Added ReadOnlyProperty, see 2dc362b ...

Chris Malley 6:44 PM
Boo hoo. I still can’t pass a ReadOnlyProperty to addLinkedElement( element: PhetioObject, options?: any): void. For example FocalPointNode.ts constructor param pointProperty.

Jonathan Olson 6:47 PM
Hmm, checking

Chris Malley 6:47 PM
addLinkedElement has been my pain point.

Jonathan Olson 6:48 PM
Reproduced

Jonathan Olson 6:50 PM
It's expecting... private/protected things?

Chris Malley 6:51
The fields that TS identifies as missing are protected/private?

Jonathan Olson 6:51 PM
Yeah my ReadOnlyProperty is somehow very broken

image

Chris Malley 6:53 PM
I created phetsims/geometric-optics#359 to remind myself to fix things up in GO when this is working. No rush.

Jonathan Olson 7:12 PM
TypeScript is... killing me again. Not sure if this is possible. Omit (and the extends/infer it's based on) seems to convert it away from an interface into a type that loses the protected/private info

@pixelzoom
Copy link
Contributor Author

In phetsims/scenery-phet#726 (comment), @jonathanolson said:

ReadOnlyProperty is buggy, and not ready for use. I'm not sure it's possible to make it work. Perhaps I should remove it?

Yes, probably so.

@pixelzoom
Copy link
Contributor Author

It's been 30 days since we discussed deleting ReadOnlyProperty . If ReadOnlyProperty is not going to be fixed, can we please remove it? More than once, I've accidentally ended up with ReadOnlyProperty when I wanted IReadOnlyProperty.

@samreid
Copy link
Member

samreid commented Apr 6, 2022

I'll work on removing it momentarily.

samreid added a commit that referenced this issue Apr 6, 2022
@samreid
Copy link
Member

samreid commented Apr 6, 2022

Removed. Type checking and linting is passing locally. There were no usages. @pixelzoom can you please review?

@pixelzoom
Copy link
Contributor Author

👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants