This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (2)
- # architecture (16)
- # babashka (26)
- # beginners (106)
- # calva (172)
- # chlorine-clover (19)
- # cider (36)
- # cljdoc (4)
- # clojure (113)
- # clojure-berlin (3)
- # clojure-czech (3)
- # clojure-dev (5)
- # clojure-europe (37)
- # clojure-france (3)
- # clojure-hamburg (12)
- # clojure-italy (4)
- # clojure-nl (2)
- # clojure-uk (22)
- # clojurescript (38)
- # cryogen (10)
- # cursive (30)
- # data-science (7)
- # datascript (1)
- # datomic (13)
- # deps-new (7)
- # depstar (13)
- # duct (3)
- # events (2)
- # exercism (3)
- # fulcro (31)
- # graalvm (56)
- # graphql (1)
- # helix (5)
- # java (12)
- # jobs-discuss (19)
- # kaocha (13)
- # luminus (1)
- # lumo (4)
- # malli (5)
- # off-topic (17)
- # parinfer (1)
- # pathom (1)
- # pedestal (7)
- # rdf (10)
- # re-frame (1)
- # remote-jobs (7)
- # rum (6)
- # shadow-cljs (4)
- # tools-deps (41)
- # uncomplicate (3)
- # vim (14)
We have inherited this old angularjs 1.x project served by ASP .NET framework, I’m not sure where to start on how converting this app and introduce clojurescript to this. Full rewrite does not seem an option, what would you do ? I’m a newbie to cljs
Right, that’s what I’m also thinking :white_frowning_face:. I’ve never pushed cljs in production, I’ve never developed on windows (.net framework only runs on windows). I don’t know how’s the cljs tooling in that OS
> net framework only runs on windows Not entirely true, given the Mono project. .NET landing page explicitly talks about being able to run your apps on macOS and "Supported on Linux, Windows, and macOS" if you scroll down.
@U62LF4PT5 is there a support from the customer/sponsor to switch technologies?
@U061C5DAA Not really… there’s limited resources available, maybe we could switch to .net core but that’s about it, we need those projects running. I’m trying out the mono project. Having my usual tools would be a start, I’ll see if I bump into some examples of migration AngularJS to CLJS that don’t involve complete rewrite
I must admit, from what I read that I don’t see a business case for rewriting to CLJS.
hmm... another question too actually: how shall I check the
typeof an object in clojurescript? I want to distinguish whether I'm operating on a number or an an object (map)
you should be able to use
(def name "Bob") (= (type name) js/String) ;; => true (string? name) ;; => true (not= (type name) js/Number) ;; => true (not (number? name)) ;; => true
Can someone point me to a good project to use as a starting point for embedding a REPL in a browser, which can invoke third party code (ex:
com.library/whatever)? I have been playing around with this, but it’s a bit difficult for me to understand how to expose “new” API calls that invoke the libraries: https://github.com/timothypratley/power-turtle
If you’re using Shadow CLJS, it has a build target called “bootstrap” which handles loading all the dependencies for using the set-hosted ClojureScript compiler. This article explains it a bit: https://code.thheller.com/blog/shadow-cljs/2017/10/14/bootstrap-support.html Here’s a minimal working example: https://github.com/mhuebert/shadow-bootstrap-example There’s a bit of info missing in these two resources about how to get a nice reloaded workflow. I just managed to get that working well, so if it’s interesting, ping me and I’ll tell you more.
Thanks so much for the details. I actually did have a few issues, even when starting with that project, for what I was trying to do. However, I came to realize that the problem was in the library I was trying to bootstrap (has some macros that need to be reworked to support bootstrap).
I notice that, even when I specify
:output-dir to somewhere other that
target/, CLJS compilation still makes files in
target/ . Is there a way I can change that? I'm trying to run two separate compilations at once and they're both clobbering
target/, when I configured them to output somewhere else entirely.
output-dir are the way to change that. The clojurescript webpack guide uses
out rather than
target and it works. How are you building your clojurescript files?
Is there a ClojureScript compiler option to have output .js files mirror the file/directory structure of the source .cljs files?
src/foo/core.cljs ........util.cljs ....bar/main/core.cljs .............foo2.cljs
out/foo/core.js ........util.js ....bar/main/core.js .............foo2.js
I would love anyone's input on https://stackoverflow.com/q/64036018/59439
> I have both the
cognitect.transit-cljs dependencies because my project is Clojure on the backend and CLJS on the frontend.
This is a really bad idea, causes all sorts of problems. This may be one of them, not sure.
@U08JKUHA9, thanks so much! I will look into how to split them up.
@U05224H0W, Thank you for your SO answer. That fixed it!
does this not exist in cljs? https://clojuredocs.org/clojure.core/intern
somehow i find that hard to believe. you can do a lot of "dynamic" things in "dynamic" languages (and both cljs and the host language are "dynamic"). it's only a matter of finding out how.
Well you can just do (aset js/window "foo" "something"), of course. But if you really mean var, and you don't trust the official docs, I don't think I can help you
Also, looks like my hunch was correct: https://gist.github.com/eyelidlessness/e760c5350b113a0bbcab
don't do "var" based programming in CLJS. you are in for all sorts of issues if you do. just
(def thing (atom "value")) and swap that instead of working on the "var" if possible. CLJS doesn't have vars at runtime and even less so after
:advanced. thats where the issues usually show even if everything sort of work in development.