Fork me on GitHub
#figwheel-main
<
2018-09-05
>
gas06:09:42

auto-testing doesnt work for me get 404 for http://localhost:9500/figwheel-extra-mains/auto-testing/ used figwheel-main template and upgrade deps.edn as:

:aliases {:fig {:extra-deps
                 {org.clojure/clojurescript {:mvn/version "1.10.339"}
                  com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
                  com.bhauman/figwheel-main {:mvn/version "0.1.9-SNAPSHOT"}
                  com.bhauman/cljs-test-display {:mvn/version "0.1.1"}
actually maybe form template Im gettin this error
base.js:677 goog.require could not find: create_react_class
goog.logToConsole_ @ base.js:677
base.js:711 Uncaught Error: goog.require could not find: create_react_class
    at Object.goog.require [as require_figwheel_backup_] (base.js:711)
    at component.cljs:1
base.js:677 goog.require could not find: react
goog.logToConsole_ @ base.js:677
base.js:711 Uncaught Error: goog.require could not find: react
    at Object.goog.require [as require_figwheel_backup_] (base.js:711)
    at template.cljs:1
base.js:677 goog.require could not find: react_dom
goog.logToConsole_ @ base.js:677
base.js:711 Uncaught Error: goog.require could not find: react_dom
    at Object.goog.require [as require_figwheel_backup_] (base.js:711)
    at dom.cljs:1
base.js:677 goog.require could not find: react
goog.logToConsole_ @ base.js:677
base.js:711 Uncaught Error: goog.require could not find: react
    at Object.goog.require [as require_figwheel_backup_] (base.js:711)
    at core.cljs:1
app.cljs:10 Uncaught TypeError: Cannot read property 'call' of undefined

gas06:09:34

Arggh doc says url is /figwheel-extra-mains/ but in fact is /figwheel-extra-main/ so typo in docs or in code šŸ™‚

gas06:09:01

Still figwheel-main template and auto-testing doesnt work my dev.cljs.edn ^{:css-dirs [ā€œresources/public/cssā€]} {:main hola.app :auto-testing {:namespaces hola.mouse-test :cljs-test-display true} }

pesterhazy09:09:40

@gas, have you tried specifying a vector? :namespaces [my.ns]

bhauman11:09:12

@gas :namespaces should be a vector

bhauman11:09:34

@gas I fixed the document to reflect the actual endpoint, sorry about that

bhauman11:09:58

also just try :auto-testing true

bhauman11:09:51

@gas the figwheel.main template isnā€™t up to the right version of figwheel yet

bhauman11:09:04

you have to have the latest 0.1.9-SNAPSHOT release

pesterhazy11:09:52

Running into another dependency load order issue, this time with devcards

pesterhazy11:09:56

The issue is system.cljs:321 Uncaught ReferenceError: React is not defined

pesterhazy11:09:37

Again I'm using a webpack-built bundle, included as a foreign lib

pesterhazy11:09:10

Adding a console.log to my bundle, I see that it's loaded after devcards, so it's not surprising that devcards can't find window.React

pesterhazy11:09:01

Here's my ns declaration

(ns ^:figwheel-hooks playground.core
  (:require [react]
            [devcards.core :as dc]))

pesterhazy11:09:25

react is a provide of my foreign - so far so good

pesterhazy11:09:05

unfortunately that doesn't cause "react" (the provided ns) to be evaluated before devcards

pesterhazy12:09:17

adding this to my dev.cljs.edn makes it work:

:preloads [react]

pesterhazy12:09:22

but it seems a bit icky

pesterhazy12:09:17

also prints out WARNING: preload namespace react does not exist but works anyway

bhauman12:09:53

@pesterhazy Iā€™m sure this is because of the way that react is required by devcards

pesterhazy12:09:17

which means IIUIC that if there's a bundle that provides react-dom, it's guaranteed to be loaded before reagent.dom

bhauman12:09:20

yeah Iā€™ll fix this now

bhauman13:09:18

cool I see that global exports is a thing in cljsjs now so this is no problem

pesterhazy13:09:13

yeah I think @juhoteperi did some work on that

bhauman13:09:17

yeah he filed an issue thatā€™s been on the backburner for quite a while

bhauman14:09:40

hmmm updating devcards is not easy as om has diverged a bit

pesterhazy14:09:45

As an experiment I tried requiring cljsjs.react in my ns declaration, and that seems to work

pesterhazy14:09:01

It doesn't work with cljsjs.reactasdf of course

pesterhazy14:09:39

So something must be providing cljsjs.react, but I don't see anything in clojure -Stree that would provide that ns

pesterhazy14:09:27

I wish I could grep in my classpath (including the jars)

pesterhazy15:09:45

Grepping in the code, I don't see see any location where cljsjs.react is provided (as opposed to required)

bhauman15:09:15

devcards provides it

bhauman15:09:25

oh but your excluding it

pesterhazy15:09:20

yeah, I have

devcards/devcards {:mvn/version "0.2.5", :exclusions [cljsjs/react-dom cljsjs/react cljsjs/create-react-class cljsjs/react-dom-server]},

bhauman15:09:21

do you use om?

bhauman15:09:47

Iā€™m just about to make a commit to devcards to make it compatible

bhauman15:09:00

with global exports

pesterhazy15:09:56

looks like om gets included transitively via sablono

devcards/devcards 0.2.5
  sablono/sablono 0.8.1
    org.omcljs/om 1.0.0-alpha48

pesterhazy15:09:14

however, I don't see where om provides cljsjs.react

pesterhazy15:09:03

if I unpack that jar and grep for cljsjs, I only see references to requireor dependencies

pesterhazy15:09:18

same with sablono :thinking_face:

pesterhazy15:09:34

@bhauman lmk if you want me to test the devcards version based on global exports

bhauman15:09:15

for devcards

bhauman15:09:50

@pesterhazy sablono only uses om as a Clojure dependency

lucasbradstreet21:09:20

Thanks. I guess thatā€™s not an allowed use!

bhauman20:09:34

I just deployed devcards 0.2.6

gas20:09:53

@bhauman - Yeah I know template isnt up to new version however updated deps.edn with 1.9-SNAPSHOT and cljs-test and got base errors above on template app. Found was issue in deps,edn. I was running clj -Afig:build but template had :main-opts [ā€œ-mā€ ā€œfigwheel.mainā€] in alias :fig and :build - commented out in fig and voila - learning alot - cheers šŸ™‚

bhauman20:09:39

I think, Iā€™m going to change the template and get rid the main-opts in fig

gas20:09:22

yeah actually looking at my deps now I moved reagent out into global deps and left fig just with fig stuff, also template doesnt have watch_dirs in dev.cljs.edn and I added global paths of src and resource. Just FYI in case you forgot where template was as figwheel-main is moving at fast pace ..

gas21:09:49

man Iā€™m dumb - auto-testing worked had auto-testing in main options of dev.cljs.edn and not in meta.. šŸ˜ž

gas21:09:07

cool feature - cheers