-
Notifications
You must be signed in to change notification settings - Fork 8
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
Should validate be moved out of axon? #361
Comments
Yes, this should move to phet-core, but I really want to keep the history. Can we please use |
|
Are those tests in ValidatorDefTests specific to ValidatorDef or could they be moved to other tests? For example could the 'Test phetioType' portion be moved to IOTypeTests.js or something else? |
A couple of things here.
|
Yes, this creates complications for TypeScript. Note that EnumerationIO is excluded from phet-core/tsconfig.json, and included over in tandem/tsconfig.json.
That seems like a good move.
I started to observe these problems in phetsims/chipper#1052 and made progress on phetsims/chipper#1055. To me, it adds complexity that, say, phet-core imports files from scenery. I'm not aware of any prior problems with that, but it has created wrinkles for TypeScript.
That would be great, thanks! I can also volunteer, but am very backlogged at the moment. |
I will try hard to get to the grunt work here soon to get this off hold for phetsims/utterance-queue#33 |
@samreid, would you like me to make an issue to move IO types in phet-core out to tandem? Perhaps a lint rule in phet-core to make sure that it doesn't have any cross dependencies? |
Is EnumerationIO the only IO type in phet-core? Would we want to move it out but leave Enumeration, EnumerationMap and EnumerationTests behind? What is the likelihood Enumeration will one day need to import EnumerationIO? |
Very high in my opinion. Most likely it should be in there now. Similar to the way we do other data types like ValidatorDef as a feature does depend on tandem though, even if the tests don't reflect that. This is because a validator can have a Currently it is just duck typed: Lines 158 to 164 in 201a8de
But I don't think that is as good as if there was an I don't see these relationships as hierarchical, so I don't really know how to proceed. We could create some sort of central library of phet that DOES depend on tandem, and keep phet-core as something like has no dependencies. Then Enumeration would also go into the other library. |
This needs to be solved for Enumeration and tandem at the same time. BTW we are no longer blocking phetsims/utterance-queue#33, as we found a way around it. |
After our discussion today, it's unclear to me what the options are, or what else we need to discuss/decide before we can proceed. @zepumph can you please advise? |
This does not need to need to occur for any issue that this was originally brought up for. While it doesn't totally make sense for this to be in axon, we don't currently have a better spot for it that doesn't create another headache for cross dependencies. Let's reopen if we find this to dependency tree to be too burdensome. Closing |
In phetsims/utterance-queue#33 I tried to use
validate
in a new function in phet-core. But phet-core shouldn't have a dependency on axon because axon already depends on phet-core.I am wondering if validate and ValidatorDef should be moved to phet-core (or maybe somewhere else) as its usage does not seem limited to observables and axon things.
Assigning to @samreid and @zepumph for thoughts.
The text was updated successfully, but these errors were encountered: