This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-25
Channels
- # beginners (20)
- # boot (25)
- # cider (1)
- # cljs-dev (7)
- # cljsjs (1)
- # cljsrn (1)
- # clojure (79)
- # clojure-austin (2)
- # clojure-berlin (13)
- # clojure-dusseldorf (1)
- # clojure-germany (7)
- # clojure-russia (10)
- # clojure-serbia (1)
- # clojure-spec (18)
- # clojure-uk (4)
- # clojured (1)
- # clojurescript (90)
- # cursive (10)
- # datomic (7)
- # emacs (14)
- # hoplon (6)
- # luminus (16)
- # lumo (4)
- # numerical-computing (2)
- # om (25)
- # om-next (1)
- # onyx (11)
- # pedestal (10)
- # protorepl (1)
- # reagent (11)
- # remote-jobs (1)
- # ring (1)
- # rum (38)
- # spacemacs (5)
- # test-check (7)
- # untangled (122)
- # vim (1)
- # yada (8)
Indeed it works with the previous one [org.clojure/clojurescript “1.9.473”]
. Just for my own curiosity, would you have any idea why that bug happens?
@piotr2b: you could use master version of cljs-devtools, this commit fixed it: https://github.com/binaryage/cljs-devtools/commit/dff7ffefbc2562997386304f2bcb4c7f3a9c1494
@darwin you’re right but I haven’t tried because I think it’s been some time maven/leiningen don’t support anymore “LATEST” pseudo-version (I should have tried though)
Indeed it works fine now 🙂
I’ve got a very newbie question about Closure library: I’ve got the very latest versions (less than 5 minutes ago) on the same aforementioned project (even more up to date than https://clojurians.slack.com/files/piotr2b/F49K0JNL8/Untitled.clj) but it looks like some parts of Closure library aren’t available. For example, in the console goog
is defined and so is goog.math
but not goog.math.Rect
. Am I missing something?
@piotr2b did you (import '[goog.math Rect])
?
That’s it \o/ thanks!
Is there any Google closure magic for joining "http://apipath.com:2020" and "/path/etc"
What's the state of the art in using npm modules from ClojureScript? Should I still be maintaining a package.json
and using cljs.nodejs/require
, or is there something closer to cljsjs
for node?
@deas is there evidence of that?
i.e. a github issue or a minimal example?
@anmonteiro Will sort things out and get back. Don't have the code with me, so it might not happen before Monday. Just wanted to check if you been there already. 😉
I’m reading this pretty new tutorial https://clojurescript.org/guides/javascript-modules and I’ve got working import
feature today. However, I keep struggling with two issues so far:
1. Is there anyway to get more information about syntax mistake if js-files have any of it? Now, I getting huge trace from nashorn
and it’s hard to understand which particular place caused an error.
2. I tried to use node dependencies like import React from ‘react’
, unfortunally it doesn’t work. But if I’m change it to var React = require(‘react’)
it seems like it works. Anything I’m doing wrong or missing?
If I want to do some interactive graphs with Clojurescript what's the best thing to use?
Wrapper to d3, or anything else?
Would like to use reframe in that same project
Quill might also be nice even if not really the same thing
What's the purpose of this hashmap with :pre in it: https://gist.github.com/metametadata/3b4e9d5d767dfdfe85ad7f3773696a60#file-react-bootstrap-cljs-L22 ?
@leroix iirc those 100 files might just be for source-maps. Try loading the un-optimized one with only whatever file the boot-cljs prompt says when you make a file-save.
@pupeno it's a precondition, a part of defn
@leroix yeah there's a lot of files, sure but which file does the boot prompt tell you just after you save a file?
@leroix looking in whatever terminal emulator you launch boot from, I mean
I needed to make sure that on-change prop is passed, otherwise the wrapper doesn't work
@mikebelanger not sure what you mean. just after a save I generally see
Compiling ClojureScript...
• js/dev.js
This is the file we load, but it in turn loads its many other dependencies@leroix right it loads transitive dependencies, when you compile to :advanced
it should all be in the one file.
yea, definitely. we do that for production, but my main concern right now is local development
@leroix .....oh sorry I re-read your question, you're asking if you can compile un-optimized and in one file at the same time 😛
yea having just boot depedencies load a 100 different js files hurts page load times in local dev
@leroix I guess I've never seen that as an issue. How much could it possibly slow down page load times if they're all local anyways?
This has nothing to do with Boot(-cljs), this is how ClojureScript works when using :optimizations :none
@juhoteperi you’re right, but I’m just saying that I’ve noticed a large portion of my 400 js files that have to load are from boot(-cljs)(-reload)(-cljs-repl)
Hmm, I don't think Boot cljs should load that many files, it should be something like 4 JS files from Boot-reload and maybe 1 or 2 from Cljs-repl
The Cljs files from the tasks will depend on some Closure libraries and ClojureScript namespaces, but most of those would be loaded anyway
just noticed that if I remove boot-reload and boot-cljs-repl, the number of js files decreases by 100
It might have something to do the tricks Boot-reload does with Closure module loading, in order to support hot reloads
yea, I think it depends on a lot of cross domain messaging dependencies in in the closure library
By the way, do you have "Disable cache" enabled in Chrome devtools?
Yeah, that will make it much slower, most of files from Cljs and Closure won't change so disabling "Disable cache" should help, but I'm not sure if that causes some problms
Figwheel is using a bit different code to enable hot reloading, it could cause some differences
@leroix I've noticed a bit of a speedup when I ask boot-reload to load a specific symbol. But obviously that would only work if you're focusing on one area of code at a time
@leroix Do you have .cljs.edn
file?
Cool. I wasn't aware of those.
@mikebelanger that’s interesting. I haven’t tried that. generally we hit the same top level function.
Btw. disabling recompile-dependents will break hot reloading e.g. when you change def
in one file and that var is used in a other file
gotcha, yea I think we were having trouble with long recompile times with it turned on
Yeah, changing a file in which all other namespaces depend (transitively) can cause really slow recompilations in large projects
Worst I have had was something like 2 minutes if a common utils file was changed
@leroix that said I don't know if you can reload a top-level function definition. Whenever I've tried using (reload :on-jsload 'the-fn..
it asks for arguments. There might be a way of reloading a function but I've never figured that out. I've only any kind of symbol
Luckily such files don't need to be changed often, if the project is well structured. And I still prefer using recompile-dependents as it can prevent really strange problems.
if you do hit those issues, I imagine you just have to make a change in the affected dependent file to start another recompile?
Yeah, but it is easy to forget that 🙂
@mikebelanger ah yea, that’s what I meant. we use a symbol as well
Okay, I can reproduce 180 loaded files with with Boot-reload vs. 90 files without
I wonder if Boot-reload will load all the JS files in output dir, even if they are not needed...
good question. I think the compiler would only output what’s explicitly required right?
True. Using boot-reload will double the number of files in output-dir
I think the files are mostly from Closure modules used by Boot-reload client
In larger projects the difference will be smaller as some of those Closure modules will be used by the app anyway... But it might still be good idea to change Boot-reload to depend on fewer Closure modules.