Fork me on GitHub
#hoplon
<
2016-03-30
>
micha00:03:54

the wiki is looking great

micha02:03:53

so i'm thiking about moving the do! and on! default definitions to a separate namespace

micha02:03:10

the multimethods themselves will be defined in hoplon.core still

micha02:03:45

but like (defmethod do! :toggle ...) and friends would be moved to a namespace like hoplon.jquery or something like that

micha02:03:03

that would make jquery optional

micha02:03:12

because that's the only thing we really use jquery for

levitanong02:03:43

I think that is a good idea.

micha02:03:45

then we could have hoplon.goog or something with the default do! and on! methods for goog

micha02:03:15

because of the way cljsjs works, jquery would only be pulled into the build if you :require hoplon.jquery

levitanong02:03:34

A lot of the people I talk to about hoplon are taken aback when they hear it uses jquery

micha02:03:05

most of the people who use hoplon use it with jquery, i think

micha02:03:34

i mean imo you have to be a little wacky to not appreciate it for what it is if you're working on a commercial application

levitanong02:03:08

It’s just something they’ve gotten used to avoiding because of things like angular and react

micha02:03:09

like jquery is underneath like 70% of all websites, so it's pretty legit in terms of reliability

levitanong02:03:19

yeah, no question about jquery’s reliability

micha02:03:26

vs. goog closure, with 0.005% market share

micha02:03:09

but i think we could probably get the minimal default things working reliably with goog

micha02:03:20

which would eliminate the handler leak issues

levitanong02:03:27

i do like separating things out. I will probably still use jquery

micha02:03:33

at least if you're just doing the default things like (div :click ...)

levitanong02:03:36

i don’t think goog has fade and slide

micha02:03:50

hm that's unfortunate

levitanong02:03:03

could be wrong 😄

micha02:03:15

also goog is probably bigger than jquery

levitanong02:03:22

oh it exists

levitanong02:03:42

god that’s horrible documentation

micha02:03:58

haha man i forgot how incomprehensible it is

micha02:03:15

> 1 hidden protected item

levitanong02:03:54

Ah yes, I’ve used velocity.

levitanong02:03:56

I vouch for it

jumblerg02:03:45

@micha: wow. greensock. i was using that guy’s stuff back in the day when i was doing actionscript/flash development.

levitanong02:03:46

never heard of green sock though

micha02:03:24

i think greensock is the one that has lots of things internally that decide which implementation to use

micha02:03:38

based on performance on the specific platform it's running on

micha02:03:48

like css animations vs js, things like that

levitanong02:03:14

sounds big 😛

micha02:03:48

yeah these things would need to be incorporated into the gcl compiler stuff

jumblerg02:03:58

greensock licensing might be problematic: http://greensock.com/licensing/

alandipert02:03:28

that reminds me of trumpet winsock

alandipert02:03:49

for when you absolutely, positively needed tcp/ip in win 3.1

micha02:03:43

that dude must be a millionaire now

jumblerg02:03:53

ah, yes, another blast from the past when shareware was a thing

jumblerg02:03:37

i think he was also famous for not making any money on it too...

jumblerg02:03:57

i actually paid greensock once.

micha02:03:14

> I wrote trumpet winsock

alandipert02:03:23

first date is in the bag

alandipert02:03:02

@jumblerg: hello btw! long time no see

alandipert02:03:19

or hear, or really anything. been following various things on github tho. you are still hoplon-ing i trust?

jumblerg02:03:25

@alandipert: better late to the party than never!

jumblerg02:03:21

yesterday i logged into #C08BDAPRA and was like “wtf did everyone on irc go”?

jumblerg02:03:26

not quite as much hoploning recently due to other business obligations, but getting back into it!

alandipert02:03:59

yeah i check in to irc from time to time, usually to find that i missed helping some frustrated beginner 😦

jumblerg02:03:33

phew! >>>As a gesture of good will, Peter Tattam, the sole copyright owner of Trumpet Winsock, has also issued an amnesty on any copyright infringement by all users (individual and corporate) of Trumpet Winsock indefinitely for use prior to Jan 2011. He does however reserve all other rights in the copyright of Trumpet Winsock. Please note that Trumpet Winsock is still available for sale and is NOT free - should you wish to continue to use it, you should order a registration key from us. Please send your order to <mailto:[email protected]|[email protected]> .

micha02:03:57

i wonder how many sales he makes

jumblerg02:03:44

maybe it’s on the app store lol

alandipert03:03:48

hm, anyone run into problems with cell= and map destructuring?

alandipert03:03:11

(cell= (fn [{:keys [x y]}] [x y])) gives me

WARNING: Use of undeclared Var hoplon.app-pages._index_DOT_html/map__14317 at line 15 hoplon/app_pages/_index_DOT_html.cljs
WARNING: Use of undeclared Var hoplon.app-pages._index_DOT_html/map__14317 at line 15 hoplon/app_pages/_index_DOT_html.cljs

