-
Notifications
You must be signed in to change notification settings - Fork 7
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
Look through Faraday's Law and its dependencies to make sure correct patterns are being used. #85
Comments
I searched through all of the faradays-law files for the string |
https://stackoverflow.com/questions/11756483/require-js-access-all-loaded-modules taught me how to use _.keys(require.s.contexts._.defined).sort().join('\n') and found 330 modules:
|
This list is overwhelming, we need rules that will help us identify which files need instrumentation and which don't. UPDATE: maybe we can write a script that will iterate through those 330 files and report which ones include the string |
Here's a script that looks through function modules for tandem or phetio, run it after all modules loaded: var x = _.keys( window.require.s.contexts._.defined ).sort().filter( function( s ) {
var content = window.require.s.contexts._.defined[ s ];
if (typeof content==='function'){
var string = content.toString();
if (string.indexOf('tandeem')>=0 || string.indexOf('phetio')>=0){
return true;
}
}
} ).join( '\n' );
console.log(x); For Faraday's Law, I get:
This doesn't seem right because text search reveals 12 files in faraday's law with the term |
Oops, tandeem is a typo... please hold.... var x = _.keys( window.require.s.contexts._.defined ).sort().filter( function( s ) {
var content = window.require.s.contexts._.defined[ s ];
if (typeof content==='function'){
var string = content.toString();
if (string.indexOf('tandem')>=0 || string.indexOf('phetio')>=0){
return true;
}
}
} ).map(function(r){return ' - [ ] '+r}).join( '\n' );
console.log(x); |
|
@zepumph can you please review the preceding commit? |
I'm not sure if adding the As for phetsims/axon@e9f22ab: looks good. |
Back to you @samreid, sorry it took so long. |
Now that we've standardized on PhetioObject and use startEvent/endEvent for messaging, it is more likely that instrumented objects are properly instrumented. Furthermore, Faraday's Law only exposes 20 types over the PhET-iO API:
Many of these types such as PhETIO or NumberProperty have been refined and do not need another pass at the moment. Many Node subtypes such as Node and Checkbox get their behavior from PhetioObject and hence only need to verify that the correct phet-io options are passed to PhetioObject, and we can tell most of those are OK from Instance Proxies. As an example spot check, Checkbox.js only needs to supply I'd like to close this issue. |
See https://github.com/phetsims/phet-io/issues/1242 and #79
The text was updated successfully, but these errors were encountered: