This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-06
Channels
- # admin-announcements (17)
- # beginners (78)
- # boot (162)
- # braid-chat (2)
- # cider (20)
- # cljs-dev (9)
- # cljsjs (41)
- # cljsrn (17)
- # clojure (98)
- # clojure-austin (5)
- # clojure-brasil (1)
- # clojure-dusseldorf (1)
- # clojure-greece (1)
- # clojure-ireland (2)
- # clojure-italy (1)
- # clojure-japan (5)
- # clojure-russia (128)
- # clojure-uk (2)
- # clojurescript (29)
- # core-async (1)
- # core-logic (7)
- # css (1)
- # cursive (12)
- # datomic (18)
- # devcards (1)
- # dirac (6)
- # emacs (31)
- # funcool (28)
- # hoplon (208)
- # jaunt (66)
- # jobs (1)
- # juxt (6)
- # lein-figwheel (14)
- # off-topic (9)
- # om (83)
- # om-next (6)
- # onyx (63)
- # overtone (1)
- # parinfer (2)
- # protorepl (23)
- # re-frame (27)
- # reagent (14)
- # ring-swagger (8)
- # slack-help (2)
- # spacemacs (1)
- # untangled (56)
hi all. has anybody managed to get clojure support (syntax highlighting) for *.cljs.hl files in Atom io Editor ? cheers
i have managed to set it for .boot files but not *.cljs.hl files. thanks for the help
what’s up with https://github.com/hoplon/hoplon/wiki/HLisp … what can I do to help document HLISP? Seems like its one of Hoplon’s killer features!
This does not seem very friendly 😉 https://crossclj.info/ns/hoplon/6.0.0-alpha9/hoplon.core.cljs.html#_make-elem-ctor
@micha: Atom does not accept '*' or '.' at the beginning of the file extension. for .boot files i just put "boot" in the list of clojure source. for cljs.hl i tried nothing happens, for hl also nothing
Seems like this is the closest to human readable documentation https://github.com/hoplon/hoplon/wiki/API-Documentation
@micha i suspect the dot in the middle of cljs.hl is a special case Atom doesnt treat
@micha i think i am going to stick to lighttable for now (see if there is autocomplete) and jump into hoplon learning
one thing about lisp is that you don't need autocomplete as much as with an OO language
because the functions whose names you would be completing are general and can be applied to any object
@micha i see. i guess it is the "library exploration" aspect of autocomplete which attracts me. instead of always opening some doc
not like the way you have the same kind of method named different things on different obejcts
most of what you do is accomplished by composing just maybe 10 or 20 functions from clojure.core
map, filter, reduce, assoc, dissoc, group-by, sort, sort-by, partition, interpose, partial, apply, comp, juxt
Unfortunately, https://github.com/exicon/hoplon-semantic-ui-example doesn’t have any code...
@micha not familiar with it yet, planning on using it as it seems it will do well for desktop and mobile web app
Unfortunately, when semantic-ui selects the value it overwrites my value (which is initially a cell) with a plain string value
@dm3: the main thing is that i don't want to be running the bleeding edge unstable stuff in my editor
@micha is there a plan to abstract websocket/channels in hoplon like you have already done with http ?
i've been trying to get into spacemacs, but there isn't anything good for managing my workflow in there
@jouerose: yes i think websockets can be supported very nicely as a middleware layer wrapping castra
@micha it is something i hope to see in Hoplon. the framework has started quite well. it would be great to have this aspect of realtime baked in.
i don't mind using emacs keybindings inside a plugin or whatever, but the combination of everything being slightly slower and not having a way to set up tabs and buffers and things like i can in vim makes it too cumbersome
@jouerose: there's https://github.com/hoplon/notify, although it's a bit convoluted
@piotrek - seems noone is aware of the semantic library here, guess @onetom could help once he's online
another approach would be to look at the js semantic uses and see if you can attach cells to functions in there
as I can simply do $(“#my-ui-widget”).dropdown()
where dropdown
comes from semantic-ui
so what i would do is see if you can find getters and setters and events on the widget's js object
and have event handlers that set the value in the cell when the user change the value via the ui
When I use library like jquery, where I define some component (like in my snippet) I have to add some init code (e.g. $(“#my-ui-widget”).dropdown()
)
what is the idiomatic way to handle this init code especially if I define a reusable defelem
returning such components?
look https://github.com/hoplon/jquery.daterangepicker/blob/master/src/hoplon/jquery/daterangepicker.cljs.hl for an example
this is how the plugin is reinitialized based on the updated opts
cell (or the first time)
@jouerose: Regarding .cljs.hl support syntax in Atom editor, have you read this?
"*":
core:
customFileTypes:
"source.clojure": [
"cljs\.hl"
]
hmm, I wrapped my init into with-init!
but I am getting error in console: Transition: Element is no longer attached to DOM. Unable to animate. slide down in <div class="menu" tabindex="-1">…</div>
first, you want to only act on the element that you've created: (doto (js/jQuery p) (.dropdown))
@jouerose: or simply this :
"*":
core:
customFileTypes:
"source.clojure": [
"hl"
]
@jouerose: maybe a last possibility "cljs\\.hl"
@piotrek, maybe the semantic-ui javascript is doing something funky there. I don't see why the element would get detached
@micha I have done as you suggested - I registered my onChange
listener on the semantic-ui component and my listener updates a cell passed as a param to my defelem
element
@micha @leontalbot thank you for your help. I understood my 3 misunderstandings regarding the configuration of cljs.hl syntax highlight support in Atom editor. 1) support of boot files comes already with the core clojure language support. 2) I had placed customFileTypes at the end of file but order matters and it must be under the "core:" title like in the example @leontalbot gave. i checked and there is no need to espace characters "cljs.hl" works fine. "hl" also. 3) inside the customFilesTypes, the scope called "source.clojure" was written "clojure.source". Thanks all for your help.
@jouerose: Excellent!
I can I translate the following in hoplon?
window.onload = function() { init() };
function init() {
Tabletop.init( { key: public_spreadsheet_url,
callback: showInfo,
simpleSheet: true } );
}
I've included js library to head
but I get Uncaught ReferenceError: Tabletop is not defined
while doing the following
@leontalbot: i am new. i am going to learn too
@jouerose: if you have a moment and would like to make a note on the wiki about how you did it that would be most appreciated!
@leontalbot: the issue you're seeing is that script tags will load async
a bettwe way to do that is to make the js into a cljsjs package that you can depend on in your project
(with-init!
(.init js/Tabletop
(clj->js
{:key sheet-key
:callback #(reset! sheet-data @%)
:simpleSheet true})))
otherwise, if you don't want to do that you can use the jQuery.getScript("/somescript.js", function() { callback here })
@leontalbot: yeah when with-init!
runs the script hasn't yet finished loading
ok...
Thanks
A cljsjs package is something I can do locally or I must push to clojar?
ok, I try that!
@piotrek: we are using semantic ui CSS only and hardly missed anything from the js parts indeed
good point though that there is nothing under https://github.com/exicon/hoplon-semantic-ui-example
i got stuck with it because at that time less4j couldnt compile the less source of semantic ui.
we ended up using the vanilla default build instead.
whoever i tried the boot-sass
task w bourbon and foundation and i have some instructions for that here:
http://hoplon.discoursehosting.net/t/trying-to-create-a-boot-task-to-compile-sass-files/386/9
thanks to deraen there is also a boot task for LESS: https://github.com/Deraen/less4clj so u can follow the same principle and just get the semantic ui less source from webjars: http://www.webjars.org/listfiles/org.webjars.bower/semantic-ui/2.1.8
@piotrek: here is an example of a hoplonified semantic ui dropdown:
(defelem multiselect-dropdown [{:keys [items placeholder on-change]}]
(let [visible? (cell false)
sorted-items (cell= (sort items))
selected-items #(filter :selected (vals @items))]
(div :class (cell= {"ui fluid multiple selection dropdown" true
"active visible" visible?})
:mousedown #(reset! visible? true)
(i :class "dropdown icon")
(loop-tpl
:bindings [item (cell= (filter #(:selected (val %)) sorted-items))]
(a :class "ui label transition visible" (cell= (when item (:title (val item))))
:mousedown #(do
(swap! items assoc-in [(key @item) :selected] false)
(on-change (selected-items)))
(i :class "delete icon")))
(div :class "default text" placeholder)
(div :class (cell= {"menu transition" true "visible" visible?})
:tabindex "-1"
:focus visible?
:blur #(reset! visible? false)
(loop-tpl
:bindings [item sorted-items]
(div :class (cell= {"item" true
"active filtered" (:selected (val item))})
:click #(do
(swap! items assoc-in [(key @item) :selected] true)
(on-change (selected-items)))
(cell= (:title (val item)))))))))
example usage:
(defc fields-data nil)
(def resolutions
(cell {:720x1280 {:title "720x1280"}
:540x960 {:title "540x960"}
:1280x800 {:title "1280x800"}
:1280x720 {:title "1280x720"}
:1024x600 {:title "1024x600"}
:320x480 {:title "320x480"}
:320x320 {:title "320x320"}
:240x400 {:title "240x400"}
:480x800 {:title "480x800"}
:360x640 {:title "360x640"}
:240x320 {:title "240x320"}}))
(ui/multiselect-dropdown :items resolutions
:placeholder "Choose at least one"
:on-change #(swap! fields-data assoc :supported-resolutions (map :title %)))
hi all. in the boot.properties file there is BOOT_CLOJURE_VERSION=1.7.0 and in the build.boot there is a dependency [org.clojure/clojure "1.7.0"] . what is the relation between the two ? is there any one that overrides another ? thanks for letting me know. cheers
@jouerose: BOOT_CLOJURE_VERSION
is the version of clojure that boot uses for itself, [org.clojure/clojure "1.7.0”]
is the project dependency version of clojure
@flyboarder: Thanks.
@flyboarder: if i were to bump up the boot clojure version to 1.8.0 do you think it would be ok or would i may be be messing with it ?
@alandipert @micha would have a better idea on the stability of using 1.8 with boot, I think it would depend on what tasks you are using
i use 1.8 all the time
my only problems are from libraries that don't work with 1.8
e.g. some popular clojure libraries that are shipped with AOT'd clojure, like older versions of cheshire
usually the fix it to update that dependency
instaparse is another one - contains non-forward compat AOT'd clojure bytecode
but yeah, boot itself is fully 1.8 compat
(afaict ™️ )
@alandipert: thanks