micha03:03:31

yeah it's pretty annoying

alandipert03:03:54

is something lifted there and that's what it complains about?

micha03:03:56

it works fine, right?

alandipert03:03:32

yeah it works

alandipert03:03:02

the annoying part is it stops reload

alandipert03:03:22

btw dude cljs.js/eval totally works when no optimizations

micha03:03:32

whew that's pretty great

alandipert03:03:37

it's easy to make a real spreadsheet with this thing and cells

alandipert03:03:41

a cljs spreadsheet

alandipert03:03:02

the eval formula cell

alandipert03:03:08

a+ would eval cljs reactively again

alandipert03:03:12

the way they have it, theres a function you can call with all your code, including the ns

alandipert03:03:20

the plan is to do that, get js back, and run it in iframe

micha03:03:32

sounds ideal to me

micha03:03:48

i'm curious if you can take that js and run it through gcl?

alandipert03:03:48

i'm not sure about the iframe part

micha03:03:38

like can we get rid of the clojure macros now?

micha03:03:53

use nashorn to compile the js and pipe that to gcl?

micha03:03:08

that would make things like higher order macros possible

micha03:03:21

like macros that define macros

micha03:03:38

i dont' think you can do it with non-selfhosted cljs

alandipert03:03:39

do you remember a google js thing that ran js inside iframe sandbox?

alandipert03:03:49

started with a c

micha03:03:59

a spanish word

micha03:03:04

or something like that

alandipert03:03:22

search no doit

micha03:03:36

i can almost remember it

micha03:03:24

there we go

alandipert03:03:31

awesome, yes

micha03:03:59

looks like a dead project

micha03:03:26

lol what a weird quirky little project

micha03:03:39

> Caja taming of defensive objects

micha03:03:45

what a helpful diagram

alandipert03:03:47

yeah - funky

micha03:03:00

mr potato head all over the place

micha03:03:13

this must be so old

alandipert04:03:13

has anyone used codemirror with hoplon? having weird problems

vmarcinko04:03:24

hey, does anyone knows if .hl files can be set in Cursive to recognize functions/macros?

dm308:03:02

@alandipert: thanks for pointing out that this annoying error happens due to destructuring in the cell! Even made https://github.com/adzerk-oss/boot-reload/pull/67 as couldn't figure out what caused it

thedavidmeister12:03:28

@micha: i’m like 80% sure what you just described is what was causing me problems with my (cell= (if …)) for navigation

dm312:03:11

yep, moving to goog seems like a great idea

dm312:03:30

should be able to cover majority of current do! and on!

dm313:03:53

hehe, seems like your kind of guy, Micha. Coconuts and all...

alandipert13:03:16

@dm3: lol re: coconut

micha13:03:14

🥥 🌴

jumblerg13:03:28

@micha: doing an little refactoring in castra in support of #19, is there a practical case for exposing the encoding clj->json, json->clj fns via mkremote options? transit assumptions seem to be hardcoded elsewhere.

micha13:03:13

@jumblerg: yeah i would like to rethink how it's organized

alandipert13:03:48

at some point someone suggested eliminating javelin from castra also, which made sense when i looked

alandipert13:03:58

the javelin dep rather

micha13:03:12

yeah also @raywillig's changes

alandipert13:03:49

how has the experience been for people with transit vs. cljson btw? we definitely want to stick with transit?

jumblerg13:03:42

the transition from cljson to transit was unnoticeable on my end, functionally speaking

jumblerg13:03:50

i have ajax requests going in worker threads on my end in support of the polling push, in the process of rolling them into castra

dm314:03:35

nesting tpl things seems a bit funky

dm314:03:39

maybe that's just my code

dm314:03:16

(if-tpl cond
  (div (case-tpl a ...))
  (div (case-tpl b ...)))
results in appendChild failure with 'child is not of type Node'

dm314:03:01

Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.

alandipert14:03:36

uhoh, that's a good test

alandipert14:03:59

Things Must Nest

dm314:03:22

not sure what's the problem though

raywillig14:03:42

@dm3 is your outermost if-tpl wrapped in a div?

raywillig14:03:59

welp, that’s all i got

levitanong14:03:36

@dm3 Have you tried using multiple levels of if-tpl instead of case-tpl? Just a quick way to see how far the rabbit hole goes.

dm314:03:19

nah, works fine on a minimal example

dm314:03:27

must be something else in my code that it doesn't like

levitanong14:03:50

Could be that it’s a problem with the implementation of case-tpl

levitanong14:03:01

have you tried multiple levels of nested case-tpl?

raywillig14:03:51

@alandipert: i had some issues with transit before when moving data in/out of dynamodb some numbers were stored as Long and transit wasn’t packaging them right or something

raywillig14:03:04

