This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-29
Channels
- # admin-announcements (4)
- # arachne (19)
- # aws-lambda (3)
- # beginners (10)
- # boot (166)
- # capetown (32)
- # carry (160)
- # cider (5)
- # cljs-dev (5)
- # cljs-edn (19)
- # cljsrn (1)
- # clojure (100)
- # clojure-belgium (2)
- # clojure-dev (8)
- # clojure-greece (13)
- # clojure-new-zealand (12)
- # clojure-poland (1)
- # clojure-russia (93)
- # clojure-sanfrancisco (2)
- # clojure-spec (133)
- # clojure-uk (52)
- # clojurescript (129)
- # cursive (32)
- # datomic (13)
- # defnpodcast (5)
- # devcards (6)
- # dirac (4)
- # emacs (12)
- # euroclojure (5)
- # events (2)
- # hoplon (19)
- # immutant (45)
- # keechma (17)
- # lein-figwheel (27)
- # off-topic (9)
- # om (30)
- # onyx (17)
- # other-languages (3)
- # planck (2)
- # proton (11)
- # re-frame (7)
- # reagent (4)
- # ring (8)
- # sim-testing (2)
- # spacemacs (4)
- # testing (2)
- # untangled (162)
- # utah-clojurians (1)
- # yada (80)
iirc i changed it so its env and bidi’s match
the request is now in the env
let me check what version that happened in
ah so as of 0.5.0 https://github.com/untangled-web/untangled-server/blob/master/ChangeLog#L26
for earlier versions you are correct with the 3 arity version
Is there documentation on the :config-path in the Untangled Server? For instance it might be: "config/demo.edn". There's also "defaults.edn" where I am currently actually setting the port. Should I put my own application specific keywords in :config-path for instance? And how do I get at them if I do? I'm asking because the name "config/demo.edn" would seem to suggest it is configuration for the application, rather than Untangled specific configuration.
defaults.edn
gets deep-merge
'd with :config-path
where defaults.edn
is overridden by :config-path
you can put whatever you want in both of these files
the idea is that defaults.edn
contains a bare set of configuration for your app to work and not screw up your databases
whereas :config-path
should be the “default” path to look for a config file
this can be overridden by supplying -Dconfig=/path/to/config.edn
on the cmdl when running your jar
ok then a defaults.edn
with just {}
will be fine
yeah it does, and usually we put that in resources/config/defaults.edn
as resources is in your classpath and it looks for it under config/defaults.edn
using
https://github.com/untangled-web/untangled-server/blob/master/specs/untangled/server/impl/components/config_spec.clj might help you see the behaviors
But just simply how do I get at my own data I put into the config, or should I use my own config file for application specific stuff?
where are you trying to get at the config from?
On the server, wanting to read in a file that will be used by the application. Just once for the application.
hmm, if you were in a mutation or a read i would tell you to look in the env at :config
okay so if you want to do this once on startup, you can use the :components
key in new-untangled-server to put a stuartsierra component to read that file in
let me find you an example
I think I got it - (:config env). I am wanting it from a read on the server - so that should work.
so when you say file, the config file is what you mean?
its not some other arbitrary (non-edn) file?
is it .edn
?
okay so config only understands .edn
files
so you would have to create a custom component to read that
I was just wanting the name of the file that's all - for the name to be in configuration.
important parts are component/using
on the config, and grab its :value
im not sure you can do this only once on startup otherwise
And I going to have to set up the component dependency. Have to read up on Stuart Sierra for that.
untangled-server should already depend on that, unless i missunderstood your statement
https://github.com/untangled-web/untangled-server/blob/master/src/untangled/server/core.clj#L96
to get access to it, add it to :parser-injections if you want it in your env
should just make a video on this like tony has for other things
i say that and i found https://www.youtube.com/watch?v=jZx6TsL8GTo&index=8&list=PLVi9lDx-4C_T_gsmBQ_2gztvk6h_Usw6R
Yeah the videos are good. I also like the idea of a somewhat bigger application than usual tutorial ones. So I would just understand it completely then go to it as a reference. It would have/need additional SS components.
~ 3 minutes in
ive previously built untangled-template for earlier versions of untangled, but it could be a good starting place and reference
i may spend some time this week updating it
all good, you had some other questions mixed in there so its fine
Yeah I didn't realise would need a component till talked to you. It all works as you outlined. Two source files affected are here: https://github.com/chrismurrph/wandering/tree/master/src/server/app
looks good, something that I’ve done in my project(s) is to pass config-path to make-system
and have the user.clj file pass it something local (like what you have now), and a core.clj file that is used in production that references an absolute file path (eg: /usr/local/etc/wandering.edn
@mahinshaw: with untangled-websockets did you every see an error like this?
16-06-29 17:17:38 Macintosh.local WARN [taoensso.sente:159] - Bad ev-msg: {:ch-recv #object[clojure.core.async.impl.channels.ManyToManyChannel...
So, I have ALT-k mapped to kill next form into copy buffer, and then I heavily use things like raise, splice, wrap, etc.
apparently the vim emulation can be modified with a vimrc but haven't looked into it, in emacs I have it so DD auto balances parens
@currentoor: Yes. Are you seeing that with push or with mutations/reads?
parinfer + vim emulation has some bugs in it, but if they fix it, it'll be super effective
I didn't know parinfer was available...or do you mean the paren balancing built into cursive?
@mahinshaw: I'm seeing it with just the initial ping
well, I've adapted to not needing/wanting it. The manual wrap/close commands make it pretty easy
@currentoor: Not really sure. I there some code I can take a look at? Minimum reproduction? I haven’t had that problem with just establishing the connection.
@mahinshaw: it's a bit messy right now, but out of curiosity what was the fix for you?
I think I ran into those messages when I was building the lib and sending bad messages. Essentially you can run into these issues when you are deserializing the edn/transit data. It might be worth looking at the websocket frames and seeing if they are deserialized properly
There also be malformed messages in other places, but that will be harder for me to diagnose
I'll look into those, thanks.
i notice sometimes when browsing to localhost:3000/dev.html it serves stale clojurescript, sometimes even when I switch to a different project with different clojurescript codebase entirely, the browser still serves the old code, like some lack of cache invalidation or something, anyone ever notice anything like this?
all the time, which is why we’ve opened up the chrome inspector, gone to the network tab and checked disable cache
@jasonjckn: iirc you also need to leave the inspector open for it to disable the cache
it only impacts developer experience, users should not have this issue
as the javascript should be compiled once and served from production
the fix for the cache is to either ^f5 or do what i suggested earlier
but for production purposes...same solutions as with everything. U.S. should be doing proper headers for cache (e.g. date modified)
but if your timestamps on your filesystem fool it (e.g. you move projects and the browser THINKS it has something up to date), then you'll see problems
http://app1.example.com, app2.example.com...that kind of thing
@mahinshaw: figured it out and it's unsettling. Having [com.fzakaria/slf4j-timbre "0.3.2"]
to capture some java logs causes sente to fail.
It's a small library and I have no idea why it happens 😦
but I've confirmed just having that dependency causes sente to fail
It may be worth posting an issue with sente. Is there a specific line of code that fails?
yeah i'm verifying that adding this dependency in the sente example project fails the same way
if it does, i'll log an issue
yup, fails the same way in sente example
Yeah but it looks like they fixed it in slf4j-timbre 0.3.0 and this is a regression
nice!
So @tony.kay we were wondering when does it make sense to call om/merge!
with the additional (albeit undocumented) argument for query? Specifically for websocket subscription stuff.
https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L1630
Did you need to use it in your tech spike? It doesn't seem to be necessary for a simple test case but we may be missing something.
So, when you do a server push, you are going to need a UI query (with idents) in order for the incoming data to be normalized and merged properly. The basic answer is "usually"
There is a new helper function in untangled.client.core called merge-state!
that has some added help
(specifically, it gives you a way to tack idents into the app state at known needed locations)
If you're adding new info, then you'll usually have to add the ident to lists somewhere besides the db tables. Your incoming data is going to be a response on a query from an ident join...so it will only really update the targeted table (and linked entities recursively)
Say I sent a new person. The query will be something like {[:people/by-id 3] {...}}
, which will update the people table...but if you have a list of people in your UI (which is just a list of idents) you'll probably want to either add them to that, or reconstruct (if sorted) the list altogether. So, post mutations are also a possible need.
the merge-state!
function lets you send just the data of the object (without the join) and it figures out the query using a component. So it keeps you from having to jump through extra hoops (it can use the UI component to derive the correct ident from the object data)