Fork me on GitHub
#hoplon
<
2017-06-17
>
flyboarder00:06:14

I just pushed hoplon 7.1.0-SNAPSHOT this version includes optional :pre/:post conditions and optional docstring support for elements.

flyboarder00:06:25

@alandipert do you have a small project you could test?

thedavidmeister03:06:32

@flyboarder how much of a jump is it between 7.0.1 and 7.1.0?

flyboarder03:06:44

@thedavidmeister just the defelem docstring and pre/post conditions

flyboarder03:06:04

also 7.0.2 includes the goog attribute fix

thedavidmeister03:06:18

also, i haven't tried this, but does defelem support meta data?

flyboarder03:06:52

no, which is why I opted to specifically include the docstring metadata

thedavidmeister03:06:12

ok, so it would support meta data in 7.1.0?

flyboarder03:06:47

this is a 7.0.1 elem (defelem my-elem [attr kids] (div attr kids))

flyboarder03:06:15

this is a 7.1.0 elem (defelem my-elem "My Custom Element" [attr kids] {:pre [] :post []} (div attr kids))

flyboarder03:06:35

where the docstring and pre/post map are optional

thedavidmeister03:06:05

oh yeah, but can i put my own metadata on a 7.1.0 defelem?

flyboarder03:06:20

although post conditions will always get the element constructor since thats what defelem returns

flyboarder03:06:25

no custom metadata

thedavidmeister03:06:35

ah ok, maybe in the future 🙂

flyboarder03:06:57

ie. (defelem ^:something val my-elem [attr] kids... doesnt work

thedavidmeister03:06:15

@meeli and i were just talking about the idea of putting metadata on defelem that can autogenerate a devcards-ish styleguide

flyboarder03:06:32

the more of that you want the more we need to reimplement defn

flyboarder03:06:02

or reimplement it’s argument parsing

flyboarder03:06:48

im working on a hoplon.spec lib right now

flyboarder03:06:00

something to show soon….

thedavidmeister03:06:22

so the idea is that we'll swap out the current tests with that?

thedavidmeister03:06:33

and then have something to build future tests for core on top of?

flyboarder03:06:01

yep, ideally we can solve half the issue with specs for hoplon macro’s and the other half by having attribute providers write tests for their attributes, custom elements would use the :pre conditions for local attributes

thedavidmeister03:06:19

well, i'm into that 🙂

mdo07:06:55

Hello, I'm a Hoplon (and Clojure) beginner and am trying to get Hoplon working with Korma. I try to require Korma in an index.cljs.hl like this: (page "index.html" (:require korma.core korma.db)) ... but I keep getting: No such namespace: korma.core When I do boot show -d Korma is listed, I have appended it to the :dependencies list in my build.boot: [korma "0.4.3"] ├── [com.mchange/c3p0 "0.9.5.2"] │ └── [com.mchange/mchange-commons-java "0.2.11"] └── [org.clojure/java.jdbc "0.6.1"] [mysql/mysql-connector-java "5.1.6"]

mdo07:06:34

s/boot.ini/build.boot/

thedavidmeister07:06:47

i think that for .hl files you need to wrap dependencies in a vector

mdo12:06:38

oh, I see, the compiler looks for a korma/db.cljs but Korma only provides a clj

mdo12:06:25

Am I even supposed to access a database from within a .hl file?

flyboarder18:06:58

@mdo generally no, you would access it from your backend, usually clojure

flyboarder18:06:13

or you would implement something like pouchdb