-
Notifications
You must be signed in to change notification settings - Fork 5
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
Thoughts about LinkedElement #161
Comments
To be clear about why this is high priority... The current state of things requires |
I think that the easiest solution would be to omit
|
Today the phet-io team found an issue with LinkedElement.getMetadata as it pertains to declarative APIs in https://github.com/phetsims/phet-io/issues/1657. I don't think that they should be deleting phetioFeatured from the list, but instead, now that we no longer have baseline files or grunt update commands, we can likely get the phetioFeatured value from the coreElement again.
|
I read through #161 (comment) and the mentioned commits and did not see any problems. However, since this issue we have eliminated baseline files and it seems like a good idea to run this past @zepumph to see if that changes how we proceed for this issue. Perhaps the preceding comment is part of that. Also, reducing priority based on the comment in #161 (comment) |
Most everything has been put into side issues, but I want to discuss #161 (comment) in person with @samreid before calling it a day on this issue. |
@samreid and I think that it will be easiest to add this complexity to the Studio side. There we will make sure that overrides with match for the element and linked element.
|
Over in phetsims/axon#408 (comment) we determined that we do NOT want LinkedElements to support API calls forwarding to their core elements. |
We are improving the overrides process in https://github.com/phetsims/phet-io/issues/1873. That will eliminate problems listed above like:
From the above:
That code looks like this: public constructor( coreElement: LinkableElement, providedOptions?: LinkedElementOptions ) {
assert && assert( !!coreElement, 'coreElement should be defined' );
const options = optionize<LinkedElementOptions, EmptySelfOptions, PhetioObjectOptions>()( {
phetioType: LinkedElementIO,
phetioState: true
}, providedOptions );
// References cannot be changed by PhET-iO
assert && assert( !options.hasOwnProperty( 'phetioReadOnly' ), 'phetioReadOnly set by LinkedElement' );
options.phetioReadOnly = true;
// By default, this linked element's baseline value is the overridden value of the coreElement. This allows
// the them to be in sync by default, but also allows the linked element to be overridden in studio.
assert && assert( !options.hasOwnProperty( 'phetioFeatured' ), 'phetioFeatured set by LinkedElement' );
options.phetioFeatured = coreElement.phetioFeatured;
That is already set on the last line of the snippet above.
As long as designers know that doesn't auto update, that seems OK, especially given our direction in https://github.com/phetsims/phet-io/issues/1873. Therefore I think this issue can be closed. |
Reopening because there is a TODO marked for this issue. |
We forgot about #161 (comment), which we ran into over in https://github.com/phetsims/studio/issues/303. Reopening. |
Alright. This is now back in the API files. Yay! |
Reopening based on https://github.com/phetsims/studio/issues/303 |
From conversations yesterday, we are going to proceed with these commits. They are built into the RC of GO, so we will know if there is any trouble as we go into testing. Closing |
From discussion with @pixelzoom and @arouinfar.
The chief complaint is that, since a linked element takes its phetioFeatured from the core element. This means that for certain changes when changing a model Property to be phetioFeatured and then committing the overrides. The overrides will then alter the baseline of linkedElements' phetioFeatured.
The text was updated successfully, but these errors were encountered: