yada

2019-01-22T06:42:07.320100Z

Is this a good place to talk about edge? If so, I've watched the demo in the video and looked at the docs. I feel that edge is aimed towards a single repo for all your services. Am I right?

cklaou 2019-01-22T10:20:47.323Z

Hi everyone! I'm experiencing a weird behaviour trying to set the content-security-policy header in a response. It appears that yada appends the default value default-src https: data: 'unsafe-inline' 'unsafe-eval' onto whatever I try to set it to.

dominicm 2019-01-22T11:12:59.324700Z

I think there's a key on the resource you should set it with, not manually in the headers. But if you explicitly set it, yada should avoid overriding, please file a bug. That would enable dynamic CSP, I've never needed such a thing though.

malcolmsparks 2019-01-22T11:32:00.325800Z

@urbanslug Edge is being aimed at a modular multi-project design. You can keep all projects in the same repo or in different repos. The deps.edn dependency mechanism will work in either case.

๐Ÿ‘ 1
cklaou 2019-01-22T11:39:09.330200Z

@dominicm Thanks for your response. You are right about not setting it manually. It should be set using top level key :content-security-policy. I confirmed that it works as expected in the latest version 1.2.15. The project that I'm working on has an earlier version though: 1.1.45. Using top level key in the older version does not work and upon trying setting it manually I encountered this behaviour.

2019-01-22T11:48:12.330600Z

Thanks ๐Ÿ™‚

borkdude 2019-01-22T12:27:40.331700Z

so, since spec isnโ€™t suited for coercion, it seems Schema isnโ€™t going anywhere in the near future and still has a central place in the Clojure community, especially for http API boundaries?

๐Ÿ‘ 1
borkdude 2019-01-22T12:28:16.332300Z

contrary to the opinion โ€œspec replaces schema, so migrate to specโ€ that you hear here and there

dominicm 2019-01-22T12:41:59.333300Z

Although I expect schema's coercion could go behind an interface of some kind.

2019-01-22T12:47:44.334600Z

Is there anyone who's just getting into yada and edge? What resource did you use? The docs and code examples seem to be behind the code at this moment.

borkdude 2019-01-22T12:49:20.335300Z

I used the docs, edge, the source the yada tests and this channel 2 years ago

borkdude 2019-01-22T12:49:32.335600Z

and itโ€™s still running without problems after each upgrade

2019-01-22T12:54:59.339100Z

Okay, so say I want to define a route to handle graphql queries. From the docs seems there's a way to define them in yada but there's a way to do so using integrant config in the later versions of edge. I wonder whether one should go with the integrant way or with yada

dominicm 2019-01-22T12:55:25.340500Z

@urbanslug for outdated Edge documentation, please open github issues, or contact me directly if you're unsure.

2019-01-22T12:55:35.340700Z

In this case I do want to use integrant and lacinia I'd say

borkdude 2019-01-22T12:55:54.341Z

@urbanslug you should talk to @kwladyka, he just figured this all out

borkdude 2019-01-22T12:56:04.341200Z

and then make issues about documentation ๐Ÿ™‚

2019-01-22T12:56:19.341300Z

I was actually going to try update them in a PR but well it's still confusing.

2019-01-22T12:56:34.341500Z

May I use this thread for this communication?

dominicm 2019-01-22T12:56:38.341700Z

Absolutely

2019-01-22T13:04:12.341900Z

First thing when one is starting out: the dev guide is for development I assume. Following that process "-A:dev:build:dev/build" this alias doesn't apply. I can't quite figure out why. The method in the demo using bin/app project works but limits one to a project inside of edge. This is quite confusing to me so I may not be as clear as I should be.

2019-01-22T13:04:15.342100Z

brb

dominicm 2019-01-22T13:09:02.342800Z

This is something I've struggled to convey, I think this needs extra documentation, or perhaps a message in a generated readme.

dominicm 2019-01-22T13:09:53.343600Z

