Fork me on GitHub

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?


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.


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.


@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

@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.


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

contrary to the opinion “spec replaces schema, so migrate to spec” that you hear here and there


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


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.


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


and it’s still running without problems after each upgrade


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


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


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


May I use this thread for this communication?




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.


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


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


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


kick in theory supports shadow-cljs, but it was commented out by @U050CTFRT. 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).


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


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.


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?


If my question isn't straightforward just let me know


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


kick would take care of rebuilding sass for you


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 🙂


> 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 🙂


> kick would take care of rebuilding sass for you Ah this would be nice. My hack is to run a node-sass process in the background.


> More current thinking is to define in the config.edn. But how granular to go in config.edn is still under consideration. Awesome I think this answers my question


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


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


and then make issues about documentation 🙂


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)


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


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


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


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.


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


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


typo on my behalf


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


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


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