This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-27
Channels
- # aleph (8)
- # announcements (14)
- # beginners (25)
- # cider (20)
- # cljdoc (5)
- # clojure (70)
- # clojure-europe (2)
- # clojure-germany (6)
- # clojure-italy (8)
- # clojure-nl (3)
- # clojure-russia (107)
- # clojure-spec (22)
- # clojure-uk (40)
- # clojurescript (18)
- # core-async (3)
- # cursive (8)
- # data-science (11)
- # datomic (20)
- # editors (1)
- # emacs (5)
- # figwheel-main (19)
- # fulcro (25)
- # graphql (1)
- # hoplon (2)
- # hyperfiddle (2)
- # jobs (1)
- # leiningen (3)
- # lumo (4)
- # off-topic (40)
- # pedestal (1)
- # quil (4)
- # re-frame (5)
- # shadow-cljs (105)
- # sql (4)
- # uncomplicate (1)
@currentoor Thanks for taking a look. Yes I understand the keys. But I am providing keys. I have an initial state with a key (`:week/number`), and the Week
I df/load
also has a key. If I'm not mistaken it's Fulcro or React or something that sets this to nil
while loading.
But I only get the React warning (red text in the image above) when I load both Person
and Week
, and even though both of these get nil
keys while loading, they shouldn't interfere with each other. Am I correct? I'm loading one Week
one time, and one Person
one time.
And the strange thing is, why is it rendering Person
two times, even though I only make one call to the factory ui-person
? Doesn't seem like something that should happen even if my keys are wrong.
If I set initial state of the Week
:week/number
to e.g. 52, and the same for Person
:db/id
to 52, then three Person
are rendered -- one with id 52, one with id nil, and one with id 1, the last of which is loaded in :started-callback
. I also get another React warning about the same key 52, even though Person
and Week
are unrelated. (The Week
and Person
are called :selected-week
and :current-user
in the client db)
@tony.kay Thank you for reply. So the RN-CLIENT side codes are right? Especially this part:
:networking {:remote (net/fulcro-http-remote
{:url ""
:request-middleware net/wrap-fulcro-request})}
and the (df/load app :current-user com.wsscode.multi-timer.components.person/Person)) is auto with transit+edn encode, right?🙂@eric.shao I have not worked with RN, but that looks reasonable
@tony.kay I'm a bit confused.
I get this error defsc-router options are invalid: ... failed: (contains? % :ident) spec: :fulcro.client.routing/defsc-router-options ...
But the docs for defsc-router
state:
> You may NOT define a :query
, :ident
, or :initial-state
for a router.
On the other side in the Book (http://book.fulcrologic.com/#_details_on_code_defsc_router_code):
> The required parameters of defsc-router are: ... :ident MUST be in fn form, ...
My root-router works without ident.
It is the docstring
tehcnically you’re not setting theident of the router, you’re telling the router what the ident of the routees are
the router’s ident is not settable by you, because you cannot even get to the “knob”
Ah my root-router doesn't work without ident.
A colleague of mine ran into encoding issues with server side rendering which generated invalid javascript/JSON strings in the initial state script tag. Would you be interested in discussing these troubles in like an issue? We ended up b64 encoding/decoding. That works, but I think this issue may bite more fulcro users so I was wondering whether you wanted to have patches/discussion on the topic ^^
@lennart.buit strange, I thought I had fixed all of those. Sounds like there are some strange cases that still don’t work. I’m open to a PR that corrects this, of course. I think as long as the encode/decode pair work as such, whatever is needed is fine.
just in case others have used those transit->str functions, we might just want to add variants called clj->str
and str->clj
?
the use of transit is probably important since transit is extensible for Fulcro in general
the issues mostly arise from the combination of javascript strings with JSON. for example "\u0001"
is a valid JS string, but gets transformed by JS to the actual unicode character. JSON however prohibits unicode characters with a codepoint <=31 in strings.
I’ll make sure we will upstream our patch tomorrow!
As promised, https://github.com/fulcrologic/fulcro/pull/269, these changes always take way longer than you would hope right :’).