This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-07
Channels
- # admin-announcements (4)
- # beginners (63)
- # boot (67)
- # clara (29)
- # cljs-dev (38)
- # cljsjs (10)
- # clojars (7)
- # clojure (336)
- # clojure-belgium (3)
- # clojure-dev (22)
- # clojure-greece (30)
- # clojure-nl (1)
- # clojure-russia (9)
- # clojure-spain (3)
- # clojure-spec (169)
- # clojure-uk (12)
- # clojurescript (45)
- # clojurex (4)
- # core-matrix (3)
- # cursive (58)
- # datascript (3)
- # datomic (18)
- # events (38)
- # hoplon (228)
- # immutant (5)
- # lambdaisland (6)
- # leiningen (3)
- # luminus (8)
- # off-topic (11)
- # om (113)
- # om-next (2)
- # onyx (10)
- # parinfer (7)
- # planck (22)
- # re-frame (11)
- # reagent (25)
- # robots (7)
- # spacemacs (3)
- # specter (10)
- # yada (3)
@yogthos: nice post on Hoplon + Lein 🙂 no one here actually paid attention to that. It does matter for wider adoption, even though Boot is awesome
Link?
@yogthos: hi, great article! Thanks @dm3 for mentionning it!
Is the use of jQuery is repellent for most reagent folks?
I haven't read this in your discussion but heard that here and there
given the way people evaluate JS frameworks nowadays - a framework has to meet three criterias: 1) be based on React.js 2) not include jQuery 3) be released during previous 6 months
i think we can separate the jQuery usage into a separate namespace before 6.0.0, how does that sound?
jQuery really only is used by do!
and on!
multimethods, whose definitions would stay in hoplon.core
so you wouldn't need to refer directly to anything in the new namespace, it would only install multimethod dispatches for the core do!
and on!
multis
So defelem doesn't use jQuery?
and put that in a different namespace, so then you'd do (:require [hoplon.zepto])
and you'd get the same attributes, just implemented using zepto instead
Tempting... Is the separation worth it?
Hoplon.jquery hoplon.zepto ...
but like there was a case in here the other day where hoplon was going to be mounted in an application that already had a different version of jquery in use
@yogthos: i really don’t know enough about react and reagent
Ah yeah... I remember that
@micha can’t you just do noconflict?
@yogthos: also, can’t you batch updates to javelin with j/dosync
?
@thedavidmeister: i thought that would work, but then i thought of jQuery plugins, and how that would work with noconflict?
i didn't see how you'd use jQuery plugins with noconflict set, because you'd have two separate jQuerys
@micha oh man, i do it all the time
i’ve got a project with like, 3 versions of jquery and another one for the “backend"
(don’t ask)
you do end up with separate jquery’s with their own plugins
can’t be much done about that
but they work fine in parallel
you just put them on different globals
and often i end up hacking the plugin file a little bit to wrap it in a closure
(can’t spell the word closure any more…)
or, similar
different plugins have their own way of working with jQuery
the worst is when they’re like window.jQuery
something, something
yeah maybe
aaaah i had a blog post years ago where i went through all the different ways plugins attach themselves
and how to mess up the plugin file to make it work
nah you can’t do it automatically
because they all work a little different
you kind of have to read the plugin and see what it’s doing
some of them do some weird stuff…
that said, there was a drupal module i used years ago that tried to do this
and had a pretty good hit rate
but yeah
(function(jQuery) {
// plugin goes here.
})(jqXYZ);
that works usually
lol, i’m getting flashbacks just reading through this stuff
but that's facilitated by the fact that javelin can internally compare values for equality
i really like using javelin formulas that trigger things
i dunno if i’m killing kittens when i do that
two objects aren’t equal in javascript
trick question
javascript equality is the worst thing...
cljs has immutable, persistent collections, so value equality is cheap, constant time operation
so, something i’m doing right now
is, “when the websocket is connected, and you have an auth token for the current user, and the user selected a project, get all the stuff for that project from the server"
it’s just
(cell= (if (and websocket? token current-project) (fetch-stuff! current-project token)))
oh, i missed an if 😛
something like that
it will “just happen” when everything in the if is true
aaaand
when the user changes the current project
it will also fetch those things too
yep, you can also make a formula that just contains (cell= (and websocket? token current-project))
that’s true
i don’t even know about the kittens
@micha this is kind of off topic, but do you know anything about JWT authentication with sente and ring middleware?
@thedavidmeister: yeah I think dosync batches like the clj core one right?
@yogthos: yeah, you dosync
and none of the javelin cells update until they all do, and then the new values propagate together
@yogthos: loved the post also. I'm currently iPad-bound and was able to get my Hoplon dose through it 😀
Where are you guys located?
Durham NC, USA
@alandipert: you actually gave a remote talk at our meetup a while back 🙂
Formerly buffalo tho, visited Toronto often. Love the city
Yup ! Thanks to Dann, awesome guy
@lewix: there was a thing a while back: https://github.com/brendanyounger/aspis
I prefer native Dom, has better perf :hugging_face:
In truth having easy jq plugin access is what I've enjoyed about hlisp way
I can see that changing as react grows, maybe
Although it's hard to imagine a force greater than jq
Then there are things just easier to do in Hoplon, like drag/drop... Since the objects moving are the same ones in the code
Other things easier to do in react perhaps, like dense/deep trees
Like a text editor buffer would be an obvious thing to use react for, as emacs does
vue was using native Dom, now they're combining both the virtual DOM and the reactive dependency ; it adds to it in term of performance, it doesn't remove anything as far as I know
alandipert: http://gaearon.github.io/react-dnd/ this library is awesome to do drag and drop in react. no surprises
Well, maybe it is. React can be faster when you don't care about exactly-once change
Like it's ok for emacs to reprint the buffer as much as it wants, no missiles visibly launching, no other effects attached to the buffer
So it doesn't need to do equality checks so is faster
I can see it being a thing in the browser, like canvas
I'll check out that dnd lib
Altho my point was that because objects real in Hoplon you can do it in so little code, you somos wouldn't care to use/make a library
Just seems like a sweet spot of the model, other spots like trees maybe less sweet
Baby is awake back in 18 years
@yogthos: I forgot to mention, you may consider using for-tpl instead. It's new, less likely to scare people away as loop-tpl has over the years
Eg (for-tpl [x xs] ... )
Still both better names than the original, thing-looper lol
Haha lockdown means holding cell ;-)
Maybe he hasn't really left hoplon...
Hahaha
@jumblerg: Does anyone have any guidance of how to use Hoplon/UI even in it's preliminary state? I followed the responsive-attributes branch checkout procedure here http://hoplon.discoursehosting.net/t/installing-responsive-layout-attributes-hoplon-ui/580
It sets up '[hoplon/hoplon "6.0.0-alpha13"]', but in the Hoplon/UI library code is already update to use 6.0.0-alpha15. Is that branch deprecated for Hoplon UI?
@chromalchemy: howdy! …and those are quite out of date.
the stuff i’m using in production now is on the v2 branch, i’m about to merge it in this evening or tomorrow
@jumblerg: Hi. I am a big fan of what Hoplon provides, and what you are doing. I've been waiting to ditch CSS forever, and start getting creative!
if you’d like to give it a whirl, despite the fact my readme is just a big warning, check out the current hoplon master and then v2
Never really learned jQuery well either, and have been holding out for higher level tooling to do the designey web... 🙂
I checked out v2, just not sure how to use it. I don't use the Clojars address in the readme, correct?
Yeah, I'm game to experiment and deal w breaking changes, etc. Maybe i can give some meaninful feedback as a designer.
@chromalchemy: it is a bit limited atm, but the layouts seem to be working well. examples of how to use it appear in the material.cljs.hl file in the tst directory
that would be great. the idea is to create a number of toolkits as separate libs on top of it; i’m currently working on implementing parts of the material-ui spec.
i’m happy to share more snippets of code that uses it from some of my projects in a private channel
@jumblerg: Cool. I am into having a composable foundation so one can build up an intuitive functional design dsl as needed
it helps a lot. having tools for abstraction and composition at the ui/design level makes things so much easier.
Thanks. I have to run in a few, maybe I can query you a bit tomorrow. Do you have any links to code examples?
I think it's interesting that the Gui/UI seems to be the most intutive thing to want to program, yet the most convoluted from a software stack perspective.
the current challenge is figuring out what the best practices, abstractions are once the there’s actually a way to abstract and compose things
So I dont need the responsive-layouts branch? Why do I need to to check out the current hoplon master? Would I just depend on it in clojars?
I think I might have some ideas on meaninful abstractions that I want to work out and play with.
not any longer, not for the v2 branch, i’ve changed a lot and haven’t updated the docs
So I can just build the jar for v2 and use it in a current Hoplon template?
How specifically would I depend on the library in the build.boot and page ns?
yes, against the current hoplon master, which is ahead of the last distribution on clojars
i’ll try to straighten some of this out in the next 24 hours or so to make things easier for you, maybe even get a build out
Ok. Do I need any special incantation beyond git checkout to use the latest master locally (or does Maven automagically know what to do)?
That builds the jar. But then I use that jar in a vanilla Hoplon project?
What would I put in dependencies?
So I use hoplon/ui from that project. I dont need to start another?
So far in my efforts, I am getting errors like this 'WARNING: Bad method signature in protocol implementation, hoplon.core/IHoplonParent does not declare method called -append-child! at line 51 C:\Users\rigalo\.boot\cache\ tmp\Users\rigalo\Desktop\Dev\hoplon\ui\ui-test\1nk\a5dt8o\index.html.out\hoplon\ui\elems.cljs'
Maybe just from not using the latest master yet...
So once I build the jar, I can just require '[hoplon.ui]' in a page macro? I dont see it listed in dependencies in the project build.boot.
once you run boot build
, which will install the jar in your local maven repo, you can add the [hoplon/ui “0.0.1-SNAPSHOT”]
to the deps in your boot env map in the build.boot file of your own project.
or (checkout :dependencies '[[hoplon/ui "0.0.1-SNAPSHOT"]])
in your development task pipeline if you’ll be hacking it yourself
in your src directory just add an app.cljs.hl
following the example in the previous link
Ok thank you for the directions and boilerplate. I'll try it out tonight and write back.