Clojurians
#precept
<
2017-12-23
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

carkh18:12:44

I thought i would give a try to precept again ... but i run in quite a few issues.

carkh18:12:12

first i tried in a toy project of mine...but i run into problems with the session macro when reloading with figwheel ... it looks like it doesn't keep the fully qualified var names for my schemas... instead using locally qualified names

alex-dixon18:12:21

Ok. Do you have a snippet of the code that seems to be the problem or a description of the error?

alex-dixon18:12:31

:slightly_smiling_face:

carkh18:12:39

ah you're faster than i am =)

alex-dixon18:12:56

No I spoke too soon :slightly_smiling_face:

carkh18:12:26

see this code is in ss.precept.rules ns, and i get errors saying that ss.precept.rules/db-schema doesn't exist

carkh18:12:54

although i'm providing a fully qualified name for my dbschema

carkh18:12:19

so i thought i would give a spin to your examples

carkh18:12:03

but there i see you are cheating ! there is no reloading due to ns ^:figwheel-no-load todomvc.app

carkh18:12:37

(also there are quite a few warnings during compilation but we'll let that slide)*

alex-dixon18:12:13

Thanks haha. Hopefully if I’m thinking of the same warnings you’re seeing they’re coming from Clara

carkh18:12:28

anyways i've been looking at clara issues, and it seems they have a fix about this kind of namespaced var issues in their macros, maybe that's related

alex-dixon18:12:42

Did you start your project using the template or something else?

carkh18:12:25

not not using the template

carkh18:12:15

the clara thing was fixed maybe a week ago...let me try to find it

alex-dixon18:12:17

Hm ok. Have you tried restarting figwheel or refreshing the browser? I’m not sure the session recompiles when it receives new arguments or not

alex-dixon18:12:39

Ok. Thanks. I’m only aware that they added hot reloading for CLJS, not sure about namespace related issues

carkh18:12:47

i've been playing with it for half a day =) refreshing and restarting all vm aswell as figwheel itself

carkh18:12:53

it seems very brittle

carkh18:12:02

i'm using latest clojure and clojurescript though

alex-dixon18:12:34

Ok. That should be fine

alex-dixon18:12:53

Is this a public repo where I could take a look?

carkh18:12:18

i was afraid you would ask that ... I'll try to make a minimal example

carkh18:12:45

btw thanks for your lightning fast responses =)

alex-dixon18:12:50

Totally up to you. I’m looking through the source right now and trying to think and not ask a lot of silly questions…there’s a lot of trickyness to macros, especially in CLJS. But I’m working on a project that uses a db-schema and client schema right now and not getting any errors

alex-dixon18:12:02

Np. Sorry you’ve burned half a day on this

carkh18:12:43

precept has me quite excited, so there 's no problem there =)

alex-dixon18:12:44

In what I’m working on I’ve required the schemas at the top

carkh18:12:26

mhhh do you think the fact i'm using cider might pose a problem ?

alex-dixon18:12:32

Glad to hear it. It’s just been me working on it and I haven’t had much time due to work recently so I’m sorry for the brittleness

alex-dixon18:12:55

I don’t think so…

alex-dixon18:12:24

Have you tried requiring the schemas at the top? I’m not using fully qualified in what I have working and sometimes even with fully qualified if they’re not required things don’t work

alex-dixon18:12:52

[precept-visualizer.schema :refer [db-schema client-schema]]
(session visualizer-session
  'precept-visualizer.rules 'precept-visualizer.other-rules
  :db-schema db-schema
  :client-schema client-schema
  :reload true)

carkh18:12:06

i haven't tried that

carkh18:12:30

hum you're not even qualifying the vars and it works

alex-dixon18:12:32

That’d be my best guess. I’m also using a .cljc file for the schemas but it should work with cljs too

carkh18:12:46

let me try it here and i'll get back to you !

alex-dixon18:12:18

Ok cool. I’ll try to think of something else but I think that might be it…seems like I’ve run into it before even with other clojure things

carkh18:12:19

allright looks like it works with non-qualified names when explicitely importing them

carkh18:12:11

so i guess my mistake, sorry for the bother !

alex-dixon18:12:56

No problem at all. Really glad it worked

alex-dixon18:12:33

It’s counterintuitive to me...like what’s the point of a fully qualified ns