This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-23
Channels
- # announcements (1)
- # aws (11)
- # beginners (28)
- # boot (235)
- # business (1)
- # cider (19)
- # clojure (34)
- # clojure-china (1)
- # clojure-czech (10)
- # clojure-japan (7)
- # clojure-poland (3)
- # clojure-russia (84)
- # clojure-sg (4)
- # clojure-uk (3)
- # clojurescript (114)
- # community-development (4)
- # core-async (15)
- # cursive (8)
- # datascript (5)
- # datomic (6)
- # editors-rus (27)
- # events (2)
- # hoplon (61)
- # jobs (2)
- # ldnclj (56)
- # ldnproclodo (5)
- # lein-figwheel (232)
- # luminus (1)
- # off-topic (5)
- # om (215)
- # onyx (436)
- # overtone (8)
- # re-frame (3)
- # reagent (3)
Little question, I have a piece of clojurescript code that needs to get required with require
by another module I have no influence off. To get that working, I used (aset js/exports "core" myModule.core)
All good if optimizations is on :simple
but if I turn that off and use a :output-dir
, the required object is always empty (contains myModule.core
on :simple
)
is there any way I can solve this problem? Or will this never work because the actual file doesn't contain the export, but the file that is getting imported by goog
does (on :none
)?
@thosmos: It solved the issue I had so it appears to be working. Naming things is hard ... personally I don't like new-callback
and it lives in a util namespace so the call is always (util/callback the-fn this 1 2 3)
and never just (callback ...)
. prevents accidental conflicts with locals.
@dvcrn: you are calling cljs code from js? I don't quite follow what you are trying to do but I think you are looking for ^:export
?
@thheller: @dvcrn ^:export
is useful under :optimizations :advanced
, I think the issue is regarding :none
, right? I have no relevant experience but using :none
to be consumed from another js module loader (e.g., exports.core = MyModule.core
) sounds like a bad idea. :none
uses goog.base
and Google Closure's module system, which has it's set of conventions and processes, which will probably clash with the other module system
@dvcrn: in any case, I encourage you to put a small repo that shows what you are trying to do (including the relevant js tooling) so we can hack on it
could someone explain what’s happening to lein-figwheel
? I see a big refactoring there https://github.com/bhauman/lein-figwheel/commit/41d7f67db4376b678566dd263459d3d0826c3d12
@bensu you are correct about :advanced
. I always start there because I think that is the only way stuff should be consumed when moving out of dev 😉
@thheller: right, ^:export
will be useful during deploy but my guess is that the questions comes from @dvcrn wanting to work with :none
.
yeah but I'd answer that by how it would work in :advanced
and work backwards from there. the answer "should" be the same
but I'm probably to biased towards browser builds ... things may be a little more relaxed in node land
figwheel has reached a point where I understand the domain enough to give it a better shape and make it much more extensible.
boot build
creates a directory target/main.out
. Is it needed for production? I was under the impression that only target/main.js
is needed.
@mbertheau: if you compile with :advanced
you only need one file (unless you use modules)
@martinklepsch: so I can throw away the .out
directory for production?
@mbertheau: it’s where intermediate stuff goes
@martinklepsch: Thanks
@bhauman: ~2 weeks ago I was trying to build a component using autobuild*
now trying to update that using figwheel-sidecar.components.cljs-autobuild/cljs-autobuild
btw, why it’s blocking on start?
Just tried out the figwheel --reagent template in the office Clojure Club last night, and it worked like a charm! Such an impressive quickstart demo.
swap!
the atom, view updates. Audience gasps. Edit code, save the file, view updates. Audience bursts into applause. (Audience response slightly embellished for narrative purposes)
@razum2um: I haven't written any docs for this stuff and i'm not sure what you mean by cljs-autobuild blocking
@amacdougall: yeah, the figwheel template is my preferred starting point. so much fun to start projects with it
BTW, I haven't been keeping up with Om Next, but does anyone have opinions right now on the six-month outlook of Om Next vs Reagent? I've only used Om Classic, and I'm pondering what to use for my next side project... which will be big enough to have real lock-in.
Obviously I should and will do my own research! But I'm also curious to know people's opinions.
@amacdougall: Om Next is shaping up to be something that will be “done” in the next couple of months
@razum2um: also wondering if you saw this https://github.com/bhauman/lein-figwheel#scripting-with-component
Fortunately I work very slowly! I'll keep an eye on it. Thanks for the info, and for all your hard work.
@amacdougall: I think an area that will require a lot of work which doesn’t have anything to do w/ Om Next as a thing you use
thanks to the Indexer idea, I think the kind of tooling you could build around Om Next for Chrome DevTools could be pretty mind blowing
i.e. hover any element see it’s query, auto-refetch, bug, rewind history via interface, fix code, figwheel hotload, done
Oh man that would be so nice
all the kinds of the things that are trivial when immutability is at the center of your system.
@bhauman: yep, thanks a lot, working amazing, a few questions: 1) where do the logs about rebuild happening go now (see only the first build message now) 2) do you think 2 systems is good idea, or you just wanted to simplify setup exposing 1 component instead of 3? btw, what’s the best practice in component to encapsulate several components?
@razum2um: logs go to figwheel_server.log, the two sytems thing makes repl interaction much much more expedient for now. But if you understand the code in system.clj you can roll your own system but that is really only needed if you want to create components that send messages to the client.
@bhauman: right, you guessed what I want - send state to the js from the usual repl, evaluate something on jvm serverside and draw it on client (resetting state)
@bhauman: frankly speaking I did that some time ago by generating a whole cljs file and using standalone figwheel, but this way kinda sucks now with components inside one repl it should be way easier
@razum2um: don't quite have what you are trying to do. sounds like iPython notebook or something
@bhauman: btw, what do you think if system.clj functions were accepting not a system, but a component which wraps other components and only if not given - create a system and such component in it - I think this way it’ll be more clear and idiomatic to incorporate this into application system btw component-lib started with the idea - storing state in private var is no good, but now we’re storing a system there 😉
@razum2um: the var thing however is attached to the start and stop of a component so not a big deal right? just like writing and deleting a file its a side effect contained within the component model
good stuff Capital One talks speeding up page load times https://medium.com/@puppybits/letting-people-in-the-door-how-and-why-to-get-page-loads-under-2-seconds-340c487bd81d#.222vc7lvf
also why :modules
really is a killer feature and more people should be using it if their final app is quite large
@razum2um: but I'm interested. If you see a path to make this more modular let me know.
please file an issue explaining your thoughts. but I do think the repl api functions are important and having a var reference gives people what they actually want.
Guys, can somebody quickly explain me why (ex-info "msg" {:tag :mi})
prints as js/Error
in the repl but (type ..)
return an #object [cljs$core$ExceptionInfo...
and not a js/Error
?
or another way to say this, how can I trap\ a js/Error ?
ah this explains everything
no I am not in a catch
I am building errors
with (ex-info...
would like to test if they are js/Error
not that important, just wondering if there is a way
trying
yes it works, thanks!
I forgot about instance?
😄
Has anybody see a
#error {:message "ERROR", :data {:tag :cljs/analysis-error}, :cause #object[Error Error: Namespace "first.namespace" already declared.]}
while requiring or ns-ing a namespace inside a PhantomJS or SlimerJS test??Thanks @bensu for doo
BTW
Hi @richiardiandrea! thanks for using doo
well it is a bit complex, basically I am calling clojurescript core functions that evaluate forms
for instance: (repl/read-eval-print {} echo-callback "(ns 'first.namespace)")
this in the browser runs fine, but in phantom is not...but it is not a problem of doo
I tried standalone phantom and slimer
yes basically some sort
not working
all the namespace related command fail
with that error
they run fine
for instance (repl/read-eval-print {} echo-callback "(doc 'println)")
is smooth, I am about to publish a repl library and I have some tests in it...probably smthing gets hairy
if you have an example repo, I'll try to figure out what gets called in cljs.js
, follow the code, and see if anything triggers my Phantom/Slimer alarms
7 tests fail in phantom, 5 in slimer
k will put that out next week, time to polishing the last bits
grazie a te!