Fork me on GitHub
#boot
<
2015-06-27
>
alandipert01:06:44

@timothypratley: the idea with that saying is that, because idiomatic tasks only depend on their configuration and the fileset, we don't need a clean task

alandipert01:06:30

@timothypratley: but yes, middlewares can also build up a cache and diff incoming filesets, which is how a system like boot can be competitive with systems like make

alejandro02:06:40

If I’m running a server from a boot repl, what’s the best way / workflow to have the server update on changes?

timothypratley05:06:02

@alejandro: have you seen https://github.com/pandeiro/boot-http ? I realize it is not ‘in the repl` but it seems like if you enable -R wrap-reload, it will take whatever you have saved, and if you really want REPL action it looks like you could modify the task to start an nrepl? (disclaimer: I am a new boot user)

timothypratley05:06:27

alandipert: I see. So to contrast, make is a run-many approach which can notice your artifact already exists and is newer than its dependencies. boot doesn’t have the ‘already built’ concept, every build is fresh but can be long lived and detect change henceforth. I wonder if there will be appetite to use make to decide when to run boot o_O.

Tom H.05:06:10

So I'm trying to set up a dev environment using a build.boot mostly copy-pasted from the tenzing app. Everything works fine, cljs files are compiling and the app is being served. The problem is that when my init function tries to re-render my reagent components on change using this:

Tom H.05:06:23

(defn mount-root []
  (reagent/render [views/app]
                  (.getElementById js/document "app")))

Tom H.05:06:07

I get this error:

Uncaught Error: Invariant Violation: _registerComponent(...): Target container is not a DOM element.
In my js console

Tom H.05:06:41

The app renders fine the first time but if I make any changes to the source files the app dies with the error above trying to re-render.

timothypratley05:06:19

sounds like a react lifecycle issue (I’m good at creating those!)

timothypratley05:06:08

is the app so simple that it can’t be the code? or are you willing to paste some of the code?

Tom H.05:06:35

Hmm it seems that when the boot reloads the code something is getting rid of the

<div id='app'>
completely. It's just gone from the html doc

timothypratley06:06:02

@tomisme: I think your issue is in your routes ns

timothypratley06:06:04

if i comment it out, reloading works great

timothypratley06:06:31

(defn init []
  (do ;(routes/app-routes)
      (re-frame/dispatch-sync [:initialize-db])
      (mount-root)
      (.log js/console "Init done BOOOYA")))

timothypratley06:06:48

when it is in, the dom has an ‘input’ rendered into it

Tom H.06:06:02

Interesting. Thank you.

timothypratley06:06:23

in ta.routes if I

;(hook-browser-navigation!)
remove the hook-browser-navigation! call also reloading is working...

timothypratley06:06:35

well I guess that shouldn’t be surprising

Tom H.06:06:42

Yeah, I should have checked slack first, I just got the same thing

Tom H.06:06:37

I copy-pasted the hook-browser-navigation function from a secretary example, I've yet to wrap my head around how the whole thing works

Tom H.06:06:26

The history config appears to not enjoy being reloaded

timothypratley06:06:35

right, but why is (app-routes) being called on reload? it implies (init) is called instead of mount-root

timothypratley06:06:59

probably the reload hook is connected to init instead of mount-root

timothypratley06:06:04

but I’m not sure how to check that

Tom H.06:06:10

ah yes it is

timothypratley06:06:34

oh i see in the build.boot file

Tom H.06:06:47

so, if only mount-root is called on reload, won't that mean that if I make changes to non-view related parts of the app that they won't be reloaded?

timothypratley06:06:55

it is working great for me now

timothypratley06:06:04

umm to explain why it is fine is hard

timothypratley06:06:12

but instead just add a println somewhere in your code

timothypratley06:06:20

and you’ll see it printed at the console

timothypratley06:06:15

I mean the code is ALWAYS reloaded… the on-jsload is just called AFTER the code is loaded

Tom H.06:06:28

ah, that makes a lot more sense

timothypratley06:06:54

working for you? (you need to restart the boot process)

timothypratley06:06:15

btw love the UI, looks really great! good job simple_smile seeing you are working in the education space you might be interested in http://leaderboardx.herokuapp.com/ <— I made a sociogram builder for teachers

Tom H.06:06:39

Thankyou simple_smile I'm a high school English teacher, I'm trying to learn clojurescript in the fraction of my time that's spare haha

Tom H.06:06:13

the leaderboard looks great, it feels alive moving around like that haha

Tom H.06:06:22

my app is reloading fine now, thanks

timothypratley06:06:29

groovy! goodnight

meow14:06:01

How do I use the dir macro from within a browser repl session using boot-cljs-repl?

meow14:06:57

cljs.user=> (dir goog.string)
WARNING: Use of undeclared Var cljs.user/dir at line 1 <cljs repl>

ExceptionInfo #<TypeError: Cannot read property 'call' of undefined>  clojure.core/ex-info (core.clj:4591)

meow14:06:38

