Fork me on GitHub
#hoplon
<
2016-12-14
>
chromalchemy00:12:21

@jumblerg Thanks! got it working with help from a snippet you gave me a while back

(defc model {:view :home})

(defc= view  (->  model :view))
(defc= route (->  view vector vector))

(defn change-view [model view]
  (assoc model :view view))

(defelem menu-button [{v :view :as attr} elems]
  (elem :click #(swap! model change-view v) elems)

(window :route route

    (menu-button :view :foo)
 
    (case-tpl view
       :home (home-view)
       :foo (foo-view))

candera17:12:36

Advanced compilation seems to be nuking my ability to call .getBBox on an SVGTextElement. What sorcery is involved in making that work?

micha17:12:49

maybe google closure externs are missing that?

candera17:12:05

Yep, headed down that road now.

micha17:12:06

there are some built-in externs for browser provided javascript types

candera17:12:28

Currently trying to figure out HTH to do that. 🙂 I think I’ve got it.

candera17:12:35

var SVGTextElement; SVGTextElement.prototype.getBBox = function() {};

candera17:12:40

That look right for an externs file?

candera17:12:11

Cool, that worked.

candera17:12:23

What a PITA. Hope that thing David was talking about makes all this easier soon.

fiddlerwoaroof17:12:19

I was just wondering about this

micha18:12:14

i'm curious about that

micha18:12:26

it looks like you would add type annotations

micha18:12:34

but js doesn't have interfaces

micha18:12:48

so you would need to know the concrete type

candera18:12:06

But I believe Closure does have interfaces of a sort.

micha18:12:56

yeah but externs are only useful for non-GCL code

micha18:12:14

otherwise you don't use externs, you just compile the js along with the rest of your GCL compatible js

micha18:12:19

and it munges away

micha18:12:40

externs are for like jquery plugins or other random vanilla js code

micha18:12:20

the externs file is a sort of interface spec itself

chromalchemy22:12:51

@jumblerg Do you have a basic example of how the (pick) form elem is set up?

john_tollison23:12:45

I've started playing with http://trigger.io, but when I copy index.html + index.html.js over, and compile for the ios simulator, it looks like I'm losing functionality relating to javalin. Any idea if this should work or if I'm missing something obvious?