This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-29
Channels
- # aws (1)
- # beginners (78)
- # boot (27)
- # cider (16)
- # clara (15)
- # cljs-dev (84)
- # cljsjs (13)
- # cljsrn (19)
- # clojure (65)
- # clojure-france (10)
- # clojure-italy (8)
- # clojure-russia (35)
- # clojure-spec (34)
- # clojure-uk (124)
- # clojurescript (50)
- # clojutre (3)
- # core-async (16)
- # data-science (18)
- # datascript (1)
- # datomic (9)
- # emacs (2)
- # flambo (3)
- # fulcro (55)
- # graphql (3)
- # hoplon (4)
- # jobs (2)
- # juxt (21)
- # keechma (6)
- # lumo (73)
- # off-topic (4)
- # om (10)
- # onyx (5)
- # parinfer (1)
- # pedestal (3)
- # re-frame (60)
- # reagent (19)
- # specter (24)
Hi guys. Looking for a predicate to check for native fn vs cljs fn.
(fn? console.log)
=> true
(ifn? console.log)
=> true ;;would love a false here
TIAAre there any existing efforts to generate static sites using CLJS? I guess I'm thinking something like Gatsby which uses React, but generates static snapshots
@rgdelato sth like this? https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/reagent-server-rendering
Is js/require
being replaced with :npm-deps
?
@mattbishop :npm-deps
is primarily about browser stuff, that is, consuming node_modules for browser usage
Hmh, we need proper documentation about differences of Node modules indexing, and requires, :npm-deps
and Module processing 🙂
Ah that's why all the commentary on running deps through closure with :npm-deps
:npm-deps
is only about automatically installing defined Node packages when running ClojureScript compiler
Separate to that ClojureScript will index node_modules
dir and use the information with module processing and requires
When :target
is :nodejs
, :require [react]
will emit JS code to call require("react")
if React is available in node_modules
If target is something else, the JS code is passed to Closure for module processing
I'm using yarn to manage my node deps, and I like how it does that. Is :npm-deps
meant to take that responsibility for cljs?
If not do I need to double-declare in both package.json and project.clj?
Using :npm-deps
is optional, you can as well use npm
or yarn
to install the packages.
Is there any advantage to using both yarn and npm-deps for a node project?
:thumbsup: thanks for your time.
The compiler only looks at node_modules
dir and doesn't care how the packages have been installed there
Thx for all the guidance @dnolen, @dimovich @anmonteiro … I spent a couple of hours on it yesterday, mostly chasing my tail… Some notes…
- after hours of trying, I couldn’t get :global-exports to work — always got a “namespace” not found… (in hindsight, I wonder if I had put it in the wrong build section in project.clj. I’ll try it again later)
- ended up going down the :exports route, which worked — I’ll post it in a gist… I have some aspirations to turning it into a cljsjs module for twiter.text
- I admit that I spent hours (unsuccessfully) trying to get a cljsbuild once min
build going on Heroku… I think I’ve dreadfully screwed up my lein project.clj file
But still, I’m elated that I got a CLJS client production build working yesterday! (at least, on my laptop. 🙂
PS: does anyone have a favorite project.clj that they use for Heroku that does the cljsbuild once min
build step correctly?
I gave a talk about ClojureScript w/r to node at a JavaScript user group out of pure impulse seeing all the great things happening recently. Slides: https://www.slideshare.net/IkuruKanuma/clojurescriptnode
@iku000888 very cool! thanks for sharing
Figwheel reloads get significantly slowed down when using node_modules deps (with :npm-deps
).
Setting :install-deps false
helped a little (I think), is there anything else that might help?
Is there a compiler flag I can enable to figure out why it's slow?
Using clojurescript "1.9.908"
and lein-figwheel "0.5.13"
@petterik might just be because we’re processing all your node dependencies through Closure on every reload
feel free to open a JIRA ticket, we could probably employ a caching strategy somewhere
@anmonteiro sounds good! I'll create a ticket
thanks
hey @dnolen yeah you can find calvin-cljs here https://github.com/eginez/calvin, happy to hear suggestions on how to make it better
it's basically a wrapper for https://github.com/eginez/huckleberry
Does anyone here have much experience with dealing with huge js
objectjs in clojurescript (specifically as react props). We need a spreadsheet component, and while I'm in favor of creating our own with clojurescript and adding advanced features incrementally, there are other (valid) opinions. However, using an existing spreadsheet component means passing the spreadsheet data as a js
object. I suppose I could use js->clj
, edit the data and back js
with clj->js
, but that seems very inefficient.
goog.object helps there for sure
Has anyone gotten React 16 to work with :npm-deps
?
The React 15.x verions doesn't work with :advanced
optimizations because of https://github.com/facebook/react/issues/8887 .. unless someone has a workaround?
@petterik that’s fixed in master
not sure about advanced, but the error you’re seeing is definitely fixed
@anmonteiro clojurescript master?