-
Notifications
You must be signed in to change notification settings - Fork 6
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
Easy post-load checking of namespacing #307
Comments
…ck our namespace system in an easy way. See phetsims/joist#307
…ck our namespace system in an easy way. See #307
Added to discuss using this as our sole namespace checking method (and enabling by default once we have all common code namespaced). This would mean bailing on phetsims/tasks#435 (require.js-based namespace checks) and phetsims/tasks#431 (eslint-based namespace checks). |
Yes, it asserts that all of the requirejs modules appear in the global namespace with the appropriate name and value. It is failing on the module "checkNamespaces" which has not been namespaced. |
You can negate the assert conditions and transform them to |
I asked @jonathanolson over skype:
|
@jonathanolson responded:
|
I have done this on my working copy but want to test it further before committing. Tomorrow. |
Fixed above. Leaving open and marked for developer-meeting for discussion of how to use this and its limitations (only checks AMD modules loaded without a plugin). |
Very odd that How about |
Consensus: We will keep the checkNamespace option for now to help developers namespace sims, in the future we will remove ?checkNamespaces and just use ?ea to throw assertion errors if a namespacing issue occurs. |
Limitations: We can live with these. |
In Skype, I proposed that it's time to enable namespace checking. Discussion: [5/2/16, 12:54:37 PM] Chris Malley: Re turning on checkNamespace... I see lots of recent code (expression-exchange-basics, CCK, making-tens,...) that is not namespaced. Looks like developers have been generally blowing this off. Is that what we decided to do? |
Assigned to @jonathanolson to review. Then I believe this can be closed. |
@phet-steele FYI, here's the current state of affairs when running test-server. The majority of runnable (sims and demos) are failing with "Assertion failed: not namespaced". |
I namespaced blast, chains, griddle, graphing-quadratics, ohm-law, resistance-in-a-wire. |
I'll plan to tackle build-a-molecule, making-tens, pendulum-lab, wave-on-a-string. |
Neuron, Area Builder, and Arithmetic have been namespaced. The 3 sims that comprise the States of Matter suite have been assigned to @aadish, see phetsims/states-of-matter#114. I'll tackle Balancing Act and Expression Exchange tomorrow. |
namespaced build an atom in above commit |
Balancing Act and Expression Exchange are now namespaced. |
States of Matter, Atomic Interactions and States of Matter Basics are namespaced |
john-travoltage and gravity-and-orbits have been namespaced. |
Hey all, still left:
|
my bad pushed the commit for build and atom on wrong branch |
Should now be fixed for Balancing Act. I had done the same thing as @aadish, i.e. I committed the changes on a branch instead of on master. |
Marking for developer meeting so that we can discuss and assign individuals to finish the remaining sims. |
I went ahead and did projectile-motion, since I set it up initially and there isn't much to it yet. |
I took care of all remaining sims, with one exception. build-a-molecule has its own non-standard namespace, and will need to be converted by @jonathanolson (tracking in phetsims/build-a-molecule#78). |
@phet-steele Please kick off an automated test. Verify that the only runnable that fails with "Assertion failed: not namespaced" is build-a-molecule. If verified, close this issue. Otherwise note runnable that still need attention. Thanks. |
build-a-molecule is all that's left! Congrats! 🎉 🍰 👍 😄 |
Excellent, thanks. |
As an alternative to phetsims/tasks#435 (require.js-based) or phetsims/tasks#431 (eslint-based) for checking the namespacing of phetsims/tasks#378.
We had already created a debugging tool for creating these, and I've repurposed it so that if you run in require.js mode with ?ea&checkNamespaces, it will check require.js modules AFTER they all have been loaded, verifying that they exist at their expected namespace locations.
The text was updated successfully, but these errors were encountered: