This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-04
Channels
- # admin-announcements (14)
- # aleph (3)
- # beginners (75)
- # boot (95)
- # carry (4)
- # cider (23)
- # clojure (39)
- # clojure-android (3)
- # clojure-brasil (2)
- # clojure-dev (17)
- # clojure-gamedev (1)
- # clojure-mexico (12)
- # clojure-poland (12)
- # clojure-romania (1)
- # clojure-russia (10)
- # clojure-spec (8)
- # clojure-uk (36)
- # clojurescript (34)
- # core-async (4)
- # datomic (40)
- # emacs (1)
- # events (7)
- # hoplon (119)
- # instaparse (52)
- # keechma (71)
- # mount (4)
- # off-topic (9)
- # om (4)
- # onyx (3)
- # other-languages (23)
- # protorepl (3)
- # re-frame (9)
- # reagent (26)
- # rethinkdb (5)
- # spacemacs (2)
- # testing (1)
- # yada (1)
there it is: https://github.com/hoplon/boot-hoplon/commit/d44d3e8759421ef74f94fff94bc52d7206cb2bf3
works like a charm
(ns+ human-dynamics.computeable-law
(:page
"index.html")
(:refer-clojure
:exclude [- name])
(:require
[javelin.core :refer [defc defc= cell=]]
[hoplon.core :refer [defelem for-tpl when-tpl case-tpl]]
[hoplon.ui :refer [component elem button image toggle form window *scroll*]]
[hoplon.ui.attrs :refer [- c r s b d]]
[hoplon.material.colors :refer [white grey grey-300 black]]))
exposed a previously undetected error in my code too where, yet again, a symbol was getting rebound to one of the element constructors.
it is also quite nice being able to refactor a function to a macro and back without having to update every ns declaration in my code.
@micha: incidentally, how does ns+
resolve the ambiguity that arises when there’s a fn and a macro with the same name in the same ns?
i don’t plan on doing this anytime soon, so i’m not complaining. i already did that and got what i wanted. 🙂
back to complaining… could probably do without use, maybe? i know clj supports it, but if its there ppl will use it.
with :use you can achieve anything you can do with :require, plus the :exclude that :require does not support
i guess the thing i care about is that it is explicit where dependencies are coming from, i find it annoying when i open up some ns and there are multiple :use or :requires with :refer :all, and symbols are being referenced without any way to tell where they’re coming from within that file.
well that's a tradeoff, you will not find a file where everyone agrees on whether it's good style or not
i also just reproduced that bug i mentioned to you in my “report” a couple days ago: create file that compiles to index.html, create another file that compiles to helloword.html, load index.html in the browser, save the helloworld file with boot-reload in the pipeline.
i do the with-page-load thing myself because it ensures that there is no stale state hanging around
if the boot-cljs thing happens it would be regular ns
with the page as metadata, and enable an option in the cljs task
you could also throw an exception whenever the same definition is used for a macro and a fn.
i didn’t check, but this way you could explicitly disallow it since you’re compiling everything in there.
i'm not sure i have that information, since i use the compiler to analyze the requires anyway
if i do (:require-macros [foop2.lib :as lib])
in the lib.clj
file, it then chooses the macro
aaaand, if i do (ns+ foop2.lib (:require [foop2.lib :as lib]))
in lib.cljs, i get a circular dependency error, which makes sense
with opensource software it's cool to leave footguns like this in there, because someone will submit a PR to a useful library that does the bad thing to fix it
try it out in cljs and see what happens. it would be a nice-to-have everywhere, i think.
maybe some concern for compiled js size with advanced optimizations, :refer :all would bring in unnecessary names potentially
but that seems like a non-issue, as we're all adults here and can decide for ourselves if that's what we want