This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-15
Channels
- # admin-announcements (7)
- # alda (1)
- # aws-lambda (1)
- # beginners (12)
- # boot (20)
- # cider (59)
- # cljs-dev (4)
- # cljsrn (69)
- # clojure (232)
- # clojure-austin (3)
- # clojure-austria (1)
- # clojure-belgium (2)
- # clojure-canada (3)
- # clojure-dev (16)
- # clojure-greece (33)
- # clojure-nl (4)
- # clojure-quebec (12)
- # clojure-russia (12)
- # clojure-spec (27)
- # clojure-uk (38)
- # clojurescript (29)
- # community-development (7)
- # component (53)
- # core-async (16)
- # core-logic (1)
- # datascript (7)
- # datomic (11)
- # editors (7)
- # emacs (69)
- # hoplon (157)
- # keechma (1)
- # lambdaisland (2)
- # lein-figwheel (31)
- # leiningen (8)
- # mount (3)
- # off-topic (11)
- # om (23)
- # onyx (64)
- # planck (2)
- # re-frame (18)
- # reagent (21)
- # specter (118)
- # untangled (145)
- # yada (1)
released untangled server 0.6.0 β this is a breaking change release, see complete changelog in the repo
some of the changelog:
- :authorized-routes => :unsecured-routes
- should be a bidi route map to :ok handlers (enforced on system start)
- top level files are always unsecured
- root route "/" is also always unsecured
- to unsecure a whole sub-route (eg: the js folder)
use bidi's catch-all routes, eg: {"/js" {true :ok}}
- Open id mock will now deal with multiple users.
"user" can be passed as a query param to the open id mock endpoint.
- Fixing heisenbugs wrt datomic not sorting & protocol-testing randomly failing
- Adding invalid-token-handler to the :openid config
- Takes a request whenever an invalid token
is passed to a secured-route (ie: not an unsecured-route)
and should return whether the request should be allowed
to flow through the handler stack (defaults to false)
@ethangracer: Is that on clojars?
good point, probably not yet, will need @tony.kay to do that
unless someone else has access
(defui B
static IQuery
(query [this]
`[:which-tab
{[:link-a :global] ~(get-query A)}])
static Constructor
(initial-state [_ _]
{:which-tab :messages})
)
@jasonjckn: If it is a root level thing, compose it into root component state
it doens't really belong to Root either...but I see no problem with putting it there
@mahinshaw: should probably elaborate on how to upgrade to use your change of [:openid :sub]
to [:openid :users]
in the config
@jasonjckn: Actually, since there is no query to normalize that global thing (which could be nested), it does make more sense to use merge-state!
in the started-callback of the app construction.
If it's a singleton that you query with a link like [:thing '_]
then it'd be ok to put it in Root (assuming that it had no nested content that needed normalization)
But because of those restrictions, you're probably better off just merging the state in at startup if it meets the "global singleton" criteria
I'm expanding the merge-state internals a bit soon. At the moment it isn't compliant with how it should work in corner cases...e.g. I'm not doing the mark/sweep step and merging with something that might pre-exist
static IQuery
(query [this]
`[:which-tab
{[:link-a :global] ~(get-query A)}]) to
static IQuery
(query [this]
`[:which-tab
{:link-a ~(get-query A)})
oh, well, at that point it isn't top-level state anymore, and can go in your cnostructor
i'll keep that in mind, i'm trying to keep the syntax as regular as possible for my team
In Untangled you don't use query parameters or mutations in queries. You should not need quoting at all
(defmacro ! [action-name & params]
{:pre [(symbol? action-name)]}
`(list (quote ~action-name) ~@params))
can you have multiple params? eg: [(app/a :foo :bar)]
afaik params have to be a map, so just just add more keys if need more data e.g. [(app/a {:foo βfooβ, :bar βbarβ})]
right so that !
macro should be
(defmacro ! [action-name params]
{:pre [(symbol? action-name)]}
`(list (quote ~action-name) ~params))
(defui B
static om/Ident
(ident [_ _] [:link-b :global])
static om/IQuery
(query [this] [:title])
static Constructor
(initial-state [_ _] {:title "foo"}))
(defui A
static om/IQuery
(query [this] [{:b (om/get-query B)}])
static Constructor
(initial-state [_ _] {:b (initial-state B nil)}))
(defui D
static om/IQuery
(query [this] [:some-data])
static Constructor
(initial-state [_ _] {:some-data 3}))
(defui TabUnion2
static om/Ident
(ident [_ _] [:link-a :global])
static om/IQuery
(query [this] {:link-a (om/get-query A)
:link-d (om/get-query D)})
static Constructor
(initial-state [_ _] (initial-state A nil)))
:current-tab2 [:link-a :global], :link-b {:global {:title "foo"}},
:link-a {:global {:b [:link-b :global]}}}, :search-results2 {:global {:page-size 10, :type "message"}}
i was trying to simplify the code that was having an issue, the original code had a proper ident
ok it still reproduces
(defui B
static om/Ident
(ident [_ _] [:link-b :global])
static om/IQuery
(query [this] [:title])
static Constructor
(initial-state [_ _] {:title "foo"}))
(defui A
static om/IQuery
(query [this] [{:b (om/get-query B)}])
static Constructor
(initial-state [_ _] {:link-type :link-a
:b (initial-state B nil)}))
(defui D
static om/IQuery
(query [this] [:some-data])
static Constructor
(initial-state [_ _] {:link-type :link-d
:some-data 3}))
(defui TabUnion2
static om/Ident
(ident [_ {:keys [link-type]}] [link-type :global])
static om/IQuery
(query [this] {:link-a (om/get-query A)
:link-d (om/get-query D)})
static Constructor
(initial-state [_ _] (initial-state A nil)))
here's the initial state :link-a {:global {:link-type :link-a, :b [:link-b :global]}},
:link-d {:global {:link-type :link-d, :b {:title "foo"}, :some-data 3}},
:current-tab2 [:link-a :global],
:link-b {:global {:title "foo"}}}
in my core.cljs i have
(uc/merge-state! app ui/TabUnion2 (uc/initial-state ui/D nil))
some how :link-d contains denormalized data about B even though D never mentions B anywhere
yah i mean there's other code around, i can try to reduce it to a simple git repo for you
so I cannot see how mine could work and yours not, unless you've got something somewhere else messing it up
@tony.kay: https://dl.dropboxusercontent.com/u/2387022/bugdemo%202.zip here's a project with just that code
looks like a straight forward fix the issue is here https://github.com/untangled-web/untangled-client/blob/2bcedfcd53a791200355f123e63ba3afada36534/src/untangled/client/core.cljs#L133
(uc/merge-state! app ui/TabUnion2 (uc/initial-state ui/D nil)) ui/TabUnion2 is bound to parameter component, who's initial state is read into let binding empty-object
but you're right, that logic isn't right for unions...but it wasn't right in general either π
Pushed untangled spec 0.3.7. Fixes rendering issues that started with latest React and Om
@jasonjckn: Pushed untangled client 0.5.3-SNAPSHOT to clojars with the work in progress. I'm done for the day, and the new version is "more correct", and mostly tested. I put a union fix in, but that's the bit I have not yet tested
I expanded the API so that one can access the ident integration code as a stand-alone function
and can do appends/prepends/replace as many times as you want (maybe I already had that)
http://untangled-web.github.io/untangled/tutorial.html#!/untangled_tutorial.H_Server_Interactions
The data merge stuff uses a mark-and-sweep algorithm to implement the behavior of data merge descritbe in that tutorial page
The merge-state! function adopts that as well to ensure consistency...that's the bit I forgot on the first pass
The new merge function is really mostly targeted at server push and startup. That's part of the reason I split out the ident integration code as a utility function.
Responses from teh server are already merged properly (except for peppering about the idents)
I may split it out a bit more...at present the ident editing requires a reconciler, which isn't right
cool, i'm going to handle all the difficult parts and compatibility changes for the app, just need to get people productive with render functions, and simpler parts
yah and, they're already react/javascript engineers, and om.next/untangled doesn't try to abstract react
I think the constructor addition really cleans things up quite a bit. Our devs are really happy with the improvement