phetsims / scenery

Scenery is an HTML5 scene graph.
http://scenerystack.org/
MIT License
56 stars 12 forks source link

Scenery unit tests won't launch #380

Open samreid opened 9 years ago

samreid commented 9 years ago

Uncaught TypeError: Cannot read property 'getCacheBusterArgs' of undefined

Caused by this line in a config file: urlArgs: phet.phetcommon.getCacheBusterArgs()

jonathanolson commented 9 years ago

Since there isn't a standalone file I can stuff into grunt (I see it's stubbed in chipper's gruntfile) or into the actual build (since the config is executed there), I'm planning to leave the Scenery/Kite/Dot workaround (Date.now()) in place.

Reassigning to @samreid to see if there are better options.

samreid commented 9 years ago

I don't understand why Scenery/Kite/Dot cannot use chipper's definition of cache buster args, in the same way that other sims do. Scenery/Kite/Dot depend on chipper and can use anything declared there, so I don't see where the problem lies.

jonathanolson commented 9 years ago

It would require always running initialize-globals.js in dot/kite/scenery:

  1. initialize-globals.js has a dependency on jQuery, Dot explicitly doesn't depend on jQuery.
  2. It would enable assertions anytime ?ea is passed. This is application logic that shouldn't be baked into the window anywhere dot/kite/scenery is used.
  3. Why would we run code looking for whether a sim is a production build in Dot?

All of my objections would be resolved by the last IIFE being moved to something like joist/js/sim-preload.js (the bits related to enabling assertions, checking for sim production/dev, setting up sim post-message logic for errors, and the bit requiring jQuery).

@samreid, @pixelzoom, @jbphet can you comment on PhET sim-specific parts of the preload currently in initialize-globals.js being moved to somewhere in joist?

pixelzoom commented 9 years ago

I still don't understand the problem.

samreid commented 9 years ago

We decided on Date.now() today as a workaround with a long term solution of refactoring the initialize-globals.js to be sim specific vs general code.

samreid commented 9 years ago

Not being able to use ?cacheBuster=false in scenery/dot/kite is not really a problem for me, I'm going to unassign the issue.