This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-23
Channels
- # aleph (8)
- # aws (2)
- # beginners (36)
- # cider (35)
- # cljs-dev (157)
- # cljsjs (3)
- # cljsrn (5)
- # clojure (97)
- # clojure-dev (5)
- # clojure-gamedev (3)
- # clojure-italy (27)
- # clojure-russia (11)
- # clojure-spec (19)
- # clojure-uk (39)
- # clojured (6)
- # clojurescript (87)
- # clojutre (4)
- # community-development (35)
- # cursive (8)
- # datascript (2)
- # datomic (14)
- # dirac (8)
- # duct (3)
- # figwheel (13)
- # fulcro (22)
- # graphql (20)
- # jobs (1)
- # london-clojurians (1)
- # off-topic (55)
- # onyx (3)
- # parinfer (3)
- # protorepl (39)
- # re-frame (3)
- # reagent (26)
- # ring (7)
- # ring-swagger (2)
- # rum (1)
- # shadow-cljs (107)
- # spacemacs (8)
- # test-check (4)
- # unrepl (3)
I'm having a hard time wrapping my head around how to implement SPI routes using something like secretary. I have compojure suck up all urls from /app/* and get sent to the same handler, which is a page containing my react rendered app. For my client-side route handler, i'm using secretary, and I have two test routes "/app" and "app/home". So I load my webpage at "/app", and i'm in a situation where i'm switching to another url within the app ie. "/app/" --> "/app/home", how do I go about doing this without triggering a webpage navigation and page load? Setting window.location.pathname = "/app/home" results in the page reloading, and i've noticed that sites like twitter and facebook get away with changing the url without causing the page to reload. What am I missing here?
@U0670BDCH If you are doing this manually i think should use the hash character (#) in your URL, that indicates that the resources you are looking for is relative to the current page
Ya, I did some more research, and came to the conclusion that it is limited to the hash method, and so far it's been fitting my needs
Is there a good library for doing headless browser testing with CLJS?
Hi. I am not aware of any cljs library, but here's good clj library: https://github.com/igrishaev/etaoin.
It seems the best thing is doing Lumo with Puppeteer
I'm trying to build a clojurescript chrome extension using @darwin's wonderful chromex extension but I'm hitting a problem with loading cljsjs dependencies. I expect this is because the foreign library file can not get required properly because of content-script using a different api to load scripts. But I'm not sure how to debug further 😔. Chrome extensions aren't exactly the most informative when things go wrong.
@bbss content-script must be a single file, I think you should use :whitespace
compilation mode for development of content scripts
I am using a single file approach but didn't check whitespace, I did see that in the example project, let me try.
I’m not exactly aware how cljsjs is adding its “foreign” libraries, I was under impression they use :foreign-libs
and those should get concatenated with compiled js file in :advanced
mode, not sure how this works under other modes
Ah, that doesn't seem to work with figwheel, which requires :optimizations to be none or nil.
I know the example doesn't recommend to reload the content script, but I need to do quite a bit of dom manipulation so could really use figwheel. It works so far, just the cljsjs libraries.
I've tried to manually require the script from the cdn, and had to add the url to the content_security_policy
for the request to succeed. And even required the react file manually, it ran (I checked with console.log). But somehow React doesn't get put in the scope.
Yes, I've read about it. All the rest of the clojurescript gets put on the window though, it's really just the cljsjs external deps.
goog.dependencies_.nameToPath.react
"../cljsjs/react/development/react.inc.js"
They are there, and they're requested too. Just no effect..both execution contexts should be accessible in the devtools (page’s and your content-script’s)
How do I turn a vector into a JavaScript object (on which forEach
works)?
And how do I turn a map into a JavaScript object (on which forEach
works)?
I tried (goog.array/toArray [1 2 3])
but it returns #js []
.
@erwinrooijakkers to-array
or into-array
Thanks I will check
Also in the ClojureScript cheatsheet http://cljs.info/cheatsheet/
It seems like a map does implement forEach
But in a different way than a JavaScript object.
JavaScript object has the signature:
obj.forEach(fn [entry index])
And ClojureScript map has:
m.forEach(fn [key val])
Well turned out I need to pass a vector of vectors, than it worked out of the box, without conversions to JavaScript
Thanks!
FWIW, Vector should probably implement forEach
like other CLJS data structures. Feel free to file a ticket.
I tried clj->js
but that gives:
#object[TypeError TypeError: xxxx.forEach is not a function
@donmullen you have to be punching new keys: https://github.com/binaryage/cljs-oops#access-modifiers
@erwinrooijakkers on vectors that should work, forEach is not on JavaScript objects it looks like? You can however iterate objects key-value in JS with iterators in new EcmaScript. It's ugly though.
Hmm what I try to do is convert a vector of maps to a JavaScript object that is accepted by: https://github.com/iotaledger/iota.lib.js/blob/6d9ae54fccc168d9ed757b06e5ea3d284715034c/lib/utils/utils.js#L301
So I have transfers:
(def transfers [{:address "1}])
and this needs to be passed to:
transfers.forEach(function(bundle) {
bundle.forEach(function(bundleEntry, bundleIndex) {
That was it!!!
Thanks man
Het staat zelfs in de docstring
transfers: coll A coll of bundles. Basically is an array, of arrays (bundles),
as is returned from `get-transfers` or `get-account-data`
Ja ik zat op het verkeerde spoor
Nu werkt het gewoon zonder #js ofzo
Twee uur op het verkeerde spoor
BEDANKT!
Nederlander? 😉
Aha 🙂 Waarom Korea als ik vragen mag en hoe is het daar? Thx
Stage voor afstuderen in Shanghai, daarna daar blijven werken, Zuid Koreaanse vriendin ontmoet en daar nu naar verhuisd. Het is een erg fijn land en fijn volk. Momenteel met m'n vriendin vrouwen curling aan het kijken Japan vs Zuid Korea, rivalry tussen Korea en Japan is sterk dus intens, hahah. Op TV helaas, niet naar PyeongChang zelf gegaan.
Ha mooi verhaal. Veel plezier 🙂
@donmullen https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen
@darwin - turns out the js-props object was both sealed and frozen - seemed strange at first that it is both - but evidently by definition a frozen object is sealed.
hi, i’m having trouble getting nvim-parinfer working
which plugin do people use for parinfer like behaviour?
basically looking for osmething that will append closing brackets for me
Has anyone gotten this message when using re-frisk "java.lang.IllegalArgumentException: <filepath>\react.inc.js is not a relative path"?
I haven't, but you're more likely to find someone else who has in #re-frame (assuming it's a re-frisk specific problem)
Is it bad form to use extend-protocol
in library code? I feel like I remember some conversation about a performance hit