Fork me on GitHub
#shadow-cljs
<
2018-08-31
>
wilkerlucio01:08:26

hello, I'm having an issue to compile on a project, it sudenly start to fail to compile Fulcro:

wilkerlucio01:08:29

File: jar:file:/Users/wilkerlucio/.m2/repository/fulcrologic/fulcro/2.6.0/fulcro-2.6.0.jar!/fulcro/client/primitives.cljc
failed to require macro-ns "fulcro.client.primitives", it was required by "fulcro.client.primitives"
{:tag :shadow.build.macros/macro-load, :macro-ns fulcro.client.primitives, :ns-info {:rename-macros nil, :renames {}, :meta {:file "fulcro/client/primitives.cljc", :line 1, :column 5, :end-line 1, :end-column 29}, :ns-aliases {clojure.core.async cljs.core.async, clojure.stacktrace cljs.stacktrace, clojure.spec.alpha cljs.spec.alpha}, :use-macros nil, :excludes #{var? key replace force}, :name fulcro.client.primitives, :op :ns, :env {:ns {:name cljs.user}, :context :statement, :locals {}, :fn-scope [], :js-globals {console {:name console}, location {:name location}, escape {:name escape}, screen {:name screen}, global {:name global}, process {:name process}, require {:name require}, alert {:name alert}, history {:name history}, window {:name window}, module {:name module}, exports {:name exports}, document {:name document}, navigator {:name navigator}, unescape {:name unescape}}, :line 1, :column 1}, :imports nil, :requires {t cognitect.transit, set clojure.set, clojure.spec.alpha cljs.spec.alpha, gstring goog.string, log fulcro.logging, targeting fulcro.client.impl.data-targeting, fulcro.transit fulcro.transit, clojure.zip clojure.zip, p fulcro.client.impl.protocols, fulcro.client.impl.parser fulcro.client.impl.parser, fulcro.logging fulcro.logging, goog.string goog.string, async cljs.core.async, cljs.core cljs.core, gobj goog.object, goog goog, goog.object goog.object, fulcro.tempid fulcro.tempid, cljsjs.react cljsjs.react, cljs.core.async cljs.core.async, fulcro-css.css-implementation fulcro-css.css-implementation, fulcro.util fulcro.util, cognitect.transit cognitect.transit, hist fulcro.history, clojure.set clojure.set, clojure.core.async cljs.core.async, util fulcro.util, s cljs.spec.alpha, parser fulcro.client.impl.parser, fulcro-css.css-protocols fulcro-css.css-protocols, transit fulcro.transit, str clojure.string, zip clojure.zip, clojure.string clojure.string, cljs.spec.alpha cljs.spec.alpha, clojure.walk clojure.walk, tempid fulcro.tempid, fulcro.client.impl.data-targeting fulcro.client.impl.data-targeting, fulcro.history fulcro.history, fulcro.client.impl.protocols fulcro.client.impl.protocols}, :seen #{:require :require-macros}, :uses {prewalk clojure.walk}, :require-macros {fulcro.client.primitives fulcro.client.primitives, cljs.core cljs.core}, :form (ns fulcro.client.primitives (:require-macros fulcro.client.primitives) (:refer-clojure :exclude [var? key replace force]) (:require [goog.string :as gstring] [cljsjs.react] [goog.object :as gobj] fulcro-css.css-protocols fulcro-css.css-implementation [clojure.core.async :as async] [clojure.set :as set] [fulcro.history :as hist] [fulcro.logging :as log] [fulcro.tempid :as tempid] [fulcro.transit :as transit] [clojure.zip :as zip] [fulcro.client.impl.data-targeting :as targeting] [fulcro.client.impl.protocols :as p] [fulcro.client.impl.parser :as parser] [fulcro.util :as util] [clojure.walk :refer [prewalk]] [clojure.string :as str] [clojure.spec.alpha :as s] [cognitect.transit :as t])), :flags {:require-macros #{}, :require #{}}, :js-deps {}, :deps [goog cljs.core goog.string cljsjs.react goog.object fulcro-css.css-protocols fulcro-css.css-implementation cljs.core.async clojure.set fulcro.history fulcro.logging fulcro.tempid fulcro.transit clojure.zip fulcro.client.impl.data-targeting fulcro.client.impl.protocols fulcro.client.impl.parser fulcro.util clojure.walk clojure.string cljs.spec.alpha cognitect.transit]}}
ExceptionInfo: failed to require macro-ns "fulcro.client.primitives", it was required by "fulcro.client.primitives"

wilkerlucio01:08:53

I have another project with very similar deps (same fulcro version) that compiles fine with the same shadow-cljs version (2.6.4)

wilkerlucio01:08:15

tried cleaning .shadow-cljs, but I can't seem to figure how to get this project to compile again

wilkerlucio01:08:42

is there anything else I can cache clear to get it back?

thheller06:08:55

@wilkerlucio strange. try shadow-cljs clj-repl and then (require 'fulcro.client.primitives)

thheller06:08:11

wonder why it fails to load?

biscuitpants07:08:30

man can i just say how much i love shadow-cljs @thheller

❤️ 8
biscuitpants07:08:39

recently discovered the report functionality, and that has been awesome

biscuitpants07:08:00

our entire (small) team of ~6 developers is absolutely loving it too. everyday i’m getting small anecdotes about how much better it is to work with

thheller07:08:36

lovely feedback. thx. 🙂

wilkerlucio11:08:52

@thheller just tried, I got this:

wilkerlucio11:08:54

Wilker-Nu:fulcro-inspect wilkerlucio$ shadow-cljs clj-repl
shadow-cljs - config: /Users/wilkerlucio/Development/third-part/fulcro-inspect/shadow-cljs.edn  cli version: 2.6.4  node: v8.11.2
shadow-cljs - updating dependencies
shadow-cljs - dependencies updated
shadow-cljs - starting ...
	Aug 31, 2018 8:22:29 AM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
Aug 31, 2018 8:22:29 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
shadow-cljs - HTTP server for :devcards available at 
shadow-cljs - HTTP server for :test-dev available at 
shadow-cljs - server version: 2.6.4
shadow-cljs - server running at 
shadow-cljs - socket REPL running on port 61362
shadow-cljs - nREPL server started on port 63104
shadow-cljs - REPL - see (help)
To quit, type: :repl/quit
[1:0]~shadow.user=> (require 'fulcro.client.primitives)
CompilerException java.io.FileNotFoundException: Could not locate clojure/future__init.class or clojure/future.clj on classpath., compiling:(fulcro/history.cljc:1:1)

thheller11:08:17

yeah sorry about that. that is fixed in the version I'm just about to release

thheller11:08:18

got a bit overeager with the dependency filtering

wilkerlucio11:08:54

I wonder why it works on other projects :thinking_face:

thheller11:08:10

maybe using lein/deps?

wilkerlucio11:08:16

yeah, doing that 🙂

thheller11:08:29

yeah the shadow-cljs launcher thingy just filtered too much

thheller11:08:42

didn't think we need clojure-future-spec due to always being 1.9

thheller11:08:53

but seems like it has a special namespace

thheller11:08:16

just pushed 2.6.5. should be fixed there.

wilkerlucio11:08:30

just tested and compiled fine, thanks!

kwladyka11:08:33

Is it possible to use different :source-paths for different builds? I am thinking about that in context of /checkouts to develop a library. I would like to run app with my checkouts version and with public version.

thheller11:08:14

well you can use deps.edn or project.clj then yes but not with shadow-cljs itself

wilkerlucio12:08:12

I have a project that uses a deps :local/root to point to a dep, this dep has some code that contains warnings and shadow is preventing code reload, shouldn't it ignore warnings outside the source paths?

wilkerlucio12:08:30

also, in this point, the code I'm talking about is related to some macro-magic, and I think in the way it works it's impossible to avoid the warnings... would be possible to mark some part of the code as "I know this looks weird" so it ignores warnings on that block?

wilkerlucio12:08:56

because while working on it at dev time those warnings are big PITA

urbanslug13:08:42

hmmm I've noticed that when I start the shadow repl in emacs when using a deps.edn with aliases because the command to start shadow doesn't specify the alias like -A:dev some dependencies don't load

lilactown16:08:26

you can specify what aliases to use when you jack-in with clojure cli tools

urbanslug07:09:11

@U4YGF4NGM Sorry long post alert

urbanslug07:09:22

I never got a chance to pick aliases. Here's my process: hmmm how? Here are my steps depending on which command I use either clojure-cli or shadow-cljs 1. M-x cider-jack-in-cljs 2. [Prompt] Which command should be used - clojure-cli - shadow-cljs 3. Choosing clojure-cli is what I think you said up there so I pick that. 4. [prompt] Select a clojurescipt repl type - shadow - shadow-select - custom all of these fail

[nREPL] Establishing direct connection to localhost:36749 ...
[nREPL] Direct connection to localhost:36749 established
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op classpath)
error in process filter: Sync nREPL request timed out (op classpath)
/different port number depending on which repl type I choose though./ So I start again but this time I chose the repl-type as shadow-cljs. - [prompt] Select a clojurescipt repl type * shadow * shadow-select * custom - I go with shadow [prompt] select shadow-cljs build I choose app in my browser I get "shadow-cljs - Stale Client! You are not using the latest compilation output!" When I make a change I get:
[:app] Compiling ...
[:app] Build failure:
The required namespace "day8.re-frame.tracing" is not available, it was required by...
this was under the alias dev in my deps.edn

lilactown14:09:57

so it’s a little more complicated, unfortunately

lilactown14:09:48

what I do is I modify the cider-clojure-cli-global-options

lilactown14:09:12

but when you run cider-jack-in you can also add a command to specify args before it runs

lilactown14:09:24

e.g. C-u M-x cider-jack-in

lilactown14:09:45

it’ll ask you for the nREPL command, and you can use that to add additional args, e.g. -A:dev

lilactown14:09:28

that’s nice for one offs, but annoying to do over and over so like I said, I add a dir-local for cider-clojure-cli-global-options in my project

lilactown14:09:25

((clojure-mode
  (cider-clojure-cli-global-options . "-A:server:dev")))
is what I have in my .dir-locals.el at the root of my project

wilkerlucio13:08:07

nevermind, I just figured a way to make my code work in a way that doens't trigger warnings 🙂

heyarne13:08:32

I'm getting a build-report.html with invalid js

heyarne13:08:40

has something like this already been reported?

thheller16:08:47

@arne-clojurians can you send me the broken report? I haven't had any reports about that breaking no

thheller16:08:22

oops nevermind

thheller16:08:36

@arne-clojurians fixed in 2.6.6. I accidentally included a dev version of the build reports JS and not the actual release version.

thheller18:08:08

@hlolli btw sorry it took so long but the 2.6.6 release should allow you to use npm link. I didn't test it thought so please do.

hlolli18:08:57

ok, test it now

hlolli18:08:54

yes, no error, compiling browser with 2.6.6

hlolli18:08:23

(and linked the same module as resulted previously in the error)

wilkerlucio18:08:39

@thheller I noticed something, yesterday I tried to use :hud false on a project but that didn't worked, I restarted the compilation but the HUD was still showing up

thheller18:08:18

oh I think I removed that option

thheller18:08:08

open an issue so I don't forget adding that in again. HUD should definitely be optional

wilkerlucio18:08:26

one question though, the alert box is considered part of HUD?

wilkerlucio18:08:42

because I wanted to remove the warning box, I would keep the compiling status and remove just the warnings if I could

thheller18:08:43

yes its all part of the hud but I'm fine adding more fine-grained options like :hud :all :errors-only :off?

wilkerlucio18:08:58

(I had so many warnings that the warning box rendering was taking about 10 seconds to have the UI responding...)

wilkerlucio18:08:10

the fine-grained options sounds nice

wilkerlucio18:08:30

maybe it could be a set

wilkerlucio18:08:42

:hud #{:progress :errors}

wilkerlucio18:08:28

:hud true | false | #{:compiling :errors :warnings}

thheller18:08:22

sounds like a plan. please open an issue. I won't get to it this weekend and might forget otherwise