-
Notifications
You must be signed in to change notification settings - Fork 14
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
naturalSelectionStrings.*Property.value
is a build error
#1314
Comments
It thinks “value” is a nested string key. The workaround is to put |
Thanks. I’ll wait for the longterm fix. |
The general problem is described in phetsims/mean-share-and-balance#99, assigned to @jonathanolson |
naturalSelectionStrings.addMutationsProperty.value
is a build errornaturalSelectionStrings.*Property.value
is a build error
My workaround in natural-selection ProportionsBarNode.js for phetsims/natural-selection#319: //TODO https://github.com/phetsims/chipper/issues/1314 using these Properties inline causes a build error
const greaterThanValuePercentProperty = naturalSelectionStrings.greaterThanValuePercentStringProperty;
const lessThanValuePercentProperty = naturalSelectionStrings.lessThanValuePercentStringProperty;
const valuePercentProperty = naturalSelectionStrings.valuePercentStringProperty; |
…ngProperty, see phetsims/mean-share-and-balance#99, #1314, also removing a .get() case for #1309
Should be fixed above for common usages. @pixelzoom can you verify? Also, I'd like to note that there are some degenerate examples that the current method will fail on, notably: // - joistStrings.someStringProperty[ 0 ]
// - joistStrings.something[ 0 ]
// - joistStrings.something[ 'length' ] We'd need to remove our "error on something that looks like a string but isn't found" since there's no good way to filter these out (without looking for array indices, any method/property that can be on a string, etc.) Tagging for dev meeting to see if this is acceptable (with a PSA). |
👍🏻 Confirmed by doing a build of natural-selection with things like |
In phetsims/natural-selection#319, I had to undo a whole bunch of work in Natural Selection, because calling
naturalSelectionStrings.addMutationsProperty.value
(for example) is a build error. All Properties in *Strings.ts are of typeTReadOnlyProperty<string>
, which includes get and get value() in its API. Why this is an error? Why is it not flagged until build?!? Aren't we trying to eliminatestring
instances from *Strings.ts eventually?Also note that getting the value of a StringProperty indirectly, like in this example, is NOT a build error:
The build error is:
.. and occurs in getStringMap.js. Assigning to the author @jonathanolson.
High priority because for phetsims/natural-selection#319.
The text was updated successfully, but these errors were encountered: