This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-29
Channels
- # aleph (2)
- # bangalore-clj (1)
- # beginners (9)
- # boot (18)
- # clara (3)
- # cljs-dev (21)
- # cljsjs (2)
- # clojure (137)
- # clojure-spec (2)
- # clojurescript (65)
- # clr (1)
- # copenhagen-clojurians (11)
- # core-async (20)
- # datascript (3)
- # lein-figwheel (1)
- # leiningen (4)
- # luminus (4)
- # lumo (1)
- # off-topic (38)
- # onyx (1)
- # parinfer (4)
- # pedestal (9)
- # protorepl (8)
- # re-frame (4)
- # reagent (92)
- # ring-swagger (2)
- # rum (1)
- # unrepl (40)
- # vim (16)
- # yada (1)
I'm trying to use Google Closure's Html5History to handle navigation within my SPA. This works fine with no optimizations but breaks in advanced mode:
(Html5History. nil
;; Custom TokenTransformer to override the default
;; behavior, which appends the search string to all new
;; tokens.
#js {:retrieveToken (fn [prefix location]
(subs (.-pathname location) (count prefix)))
:createUrl (fn [token path-prefix location]
(str path-prefix token))})
i.e., I guess I should be passing an instance of TokenTransformer, but instead I just pass a plain object which has the right function names
how do I prevent that? TokenTransformer is defined here, if that helps: https://github.com/google/closure-library/blob/master/closure/goog/history/html5history.js#L311
I'd like to try passing a proper TokenTransformer, but how do I create one in Clojurescript?
Hello @ajpierce . I looked at https://ajpierce.github.io/posts/react-figwheel-npm/ and I tried the steps and got No such namespace: react, could not locate react.cljs, react.cljc, or JavaScript source providing "react"
. Do you think am I missing something?
Hi Fabrao! The Clojurescript team released a new version just a couple hours ago that addresses some of the issues I was attempting to solve in my post; I'm doing another sample project from scratch with the newest version and then i'll update the blog post
Give me a little bit and I'll have something else up; hopefully it will solve the issue you're running into 🙂
Hi, thanks a lot, I´ve tried with anmonteiro to do something near it, but it didn´t work. So, I saw your post and I tried it.
Yeah, i'm getting the same error as you using the latest clojurescript build; it doesn't download anything form npm into node_modules
automatically; trying to figure out how that happened for me earlier
for the benefit of anyone having similar problems: the following gist works in advanced compilation: https://gist.github.com/pleasetrythisathome/d1d9b1d74705b6771c20#file-browser-cljs-L14
@aranhoide Read about “externs” for :advanced
, which prevents name munging https://clojurescript.org/reference/advanced-compilation
Working on updating my blog post with the new process.env
shimming, and I'm noticing that node_modules are no longer automatically installed. Is there a compiler option I need to pass to make that happen?
I've googled a bit but not managed to find any articles on speeding up REPL startup/build time for CLJS projects. Do you guys know of any writeups on the matter or perhaps specific tips? 🙂
@ajpierce :install-deps true
for the old behavior and cljs.build.api/install-node-deps!
to manually run this step.
@reefersleep :parallel-build
helps, but probably the best way is to just partition the build instead of building everything, which may require restructuring the code a bit
cheers @dnolen 🙂 I wonder if there's any partitioning to be done in my hobby projects. All of them are very small to begin with. I'm not very knowledgeable about build processes, as you can tell, which is why I was hoping someone had done a writeup on the theme 🙂
but this is raw REPLs, if you’re going to use Figwheel or nREPL then there’s going to be some startup time
Hah, does a T500 from 2008 constitute "newer hardware"? 😉
But yeah, I'm also using Figwheel
And since I'm using cider, I guess nREPL too
yeah I’m on a slower machine as well so I’ve done a lot a work around this, but you bottom out at your tooling choices
So I'm really making it hard for myself 🙂
My machine has trouble just running Slack in the browser...
I'l give that and :parrallel-build
a go 😄
given your machine and your projects I think :parallel-build
will probably not have much impact
I'll look into that, for sure! I must admit that I stopped keeping up with hardware details a long time ago, can't remember when multiple cores became commonplace.
It doesn't seem like AOT builds are available online for figwheel-sidecar
. Do I have to clone and compile it myself (possibly with some magic compile flags) to provide it locally?
Ach 😕
many projects don’t do this - but I think for critical pieces of the ecosystem I don’t see why people aren’t
AOT can be a bit finicky it’s true but I think ClojureScript shows that it’s possible for a large Clojure project to be AOTed and work as expected
hm, alright. I guess I'll have to lobby @bhauman for AOT of figwheel-sidecar
, then 🙂
would mounting the same component result in re-rendering even though the data/state is the same?
@dnolen super minor detail but in the readme, maven dependency information still points to <version>1.9.670</version>
@jpmonettas thanks, fixed
@dnolen As we discussed I creted a minimal repo concerning CLJ-2280 it is linked in the ticket’s comment https://dev.clojure.org/jira/browse/CLJS-2281.
@jeremys this your first time reporting on an issue so I understand you might not be familiar with the process.
please provide a minimal repo inline in the ticket - demonstrating how to reproduce with only the QuickStart uberjar