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.
@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.
Thanks ๐
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?
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.
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 ๐
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?
Absolutely
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.
brb
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.
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?
nope
@chris.klaou probably worth checking with lein deps :tree for conflicting schema versions,
You can probably subvert that work by adding a dependency on a new schema to your project
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.
https://github.com/juxt/yada/blob/master/project.clj#L25 yada definitely depends on schema ๐
Also, what if I prefer to use say shadow-cljs instead of figwheel, it doesn't look like changing would be easy.
weird that there's both prismatic-schema and prismatic/schema.
I think that was a typo, rollcage depends on prismatic/schema
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
I would accept PRs to get shadow support working again. I think most of the leg-work is done.
typo on my behalf
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.
I meaned that the output of lein deps :tree
command had no schema dependency underneath yada
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?
because aparrently it was overriden by the earlier version on which rollcage is dependent
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 ๐
Yeah