This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-03
Channels
- # aleph (3)
- # announcements (1)
- # beginners (116)
- # boot (8)
- # braveandtrue (4)
- # cider (40)
- # cljdoc (120)
- # cljsrn (10)
- # clojure (29)
- # clojure-austin (4)
- # clojure-dev (43)
- # clojure-germany (1)
- # clojure-italy (4)
- # clojure-nl (17)
- # clojure-russia (19)
- # clojure-uk (76)
- # clojurescript (118)
- # cursive (13)
- # datascript (11)
- # datomic (73)
- # emacs (24)
- # figwheel-main (176)
- # fulcro (40)
- # hyperfiddle (4)
- # leiningen (3)
- # off-topic (1)
- # pedestal (4)
- # re-frame (6)
- # reagent (22)
- # reitit (1)
- # ring (3)
- # rum (8)
- # shadow-cljs (41)
- # spacemacs (11)
- # specter (19)
- # unrepl (1)
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
@shawx538 merge
is for merging maps and into
is more like a generic conjoin for all kinds of collections. Both are clojure.core functions and don’t have much to do with reagent itself. What are you trying to achieve?
@slack1899 there are many paths. Could you elaborate a little, are you going to build a webapp (SPA maybe?), do some node stuff or lambdas? Or just learning Clojurescript in general?
I need to take a map of default values, and combine it with a smaller map of specified values, so that the specified values supersede the default ones. @valtteri
merge
should work fine for your use case. Could you show a code snippet of your current merge?
I appreciate the help, but it's gotten to be a lot later than I intended to stay up, and my code is a mess right now. I will ask later if i cannot resolve it with a clear head on the morrow.
No problem. Btw there’s also #beginners channel where you can ask for help. Many helpful folks there.
@shawx538 looks like you were trying to call a keyword without arguments. ie. (:foo)
missing the (:foo something)
arg
@slack1899 I'd recommend trying out the figwheel tutorial 🙂 https://figwheel.org/
Does anyone have a working example of using radio buttons with CLJS and Rum? I’m running into some very strange behavior and I’m not sure why.
Is parallel-build
enabled by default now? I have tried activating it, but compile time seems about the same
%CPU
in top at 400 should mean it is running right?
@mfikes Ok, I can't see any significant difference in compile time. Perhaps figwheel.main
does things in the background
@andreas862 things like running a file watcher and a server 🙂
@bhauman More like always running :parallel-build true
but the source doesn't think so
what I meant is that there are things running in the background that would impact the parallel build
would a server and a watcher really impact perf? Still I am running with -bo
@bhauman using this prod.cljs.dev https://pastebin.com/WzQTFmhD
that should do it right?
and clj -m figwheel.main -bo prod
yeah so you probably won’t see much inprovement with advanced compilation, as the majority of work is serial
Ah, I see - That should be in the cljs compiles opts reference
@bhauman thanks for the help
Makes a lot of sense when thinking about it - global optimization etc...
I read here Now that Promise is available in modern browsers, and is automatically polyfilled by the Closure Compiler, by default,
, but using it as (js/Promise. ...)
doesn’t help I guess
Has anyone in here ever setup a VM with clojurescript using figwheel REPL at cloud9? I’m used to code normal clojure at it and even some RESTful services, but so far my experience with figwheel hasn’t been great. I changed both nrepl and server ports to 8080 and 8081 but it still takes ages to load the page. When I press F12 to look at the console I keep seeing some pulls to localhost:3449 although I could not find where this is coming from (since I changed the ports).
I’ve never set up anything in Cloud 9, the above tutorial walks you through REPL based development
yeah, I think that the problem is setting it up at c9 since it would be a nREPL. it is such a great place for developing apps that I thought someone would have done this before xD
maybe the more general question: how does Closure uses default polyfills, what should you do to activate them?
I’m writing a SPA with secretary/accountant and I can’t for the life of me get the back button to navigate back to my application when if I’ve followed a link out of it. Figwheel says 404 and the url looks as expected localhost:3449/foo/bar. Has anyone got an example that they know works?
@bhauman thanks for the response. I’m deploying this via github pages and intend it to be a single page app with 1 actual route — I’ve never done this before but assumed from the docs and examples I’ve seen that this stack should handle this case
which stack?
are you calling window.history.back(); ?
probably need re-frame
misread
makes sense that it doesn’t know about the route, I’ll try deploying and see if it works on github. Thanks guys!
in order to use non-hash-routing your webserver needs to know to essentially ignore requests to those routes and just feed them back to the original page
@lilactown yes! I suspected that might be the solution and I got it working great. Thanks for the tip!
so the default language-in is es5 https://github.com/clojure/clojurescript/blob/d2e4424cec693b59af67051aebefca971a477567/src/main/clojure/cljs/closure.clj#L262 but according to this site es6? https://cljs.github.io/api/compiler-options/language-in
is this the language that cljs emits as input for closure? what could break if I put it to es6?
@mfikes hmm, why isn’t it set to es6 by default then.. https://clojurescript.org/reference/compiler-options#rewrite-polyfills
I’m afk, but I think we don’t really even emit ES5, but specify it perhaps to avoid things like https://github.com/planck-repl/planck/issues/781
@borkdude why do you care what the default is? the CLJS compiler will emit ES3 regardless so it only really matters when processing other JS and if you feed it ES6 you should set it to ES6. last time I checked Closure did some weird things to the CLJS output when compiling with ES6 set though.
@thheller because I want to use the polyfill option and I don’t want to break anything
:rewrite-polyfills
If set to true, the google closure compiler will add polyfills (for example when you use native javascript Promise). This requires :language-in to be set to :es6 or higher or it will silently be ignored!
Nice. Interesting to think about how ClojureScript’s numerics could optionally support that.
Yeah. With efficient underlying support, you could imagine a numerics system that truly supports N
suffixes, rationals, etc.
"Implicit conversions to/from numbers and integers and expressions with mixed operands are expressly disallowed"
The real challenge would be to somehow have a new numeric tower without effectively forking the language, right?
Looks like it'll find its way to the other vms too https://github.com/tc39/proposal-bigint
http://neugierig.org/software/blog/2018/09/typescript-at-google.html in this blog someone says: > Closure has unpredictable semantics, it’s slow, it’s buggy :thinking_face:
Lots of people say lots of things. For example, 'Typescript is buggy (I know of a bug hindering Vega-Lite) and transpiling to JS makes it slow"
¯\(ツ)/¯
Just being from Google doesn't mean all that much
Not that argument from authority ever means anything
Also, come to think of it, since it (typescript) sits on JS, doesn't that make its semantics inherently 'vague'??
Alot of time I will get this warning on the CLJS repl
---- Compiler Warning on <cljs form> line:1 column:1 ----
Use of undeclared Var reagent-internals.core/app-state
1 app-state
^---
---- Compiler Warning ----
@lilactown I was just discussing these here.