Closed clartaq closed 6 years ago
I think this happens because Reagent 0.8 depends on React 16 and Reagent 0.7 depends on React 15. React 16 uses Map and Set and I'm guessing that PhantomJS doesn't support them:
React 16 depends on the collection types Map and Set. If you support older browsers and devices which may not yet provide these natively (e.g. IE < 11), consider including a global polyfill in your bundled application, such as core-js or babel-polyfill.
I'm not immediately sure if there's something that doo can or should do. As a workaround, I'd probably use either babel-polyfill via cljsjs or use e.g. Headless Chrome as the JavaScript environment instead of PhantomJS.
Well, that's sad. I hate to see a tool as popular as PhantomJS left behind. (Nashorn too apparently.)
I've switched to SlimerJS. That's working fine.
It looks like Google Closure itself can polyfill Map
by using :rewrite-polyfills compiler option. But I couldn't figure out how to make it fix the PhantomJS problem. I added these settings to :compiler
:
:language-in :es6
:language-out :es3
:rewrite-polyfills true
And cljsjs/babel-polyfill
doesn't seem to have Map
in externals.
I just tried this, but get an error since it appears slimerjs has not kept up with Firefox:
> node_modules/slimerjs/src/slimerjs -v --debug=true
Error: Platform version '61.0.1' is not compatible with
minVersion >= 53.0.0
maxVersion <= 59.*
Gecko error: it seems /Applications/Firefox.app/Contents/MacOS/firefox is not compatible with SlimerJS.
See Gecko version compatibility. If version is correct, launch slimerjs
with --debug=true to see Firefox error message
However, I could get it running with any of the following:
lein doo chrome test once
lein doo firefox test once
lein doo safari test once
I'm having problems getting reagent/figwheel/doo-based projects to run tests. As near as I can tell, there is an incompatibility with Reagent 0.8.0.
This problem is present in "hand-built" projects or those generated from popular templates like reagent-figwheel or the reagent template. Using the reagent template, version 0.10.1, here is a transcript that shows the issue:
Editing
project.clj
to downgrade to Reagent 0.7.0 and re-running the test produces the expected result:Even though the problem occurs when swapping the Reagent version, I'm reporting the issue here since doo flags the problem. When running the program with the dev or the production profiles, there are no issues, just when testing.
If you think the issue should be reported to the Reagent folks instead, just say so.