This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-11
Channels
- # aws (15)
- # beginners (55)
- # boot (116)
- # bristol-clojurians (2)
- # cider (4)
- # cljs-dev (439)
- # cljsrn (14)
- # clojure (135)
- # clojure-argentina (3)
- # clojure-czech (4)
- # clojure-italy (60)
- # clojure-russia (1)
- # clojure-spec (48)
- # clojure-uk (42)
- # clojurescript (170)
- # cloverage (11)
- # core-async (19)
- # cursive (13)
- # datomic (48)
- # emacs (2)
- # graphql (3)
- # hoplon (8)
- # jobs (1)
- # jobs-discuss (5)
- # klipse (11)
- # luminus (5)
- # lumo (5)
- # mount (48)
- # off-topic (96)
- # om (17)
- # onyx (14)
- # parinfer (30)
- # protorepl (1)
- # re-frame (90)
- # reagent (2)
- # remote-jobs (1)
- # spacemacs (12)
- # specter (20)
- # uncomplicate (1)
- # untangled (65)
- # vim (2)
- # yada (8)
anybody have any neat tricks for converting a state (`(def state (atom {}))`) to a url?
the url is a piece of state too, right? 'what route am i on?' is asking a question about the state of your application - ideally it would be in your state too imo
https://github.com/HenrikJoreteg/feather-app/blob/master/src/views/app.js something like this (havent found a cljs example of this yet)
or, in general, declarative routing advice?
Hello all, why if I´m using figwheel and I load a javascript from index.html stop working after reload?
yes, I have a script that do ripple effect and it stop working after I save the cljs file
If you don’t call the js lib from cljs, I don’t think you need to touch foreign-libs stuffs.
This is just my guess. I’m assuming you are using some kind of React wrapper. Is it possible that after figwheel reload, DOM is rerendered so js binding of the ripple effect is gone?
I´m using reagent, maybe js binding is gone. Is there any way to call load this .js from clojurescript?
I’m not very confident about this. But may be you can use “js/…” like (js/console.log "message")
(js/document.getElementById …)
I´m calling it, but I think it will reload just the clojure stuffs, not the html js stuffs
Ah, I see. Its a 'feature' of sqlite. SQLite does not have a separate Boolean storage class. Instead, Boolean values are stored as integers 0 (false) and 1 (true).
Spec is able to generate example data if I give spec as predicate vector?
but it is not possible to get example data generated for predicate array?
. I wanted it to generate js arrays. Any reason why it would be supported in spec ?
@avichalp that said you should be able to accomplish this with cljs.spec.alpha/with-gen
, I think?
There is some hope to closed issues with cool comments? https://dev.clojure.org/jira/browse/CLJS-536?focusedCommentId=46305&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-46305
@souenzzo if you want an enhancement open a new ticket and link to the old one please - for this issue please set minor priority - thanks
@dnolen Hi, I was reading your post from yesterday about code splitting. I was wondering is there any way to do it dynamically ? I mean by just providing the entry point and compiler figure out the dependencies for that chunk ?
you never need to express deps - just entry points - the algorithm can assign everything else
if i find myself wanting a “default” implementation on a protocol, would that be a smell?
i.e. i have two types that implement a protocol with some 3 functions… but 1 or 2 of those concrete implementations are identical
@dnolen cool. this feature of clojurescript sits well with service workers . thanks man
@lxsameer a blogpost demonstrating use of this feature in combination with service workers would be super cool!
@martinklepsch I'll definitely do that
It seems to work to a degree but it breaks figwheel reloading
figwheel reloads as normal, but the components don't render changes
I've also tried both React-Boostrap CLJS wrappers and they both use om-tools library, which doesn't compile (crashes with NullPointerException)
I am looking for a component library that would work for my om.next project and every single one I find is broken in some way
@roklenarcic That library works pretty well for many people. Must be some little bug on your side 🙂
It works perfectly when I hit reload
but if I add a component or change a label it doesn't show up
until I hit reload
and my compiled folder .js file has the change
before introducing this lib, I used om.dom and figwheel worked perfectly with that
Tried om.next with figwheel now on this https://github.com/madvas/cljs-react-material-ui-example reloads components well
btw I get this warning in console
Warning: Unknown prop onTouchTap
on <button> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
I'll checkout your repo and try
that helped with the warning
how do you run your project
anybody here use a server (i.e. ring) and a client side react app in conjunction with figwheel? When I run figwheel and my ring server they fight with eachother like my parents when I was 11
@goomba I usually run 2 separated REPLS when doing that, so then can live side by side without talking to each other like a lot of parents.
maybe I'm just being a dummy but my issue is I need to fetch content from my ring server and when I launch on fw the client app is put on the localhost:3449
and my ring server is living somewhere else
you have some options
1. you can just ignore the figwheel server in terms of content deploy, implement static page serving on your ring
side, so everyone being at same host/port will just work
2. enable CORS on your server-side endpoint, so it will accept requests from anyone (or whatever you setup the CORS to accept)
* CORS is just returning a header from the page being served: Access-Control-Allow-Origin: *
, modern browsers will recognize it
okay awesome... glad at least to hear it's not just me dealing with parental figwheel issues with this 🙂
@madvas The reason reloading doesn't work is Compassus
I guess I'll roll my own routing
@roklenarcic You may have the same problem rolling your own
I haven’t followed the discussion but if you wanna force a toplevel reload you can probably pass a gensym
ed react key to your top-level element every time
It's weird how Compassus doens't affect om/dom reloading
but material-ui is affected
I’d love to get to the bottom of that issue
can you open an issue in the Compassus repo with a minimal repro?
I'll try tomorrow
my toplevel are routes of course
is there any way to have something else toplevel than routes
I have a header that is independent of routes and now I have it duplicated across all routes
@roklenarcic this is outdated but I think we managed to do reloading in this template https://github.com/compassus/oriens
Reloading worked for me too
when I had something like (dom/button nil "ABC")
now I wrap it in ui/mui-theme-provider and it stops working
and if I disable compassus it starts working again
Here;s a quick pastebin writeup
what's the best way to access javascript object properties?
goog.object/get
why hello!
poppin’ champaign today, I’m sure (offtopic)
how is that better than aget?
you sure? It worked for an object for me
Yes, all the a-
functions are for arrays. aget
happens to work, but is is only an accident of the implementation. It is not really guaranteed to work.
If you’d like oget
, https://github.com/binaryage/cljs-oops
I think one of the best analogies is (+ "foo" "bar")
concatenates strings, but +
is not for strings
So is http://cljs.info/cheatsheet/ outdated?
the problem is we didn’t disallow it and there’s a lot of code in the wild that continues to do so
to be fair, ClojureScript itself also did this and we’re in the middle of cleaning it up
stupid question: why not get
?
i'm (slowly) working on Compleat Interop docs for cljs. should aget
be deprecated for property access, in favor of goog.object/get
?
Looking at the github issues for that cheatsheet it looks like the owner is aware, thanks to @mfikes.
I guess in response to mobileink's question, I would expect something like goog.object/get
to be in the standard lib as oget
since we already have aget
@mobileink it’s simple though not obvious
if you make get
work for JS objects you damage ILookup
performance cause you have to check for this special case
adding oget
isn’t a good idea since what’s the point? goog.object
gives you that a bunch of other stuff
thanks. not interested in changing things, just really explicit and complete doco for us simple minded folks.
@rgdelato FWIW, the docstring for aget
in ClojureScript master has been updated to read “Returns the value at the index/indices. Works on JavaScript arrays.”
@mfikes oh yeah, I've never used it for objects. the docstring is good. it's just surprising to me that there isn't an equiv oget
, so it takes a bit of research to figure out what the obj equivalent is
@rgdelato @mobileink is working on a new interop docs thing that we need to get around to reviewing, it will get covered soon-ish
to be fair why get
doesn’t work for JS Object is simply never going to be obvious to newcomers
in the whatever docs we write, we should probably mention the performance decision as a footnote
I suppose, even if you could write (get obj "foo")
then this would become non-portable, specific to ClojureScript. OTOH (get (to-array [1 2 3]) 1)
is fine in both dialects.
@dnolen re: performance. i'll have to think on it more, but i'm inclined to think it deserves a separate article in Guide. I see lots of performance related stuff here, Not essential for Ref docs, but good for Guide docs, i think.
I don’t think talking about performance is really that important to be honest not on the official site
i never worry about it, so i'm good with that. i don't have any insanely great ideas for performance docs anyway, atm.
if you want to know the deep dark secrets you can always spend a couple of days reading the data structure implementations in the standard lib
good topic for specialized 3rd party docs. "High-Performance Clojurescript". Anybody? 😉
@dnolen re: interops docs, i've got more draft text, but i'm wondering if piling on PRs is efficient for sth still so up in the air. wouldn't it be better to do some blogs to start and turn them into a PR? thinking it would be easier for you than dealing with prs, dunno. your call.
@mobileink if you want to post your own thing that’s fine
I haven’t had time to look at those PRs because there’s a bunch of pressing release stuff in flight
great, thanks. here's a more general question for the community. i have some ideas about docs. they may or may not be acceptable to the maintainers. in development, i have some metadocs, involving things like a list of stuff to cover, a general strategy/plan, etc., which would not be included in the final result. also various drafts which may change drastically. my question: what's the best web service for this kind of thing? assuming it would become a community effort. just using github or a blog seems inefficient to me. i guess i'm asking about a good collaborative doco dev service.
I found this, might be relevant: https://zapier.com/blog/best-collaborative-writing-apps/
thanks! not so interested in word processing stuff, but etherpad looks interesting.
seems to me like collaborating with an existing site like clojuredocs or something would be a good idea, since they already have the SEO
I’ll reiterate @rgdelato’s point - going off an doing a new thing is fine - but probably won’t have much impact
submitting something to the official site will have a lot of impact - you might not be able to write it exactly how you want - but that’s just a tradeoff
But I specified "selfbot-cljs.core" as my :main namespace, unless it's talking about something else :thinking_face:
Oh, maybe I should have asked in #leiningen
is there a compiler option that allows me to run advanced compilation but without mangling the variable names? I want to make a compilation of some Node.js code in advanced more for the performance optimizations, but I don't mind at all about reducing variable names (since in a Node.js the size doesn't matter so much)
@wilkerlucio there’s a debug flag that doesnt fully mangle names: psuedo-names https://github.com/clojure/clojurescript/wiki/Compiler-Options#pseudo-names
@lwhorton thanks, I'll try that 🙂