Fork me on GitHub
#hoplon
<
2016-12-01
>
grant04:12:04

@jumblerg I was on the current master at the time, think it is now one commit behind. Specifically, I was using a jar built with boot build-jar from commit 288b8bddda5541a28fe719ed014c66c7825985a6. And Chrome version 54.0.2840.98 (64-bit), on a mac.

jumblerg05:12:53

@grant: pull the last commit. i suspect you'll be in good shape after that.

jumblerg05:12:34

i was doing some work on the borders that i patched on the last commit. my git hygiene has been pretty sloppy thus far (since ui is still experimental and whatnot), but i think i need to start treating it as a production repo moving forward since others are starting to use it.

flyboarder06:12:41

@jumblerg as much as you warn people, it's too awesome they want it!

onetom11:12:10

@jumblerg yeah, don't have to apologize about git hygiene. i think everyone who uses hoplon/ui for real does understand its experimental nature. i personally favor dirty, but early commits, even if they break functionality, over slow releases because of risk averseness. that's why we forked hoplon/ui and run that in prod.

piotrek21:12:16

Hello! I am trying to use boot -d seancorfield/boot-new new -t hoplon -n hoplon-tmpl-test1 but when I run it I am getting an error:

clojure.lang.ExceptionInfo: src
    data: {:file
           "/var/folders/48/k5llf0tx577g90rvf4d61hh80000gn/T/boot.user5524206315011002769.clj",
           :line 19}
java.nio.file.NoSuchFileException: src
    file: "src"
       sun.nio.fs.UnixException.translateToIOException                UnixException.java:   86
         sun.nio.fs.UnixException.rethrowAsIOException                UnixException.java:  102
         sun.nio.fs.UnixException.rethrowAsIOException                UnixException.java:  107
sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes       UnixFileAttributeViews.java:   55
      sun.nio.fs.UnixFileSystemProvider.readAttributes       UnixFileSystemProvider.java:  144
                                                   ...                                        
                                boot.filesystem/mktree                    filesystem.clj:  100
Any hints what can be wrong? Or any workarounds?

micha21:12:21

can you try doing like

micha21:12:39

boot -BP -d seancorfield/boot-new new -t hoplon -n hoplon-tmpl-test1

piotrek21:12:52

It worked! What is -BP?

micha21:12:10

thta disables reading your profile.boot and build.boot files

micha21:12:27

you have something in one of those that is setting paths that don't exist

piotrek21:12:44

picard-facepalm there was a backup build.boot in my current directory

micha21:12:28

the -B -P options are good to eliminate those kinds of issues when debugging 🙂

piotrek21:12:26

on the other hand that’s a bummer that I cannot even run boot -h (as I tried to find out what those -P and -B flags mean) when there is a build.boot with some invalid setup (e.g. src dir missing)

micha21:12:46

haha right

micha21:12:55

maybe the help task should be special

micha21:12:19

i guess that would be difficult

micha21:12:28

because it needs to know things about your project

micha21:12:40

like it shows you available tasks

micha21:12:57

which are usually configured in build.boot or profile.boot

piotrek21:12:10

I know it’s a corner case 🙂

micha21:12:42

boot -BPh will always work i guess

piotrek21:12:43

but one more question: does it have to fail just because a src dir is missing even if I just run help task?

micha21:12:29

probably not, but it can be confusing if it just silently continues too

micha21:12:46

like boot would need to keep track of the directories that didn't exist

micha21:12:04

and keep checking to see if you added them

micha21:12:19

or just ignore them for the rest of the session even if you create them later

micha21:12:30

i mean like if you do boot repl

micha21:12:39

and then create the directory while the repl is running

piotrek21:12:47

right, as I said it’s just a corner case and I was unlucky 😉

micha21:12:11

perhaps the -h option could disable the exception

micha21:12:18

since that will exit anyway

micha21:12:36

like you probably wouldn't do boot -h repl

micha21:12:44

that would be a really strange thing to do

piotrek21:12:47

next time I will remember to do boot -B when I want to start boot without a project

micha21:12:41

i think a better error message would have helped

fiddlerwoaroof21:12:57

Something like this might help in a situation where there are multiple error-handling strategies for different contexts: https://github.com/knusbaum/cl-restart

micha21:12:32

interesting!

fiddlerwoaroof21:12:49

It's one of the "killer features" of Common Lisp 🙂

piotrek21:12:17

I have another question regarding editing *.hl files in Intellij IDEA with Cursive

piotrek21:12:40

Is there any way to make Cursive auto complete working with *.hl files?

piotrek21:12:21

Maybe using *.cljs files with manual requires for all the hoplon macros?

piotrek21:12:35

According to https://github.com/hoplon/hoplon/wiki/How-is-a-hl-file-different%3F I could use cljs files but I would also need to create html file too

piotrek21:12:15

Do you have any examples how that html file would need to look like? And I guess I would just need cljs plugin (as there would be no *.hl files for boot hoplon task to process)

micha21:12:45

i believe the current best way is to use .cljs files

piotrek21:12:56

An example for this would really help with tooling support

piotrek21:12:22

I will try to publish a sample on github when I get it working 😄

micha21:12:25

ok as a start you can make the following file in your existing project:

micha21:12:42

src/demo/index.cljs

alandipert21:12:21

@piotrek i know @onetom has ditched .hl in favore of .cljs for cursive, loves it

piotrek21:12:06

That’s my plan @alandipert. Lack of support for :refer :all for macros in cljs is PITA but lack of autocomplete in IDEA is even worse 😉

micha21:12:27

(ns demo.index
  {:hoplon/page "demo.html"}
  (:require
    [hoplon.core :as h]
    [javelin.core :as j]
    [hoplon.jquery]))

(h/html
  (h/body
    (h/h1 "hello world")))

micha21:12:47

that will at least create the html file for you

micha21:12:52

and hook all that stuff up

fiddlerwoaroof21:12:38

IDEA doesn't let you define extension->plugin mappings?

piotrek21:12:48

Do I need an edn file for that cljs file?

piotrek21:12:21

@fiddlerwoaroof It does but the issue is it tries to parse ns in the file but there is only page

piotrek21:12:51

So it doesn’t know what namespaces have been required and what is available in the current ns

micha21:12:57

@piotrek you shouldn't need to make a .cljs.edn file, hoplon task should do it for you

fiddlerwoaroof21:12:01

Makes sense, I don't actually use Intellij very much.

piotrek21:12:22

@micha I tried the snippet, compilation works but no demo.html file is generated

micha21:12:50

oh try this:

micha21:12:10

(ns ^{:hoplon/page "demo.html"} demo.index
  ...

piotrek21:12:12

Writing HTML files...
• demo.html

piotrek21:12:27

Would you mind if I submit a change to that wiki page with this snippet? I guess it might be useful for others looking for autocomplete support

micha21:12:55

sure that would be great

piotrek21:12:03

@micha is requiring [hoplon.jquery] needed? Won’t it be required by hoplon.core?

micha21:12:26

it will be if you use the hoplon task

micha21:12:34

so in your case yes

piotrek22:12:08

Thanks again! I have updated the wiki pages

micha22:12:59

awesome thanks!