Depending on how you generate your project, your dev aliases will be a different list. This is because of sass/figwheel.

cklaou 2019-01-22T13:15:06.346400Z

Got another one: Trying to upgrade the yada in a project from 1.1.45 to latest -`1.2.16` and I can't start a repl due to java.lang.RuntimeException: No such var: s/constrained refering to yada/schema.clj:22. ,If anybody can provide a hint I would be grateful. I checked the changelog and there's no use of multi-arity responce functions in the project (or any other breaking change)

dominicm 2019-01-22T13:35:47.346900Z

@chris.klaou does your project have a schema dependency?

cklaou 2019-01-22T13:36:05.347100Z

nope

dominicm 2019-01-22T13:42:55.347900Z

@chris.klaou probably worth checking with lein deps :tree for conflicting schema versions,

dominicm 2019-01-22T13:43:25.348700Z

You can probably subvert that work by adding a dependency on a new schema to your project

cklaou 2019-01-22T14:22:23.348900Z

I tried that and found out that theres another lib, namely circleci/rollcage that depends on [prismatic-schema "0.4.3"] and under yada there's no dependency on schema

cklaou 2019-01-22T14:48:44.349100Z

Tried to exclude prismatic/schema from both yada and rollcage and include top level dependency on [prismatic-schema "1.1.7"] and the problem remains.

dominicm 2019-01-22T15:00:45.349300Z

https://github.com/juxt/yada/blob/master/project.clj#L25 yada definitely depends on schema ๐Ÿ™‚

2019-01-22T15:00:46.349500Z

Also, what if I prefer to use say shadow-cljs instead of figwheel, it doesn't look like changing would be easy.

dominicm 2019-01-22T15:01:02.349800Z

weird that there's both prismatic-schema and prismatic/schema.

dominicm 2019-01-22T15:01:32.350Z

I think that was a typo, rollcage depends on prismatic/schema

dominicm 2019-01-22T15:03:18.350200Z

kick in theory supports shadow-cljs, but it was commented out by @malcolmsparks. I think he didn't have time to figure out the fixes required for tools.namespace (which are now done for figwheel-main & figwheel-sidecar). https://github.com/juxt/kick.alpha/blob/master/src/juxt/kick/alpha/providers/shadow_cljs.clj.txt

dominicm 2019-01-22T15:03:35.350500Z

I would accept PRs to get shadow support working again. I think most of the leg-work is done.

cklaou 2019-01-22T15:05:08.350700Z

typo on my behalf

2019-01-22T15:05:21.350900Z

I'll look into it. I first have a graphql API to set up, which is what I set out to do in the beginning.

cklaou 2019-01-22T15:06:23.351100Z

I meaned that the output of lein deps :tree command had no schema dependency underneath yada

2019-01-22T15:06:57.351300Z

Speaking of, in the demo the routes were defined by integrant but then in the yada docs it seems to be through yada. Which is the way you recommend to do it?

cklaou 2019-01-22T15:07:04.351500Z

because aparrently it was overriden by the earlier version on which rollcage is dependent

2019-01-22T15:12:22.351800Z

If my question isn't straightforward just let me know

2019-01-22T15:18:42.352Z

Does one need kick at all with shadow? Shadow does handle building and reloading when files change.

dominicm 2019-01-22T15:46:02.352400Z

kick would take care of rebuilding sass for you

dominicm 2019-01-22T15:46:19.352600Z

the original idea was that kick would take care of other things too, but we've not had to add anything else for the projects we're currently doing ๐Ÿ™‚

dominicm 2019-01-22T15:48:03.352800Z

> Speaking of, in the demo the routes were defined by integrant but then in the yada docs it seems to be through yada. More current thinking is to define in the config.edn. But how granular to go in config.edn is still under consideration. I recommend doing whatever you find works for you ๐Ÿ™‚

dominicm 2019-01-22T19:18:50.353Z

Yeah