Fork me on GitHub
#reagent
<
2018-04-25
>
Rachel Westmacott14:04:03

I’m just upgrading to 0.8.0 and when I run my unit tests with doo I now get

Error while loading file: "target/test.js"
ReferenceError: "Set" is not defined
At line 153

ERROR: doo was not loaded from the compiled script.

Rachel Westmacott14:04:46

With 0.7.0 I get a successful test run.

Rachel Westmacott14:04:06

Is this issue known to anyone?

juhoteperi14:04:39

@peterwestmacott What js env are you using with Doo? Phantom?

juhoteperi14:04:45

Could be new React no longer works with Phantom

juhoteperi14:04:07

Set could refer to React using ES6 Sets

Rachel Westmacott14:04:41

oh, so could be latest reagent uses latest react which uses JS features not supported by my runtime?

Rachel Westmacott14:04:46

sounds super-plausible

Rachel Westmacott14:04:04

The JS line-number it gives me is deep in the minified version of React

juhoteperi14:04:30

Quick search says that Nashorn ES6 support requires Java 9

Rachel Westmacott14:04:20

yep - I’m just coming to that conclusion - but thanks for confirming

Rachel Westmacott14:04:32

looks like I need moar Java

athomasoriginal16:04:15

Its not specific to Reagent. Theming is always a challenge. One thing that can ease the pain is to use the new React Context API and another solution is explore tools like css modules or styled-components / glamor - ideally you would combine both of these.

lilactown16:04:24

yeah, I guess I should have specified that we're using emotion.sh already

lilactown16:04:38

which uses context under the hood i'm pretty sure. it's just kind of gross to use with reagent

lilactown16:04:43

ah no, the react integration & ThemeProvider

lilactown16:04:22

I don't see any examples of using ThemeProvider without the styled.htmlElement or HOC

lilactown16:04:34

we just create style objects that we pass in as edn and then pass those in to the components as classes