cljs.user=> (require '[cljs.repl])

ExceptionInfo #<Error: Namespace "cljs.user" already declared.>  clojure.core/ex-info (core.clj:4591)
cljs.user=>

meow14:06:00

Actually, none of the helper functionality from cljs.repl is available:

cljs.user=> (doc map)
WARNING: Use of undeclared Var cljs.user/doc at line 1 <cljs repl>

ExceptionInfo #<TypeError: Cannot read property 'call' of undefined>  clojure.core/ex-info (core.clj:4591)

meow14:06:15

Is something wrong with my use of boot?

meow14:06:49

I have to say that boot-cljs-repl is really starting to feel like an unsupported mess, based on the lack of response to the github issues where it seems like fixes made by the community are stuck waiting for someone to do something with them. Am I wrong about this?

alandipert16:06:11

@meow: i can't disagree with you how feel

alandipert16:06:19

but i can say keeping up with upstream is a full time job

alandipert16:06:24

for a while there were weekly breaking changes

alandipert16:06:15

things appear to be settling down, but i would say if you depend on tools that move with cljs regularly, it will just be tough for awhile

alandipert16:06:34

david nolen promises a slower pace this year, so i imagine things will become less brittle

alandipert16:06:57

that said - if you yourself have the time to keep track of things and are interested in maintainership, i'm happy to annoint you

meow16:06:43

@alandipert: thanks for the response. I do have the time and interest, but I'm not sure I'm fully qualified at this point as I am still learning clojure and clojurescript. Started with them on May 15, so it's been six weeks now.

alandipert16:06:48

@meow: in any case congrats on your incredible progress!

alandipert16:06:22

for work we're a few months behind in cljs releases, just for sanity purposes

alandipert16:06:46

i imagine if you're just starting, perhaps it would be helpful if you stick with known-good combinations of boot/cljs things?

alandipert16:06:04

to stay on the edge basically requires knowing the whole stack deeply

meow16:06:54

@alandipert: good advice that I won't follow - I always find myself on the edge 😉

meow16:06:01

So I'm going to stop complaining for the moment and look at the source code for boot-cljs-repl and the pull-requests on github and see if I would be comfortable working on it.

alandipert16:06:54

if you see anyone else complain, just threaten to make them a maintainer too simple_smile

meow16:06:31

you know how to manage - give responsibility to the loudest complainer, right? simple_smile

meow16:06:08

we wouldn't complain if we didn't care

alandipert17:06:44

a common feeling, the need to complain

alandipert17:06:48

so no sweat simple_smile

meow17:06:22

I did write a gui repl in python, back in the day

micha17:06:07

deraen: heyo

micha17:06:27

thinking about doing a simple console typesetting thing in clojure today

danielsz18:06:54

Blogged about something today: http://tuppu.net/9de33a0a

danielsz18:06:23

Off-topic, but it’s amazing how once you know a Lisp, you know them all (in a way)

danielsz18:06:31

Or you think you do simple_smile

juhoteperi18:06:12

@alandipert: Regarding Cljs versioning, if you have not yet heard David mentitioned on his talk that Cljs will probably start following Clojure versioning

juhoteperi18:06:49

As the Cljs anyway requires specific Clj version

juhoteperi18:06:18

@micha: What kind of typesetting you were thinking for console? 😮

juhoteperi18:06:54

#boot-cljs-repl, my vacation starts in a week and I should have more time to work on OS stuff (cljs-repl) then

danielsz18:06:42

micha: You want to hook up? I’m free now.

micha19:06:04

danielsz: what's up?

micha19:06:26

deraen: i want to make a troff reader that can render to the console

micha19:06:47

so i can render manpages in java without needing the man(1) program to typeset the troff

micha19:06:02

i guess it won't be troff

micha19:06:11

because i'll have my own thing then simple_smile

micha19:06:32

but i want to be able to print documentation that is typeset correctly in the console

juhoteperi19:06:39

Oh, I haven't ever checked how man pages are rendered

micha19:06:12

i've been looking for a python, java, scala, ruby, etc implementation of man -l foo.1

micha19:06:19

found nothing

micha19:06:40

but once i have typesetting it shouldn't be too hard to implement

micha19:06:19

depending on shelling out to the man(1) program is annoying because it might not be available, etc

micha19:06:54

and just wtf no typesetting program exists for the console other than man(1)?

micha19:06:22

i would like boot task --help to print a nicely formatted man page

micha19:06:39

with plenty of space to describe each option

micha19:06:03

hanging indents, justified paragraphs, etc

danielsz20:06:20

micha: Hmmm… interesting problem. But why not have a man boot at any rate?

danielsz20:06:28

Like it’s a start.

danielsz20:06:38

You’ll worry about window later

micha20:06:47

what would man boot do?

micha20:06:57

boot has to generate that on the fly

danielsz20:06:22

I was thinking of the generalities

micha20:06:37

we are now really computing everywhere

micha20:06:44

but it means we need to compute

danielsz20:06:03

micha: sure, gotcha

micha20:06:21

man, typesetting is such an interesting problem

micha20:06:39

and there doesn't seem to be much general purpose library stuff available

micha20:06:06

i guess the web has made much of that obsolete

danielsz20:06:14

There’ a wonderful Racket library though

danielsz20:06:40

but I don’t think the renderer works in the terminal

micha20:06:49

yeah that's the thing i need simple_smile

micha20:06:09

i'm feeling good about it

danielsz21:06:28

But I had pollen in mind.

danielsz21:06:47

Very interesting take on the topic.

danielsz21:06:35

I bet you’ll like the title: Pollen: the book is a program

danielsz21:06:16

You can always make boot task —help open a browser...

danielsz21:06:28

have you thought about that?

micha21:06:46

yes, but it's not as nice as having it in the terminal i think

micha21:06:57

because like if you're doing something over ssh

micha21:06:00

or whatever

danielsz21:06:59

micha: right

danielsz21:06:12

micha: it’s crazy like you will find tons of curses libraries to build GUI s in the terminal, but typesetting is a wasteland

danielsz21:06:19

do you sense an opportunity in that space? wink wink nudge nudge?

micha21:06:22

i guess i have to write some code

danielsz22:06:10

à la Knuth

danielsz22:06:14

we’ll hear from you again in ten years, descending from a mountain with a comprehensive, portable typesetting system for the terminal.

micha22:06:05

all i need is line breaking, hyphenation, and justification

danielsz22:06:20

And this is how it all started

micha22:06:22

so i should be ready in merely 5 1/2 years