there might have been other data types involved

raywillig14:03:20

anyway, i just switched back to cljson and it worked fine

dm314:03:09

nah, can't reproduce on a toy example

micha14:03:34

@dm3: those don't nest

dm314:03:55

they do, if you wrap them in elements

micha15:03:02

the one where you wrap in divs should work tho

dm315:03:15

yeah, it works in my toy examples

dm315:03:21

trying to figure out what breaks in the real app

micha15:03:49

the cached things need to be elements basically

micha15:03:53

can't be other cells

micha15:03:09

because of the way cells are prepresented in the "dom" in hoplon

levitanong15:03:50

I wonder if there's anything we can do to get the template macros to nest directly without intermediate elements

levitanong15:03:46

like, really, nested template macros can be expressed as a more complex single template macro

micha15:03:49

i'm not sure what it would mean

levitanong15:03:03

what if you could have (tpl-macro if pred consq alt)

levitanong15:03:53

then you read everything after the first argument, and those, you cache

levitanong15:03:51

and then if in the argument list, you encounter a list, you cache all the items after the first item

levitanong15:03:55

so on and so forth

levitanong15:03:03

that said, it would be a challenge to figure out which of the arguments to cache, as in the case of cond

levitanong15:03:38

ok so it isn't at all nesting 😛

micha15:03:44

this is why it doesn't nest without a wrapper element:

micha15:03:00

i'm not sure what it would mean if the cell contains another cell

micha15:03:09

like would it add another layer of watches?

micha15:03:39

like if %2 in that line is itself a cell

levitanong16:03:12

@micha: what would happen if %2 were (if cell? @%2 %2) instead?

micha16:03:16

it wouldn't be reactive then because it would need to set up a watch and stuff

levitanong16:03:28

haha, oh well!

micha16:03:32

like what is already doing

micha16:03:40

but recursively

micha16:03:53

which is where i get confused

levitanong16:03:05

I didn’t really think it through when I said the bit about nesting.

levitanong16:03:08

i would like to experiment on making a multimethod for template macros though. I feel like there’s something there.

levitanong16:03:46

ah, nono, a multimethod wouldn’t work.

micha16:03:01

the bearing is p probably possible

micha16:03:19

i just don't find it easy to think about

micha16:03:36

i mean the nesting

micha16:03:42

autocorrect

levitanong17:03:27

@micha, In the append child code, is kids a cell?

micha18:03:09

does it fix the nesting problem?

levitanong18:03:38

at the moment, no. hoping it’ll give you an idea 😛

levitanong18:03:04

but also can you clue me in on where the check is happening?

micha18:03:23

which check?

levitanong18:03:52

so typically when i am encountering an error, and the stack trace isn’t being very helpful, I put printlns at various places

levitanong18:03:02

so far, I have yet to make any of them show

levitanong18:03:30

trying to figure out where "Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node’.” this is happening

micha18:03:39

ah, that's coming from the browser

micha18:03:10

it's when the real .appendChild/insertBefore/etc is called

micha18:03:14

that would be in merge-kids

levitanong18:03:02

i’m placing a println right at the top of merge-kids, and nothing is showing 😞

micha18:03:18

it's in the watcher

micha18:03:23

a println at the top of merge-kids shjould work

micha18:03:28

you should see it print

levitanong18:03:58

unless i’m going about this wrong

levitanong18:03:20

in my index.cljs.hl

levitanong18:03:20

i’m just redefining merge-kids

levitanong18:03:26

is this dumb? 😛

micha18:03:54

hm i don't think that will work, you need to modify the merge-kids in hoplon.core

levitanong18:03:05

but how can i do that without publishing?

micha18:03:16

you can run it locally

micha18:03:41

in the hoplon repo you can do boot watch speak build-jar

micha18:03:58

and if you're using boot 2.6.0-SNAPSHOT you should be able to do

micha18:03:10

boot -c hoplon dev in your project

micha18:03:19

that will do a checkout type thing

micha18:03:32

so your project will update when you make a change to hoplon.core

levitanong18:03:15

i don’t believe i have 2.6.0 snapshot

micha18:03:38

you can put BOOT_VERSION=2.6.0-SNAPSHOT in your boot.proerpties file

micha18:03:15

so to clarify, you have two terminals: one in the hoplon repo, and one in a project where you have a test hoplon application

micha18:03:31

in the first terminal you would do boot watch speak build-jar

micha18:03:46

that continuously builds the hoplon jar and installs it locally in your local maven repo

micha18:03:59

then in the second terminal, the one in your test project

levitanong18:03:03

(i’m guessing the maven repo is ~/.m2)

micha18:03:08

you would do boot -c hoplon ....

micha18:03:55

the -c,--checkouts option to boot tells it to load the dependency such that it will be reloaded when you reinstall the jar

levitanong18:03:43

BWAHAHAHAHAHHAHA