This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-25
Channels
- # beginners (26)
- # boot (1)
- # cider (21)
- # cljdoc (26)
- # cljs-dev (7)
- # clojure (99)
- # clojure-gamedev (6)
- # clojure-italy (5)
- # clojure-nl (4)
- # clojure-russia (1)
- # clojure-spec (5)
- # clojure-uk (59)
- # clojurescript (49)
- # clojutre (6)
- # component (13)
- # core-async (2)
- # cursive (30)
- # data-science (2)
- # datomic (29)
- # emacs (9)
- # fulcro (100)
- # hyperfiddle (1)
- # jobs (2)
- # luminus (4)
- # lumo (23)
- # off-topic (22)
- # other-languages (37)
- # parinfer (1)
- # re-frame (2)
- # reagent (5)
- # reitit (12)
- # ring (12)
- # rum (3)
- # shadow-cljs (168)
- # slack-help (1)
- # spacemacs (7)
- # specter (2)
- # tools-deps (8)
- # vim (11)
- # yada (3)
I’ve created a PR to update semantic-ui-wrapper to semantic-ui-react 0.82.0 and change the generators to accommodate that https://github.com/fulcrologic/semantic-ui-wrapper/pull/5
I've just upgraded to 2.6.0-RC5-SNAPSHOT from 2.5.8. But now I am getting
Uncaught Error: No protocol method IAssociative.-assoc defined for type cljs.core/Atom: [object Object]
Ah I thought I didn't have a stacktrace from my code but I do, let me see if I can figure it out
Seems merge-component!
changed:
(prim/merge-component!
(:reconciler app)
UiGuide {:ui-guide/lesson lesson
:db/id 1
:ui/step 0} :replace [:root/guide])
I updated because a set-state!
seemed to not trigger a re-render and I remember seeing an update about doing lifecycle methods properly, and it seems in 2.6.0-SNAPSHOT the set-state!
no longer updates within the callback that does the set-state!
. Trying later versions until I hit the assoc bug again.
@bbss Thanks for the report…we just did a refactor to deprecate certain names, but that should not have broken anything
on set-state: It is a direct call through to React now, so it should work as documented by React
The callback part is not important I guess. But it used to be that in the clickhandler I could set-state!
and then get-state
and the get-state was updated to reflect the set-state!
had to remove fulcro from cache, my app now renders with 2.6.0-RC5-SNAPSHOT
, but differently.
Hmm, something strange happening. Initial page load renders the app, but then after live-reload I get a
Uncaught Error: Assert failed: (component? component)
In my reload remount If I increase the timeout from 1ms to 1000ms it renders again. (no more assert component? fail) I have a setTimeout
on my reload re-mount because when I didn't do that I got a websocket error. However the render still does not render one of my components. Inspecting further.
The reason it renders differently is because the previously erroring merge-component!
doesn't seem to work anymore.
hm… @currentoor it seems tests of merge-component!
were insufficient.
I put things in SNAPSHOT that have not been well-tested…so this time that proved to be a good idea 🙂
there was a problem with websockets not waiting for establishment, but that should have been fixed a few versions ago
@bbss good catch
@tony.kay weird, i tested that line’s change in my app, which certainly relies on fulcro calling merge-component
and it didn’t throw
Trying again. The websocket error started happening around the time of that update (I think I know which one you are referring to, I reported the issue with load in started-callback not working on slowish ws connections).
@currentoor it is the !
version…you didn’t swap on state
@tony.kay i understand that, i’m just surprised that my app worked despite that bug
Oh yes, I get that sometimes when my app errors, I think that fix actually did work. But I am back in Europe nowadays, which is where the "slow" server connection comes from so haven't been able to verify from Korea where I usually live.
@currentoor would have only showed with integrate ident portion
yes, in a month or so I'll go back. Fairly certain that it did solve the issue I was having though.
maybe __integrate-ident-impl__
should also have a :pre
check to verify it’s an atom?
sorry that’s what i meant, verify it’s a map
the wrapper function has that check i think
it’s an internal implementation detail, so I’m less worried about that, and more worried that there is no automated test covering merge-component!
yeah that would be nice 😅
still having the issue with the setState though. Any reading-up I should do about the immediate/async rendering?
“Think of setState() as a request rather than an immediate command to update the component. For better perceived performance, React may delay it, and then update several components in a single pass. React does not guarantee that the state changes are applied immediately.”
I set-state
on the this
of a component. But that component doesn't re-render after said set-state.
NOTE: There is a callback parameter to set-state that will be called after the state change is applied
The set-state!
callback gets called, and the state is updated and changed when I call get-state
in that callback.
so, I’ve got some regressions on the book demos…some of the old libs I was demoing don’t work with newer react
I notice something kind of strange. After I run the callback with the problematic set-state!
. I get
[679.214s] [fulcro.client.primitives] integrate-ident is deprecated and will be removed in the future. Please use fulcro.client.mutations/integrate-ident* in your mutations instead.
for about 30-40 times in rapid succession.pressing a different button does trigger a re-render that does reflect the state from the problematic set-state!
.
the warning was just added. We’re moving that function, since it is more of a mutation helper
Possibly, not sure where I call it. I'm "replaying" edits to a codemirror instance. I think it's from there.
I’m a little stumped, and it turns out I’ve got some regressions in the book demos, so I should fix those first…some of them are old versions of demo stuff that requires react 15.
I'm also a little stumped but I'm sure I'll find a way (hacky) to make it work. Tried .forceUpdate
on the this
. But that doesn't seem to do it. So it's probably not the shouldComponentUpdate
then.