This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-12
Channels
- # beginners (85)
- # boot (7)
- # cider (7)
- # clara (1)
- # cljsrn (49)
- # clojure (85)
- # clojure-dev (19)
- # clojure-dusseldorf (15)
- # clojure-greece (1)
- # clojure-italy (12)
- # clojure-nl (4)
- # clojure-russia (21)
- # clojure-sanfrancisco (1)
- # clojure-spec (25)
- # clojure-uk (59)
- # clojurescript (29)
- # core-async (5)
- # core-matrix (1)
- # css (1)
- # datomic (1)
- # docker (10)
- # fulcro (12)
- # graphql (21)
- # hoplon (7)
- # jobs-rus (6)
- # jobs_rus (1)
- # lein-figwheel (1)
- # mount (5)
- # off-topic (6)
- # om (4)
- # onyx (8)
- # perun (1)
- # portkey (25)
- # protorepl (7)
- # re-frame (78)
- # reagent (24)
- # ring-swagger (32)
- # rum (3)
- # schema (1)
- # shadow-cljs (122)
- # spacemacs (3)
- # specter (2)
- # sql (1)
- # testing (1)
- # uncomplicate (2)
- # yada (14)
=>> node target/main.js
SHADOW import error /Users/chen/repo/cumulo/cumulo-workflow/server/target/shadow-cljs/builds/app/dev/out/cljs-runtime/server.main.js
/Users/chen/repo/cumulo/cumulo-workflow/server/target/shadow-cljs/builds/app/dev/out/cljs-runtime/server.main.js:19
})());
^
ReferenceError: fs is not defined
at /Users/chen/repo/cumulo/cumulo-workflow/server/target/shadow-cljs/builds/app/dev/out/cljs-runtime/server/main.cljs:14:10
at Object.<anonymous> (/Users/chen/repo/cumulo/cumulo-workflow/server/target/shadow-cljs/builds/app/dev/out/cljs-runtime/server.main.js
check /Users/chen/repo/cumulo/cumulo-workflow/server/target/shadow-cljs/builds/app/dev/out/cljs-runtime/shadow.js.shim.module$fs.js
I don’t think we have covered this before.. I need to debug a javascript library that is included in my build. Is there a way to include a js file/package that is not in node_modules
, but have it otherwise be treated the same? (somehow I need to include my own fork of Keypress.js with a minimum of fuss)
@jiyinyiyong it’s just a sample project using the latest :bootstrap build ability of shadow-cljs
yes 🙂 it’s great. just working out the final bugs/limitations but it is already quite capable
& updated the readme again.. I am not entirely sure if it will ‘just work’ but you can have a try
if you can follow the above directions & then see the same thing as the screenshot I posted, then it is working the same as on my machine
(defn eval-str [source cb]
(cljs/eval-str
c-state
source
"[test]"
{:eval cljs/js-eval
:load (partial boot/load c-state)
:ns (symbol "shadow-eval.user")}
cb))
the cljs compiler just needs some string provided as a ‘name’ for the current thing being evaluated. in normal builds this would be the filename. in self-host, there is no “file” so you can specify this to be whatever you want. it will show up in stacktraces etc.
@mhuebert :resolve {"keypress.js {:target :file :file "path/to/file/from/project-root.js"}}
@thheller oh great, that’s simple.
Just had a friend test a fresh install (never had shadow-cljs installed before) using the new instructions in the shadow-eval
readme. It all works exactly like on my machine 🙂 including the errors in the first two blocks.
if shadow-cljs is installed globally, and not run using yarn run shadow-cljs ..
, does it still use the version specified in package.json?
`------ ERROR -------------------------------------------------------------------
File: /Users/zilence/code/tmp/shadow-eval/src/shadow_eval/user.cljs:1:1
--------------------------------------------------------------------------------
1 | (ns shadow-eval.user
-------^------------------------------------------------------------------------
2 | (:require re-view-hiccup.core
3 | [cells.cell :refer [cell]]
4 | [cells.lib :as cell
5 | :refer [interval timeout fetch geo-location with-view]
6 | :refer-macros [wait]]
--------------------------------------------------------------------------------
Invalid :refer, var shapes.core/fish does not exist
https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/js.clj#L13 this line prevents it from ever being compilable
i require cljs.js
just because i want to use shadow-eval to sort out all these issues that are also present in maria, without all the complexity of maria at hand
but why does maria need the require? the shadow-eval.user
already ensures that it is loaded?
and i think this will happen with any namespace that requires macros which don’t work in self-host. but we still want to be able to use those namespaces.
but that just delays the problem until the user tries to use a macro from that namespace
hehe yeah. i think this all comes down to functioning :exclude
or :no-follow
or :ana-only
or whatever options, ways of somehow saying “i have these namespaces which are preloaded and i just want to load the cache”
i think the point of :no-follow
or whatever is that the user doesn’t need transitive macro deps if cljs.js
is already compiled?
it was compiled using those macros, but we don’t need those macros to use its compiled fns
just like we should be able to use other compiled namespaces which used other non-selfhost-friendly macros at compile time?
i think in cljs-live :exclude
had the effect of only loading the analysis cache for the thing
it has no problem with shadow-eval.user
loading the cljs.js
, it does the correct thing here
shadow-eval.user
is loaded by shadow.cljs.bootstrap.browser
which is aware of the exclude
@thheller re: webserver w/ ring handler - that would be great. i used that functionality of figwheel like so: https://github.com/mhuebert/figwheel-pushstate-server
one thing, with bootstrap’s release
mode, i think it may need to be combined with a clean
command of some kind. otherwise the bootstrap directory can’t really be deployed without deleting it / rebuilding manually, because it fills up with multiple versions
I used to delete all old versions too but sometimes someone would access my site with a badly implement cache
never figured out how that was caused but it happened often enough to make me keep old version forever
yeah I should probably just deploy these files on a different system than the main app. then it makes sense to be ‘additive’