Fork me on GitHub
#fulcro
<
2018-06-06
>
wilkerlucio00:06:48

@levitanong just released inspect beta3, this will stop loading index at start (also make sure the extension is updated to 0.0.4)

levitanong04:06:09

Yeah that works! Thanks 😄 What does loading index do?

mitchelkuijpers09:06:24

It gives you this: https://github.com/wilkerlucio/oge inside of the devtools. So basically a remote query development tool

mitchelkuijpers11:06:16

@wilkerlucio When do you load the indexes?

mitchelkuijpers11:06:41

Ah I found the button

mitchelkuijpers11:06:42

I like that solution also makes it easy to update them, or us the view without pathom

wilkerlucio12:06:04

@levitanong the index provides auto-complete when doing queries, its a feature from pathom connect

wilkerlucio12:06:50

@mitchelkuijpers glad to hear, that buttons always worked to refresh the index, I just removed the automatic trigger from start 🙂

levitanong12:06:17

@wilkerlucio cool! So you said it doesn’t load at start anymore. How does one start it?

wilkerlucio12:06:23

@levitanong click on the grey circle on the query tab, tab will trigger an index load

wilkerlucio12:06:37

and if you server can provide it, then its used for the auto-complete

levitanong12:06:56

@wilkerlucio hmmm. it causes the multimethod error again. non-breaking though. I’m curious, why does it try to hit all my remotes?

wilkerlucio12:06:30

right it shouldn't, it should only refresh the index on the remote you clicked on the button

wilkerlucio12:06:04

are you using pathom with connect? otherwise your parser will probably don't know how to provide the index

levitanong12:06:40

Hmmm… Looks like I’ll have to read up on pathom. I’m not using it in any capacity at the moment.

wilkerlucio12:06:46

yeah, connect is a much higher level feature compared to the building blocks on pathom, I have to rewrite the docs to put it first

wilkerlucio12:06:03

the current ones might get the wrong impression about how this should be used

wilkerlucio12:06:53

but for now, I recommend checking the connect session in the docs: https://wilkerlucio.github.io/pathom/DevelopersGuide.html#_pathom_connect

wilkerlucio12:06:56

and if you are not familiar with the concepts, I gave a talk where I explain most of the core ideas: https://www.youtube.com/watch?v=r3zywlNflJI

👍 12
roklenarcic13:06:34

The biggest problem with graph APIs (fulcro or graphql) is lack of a good client caching story. For instance I have a list of documents. Document that have status Archived won't change any more. With REST I do one GET for list of document IDs, then a bunch of concurrent gets to load details. Archived documents are returned with a massive max-age header. They are now client cached and won't be requested anymore. With graph query you pull everything in one query so you get lower latency, but a single non-cacheable result ruins cacheability for all documents in the response.

roklenarcic13:06:30

It's easy to add client cache headers to REST controllers where possible, hard to do so for graph API.

wilkerlucio13:06:19

@roklenarcic but you can be smarter about loads, when you are loading new data, you can strip the keys you already have, this is actually way more flexible then the rest model since you can pick and choose at any point which attributes you want to load from the server, might require some initial structuring but in the end I think you get the best out of graphs, if you need even more flexible cache, you can layer parser over parser and cache stuff directly on the client using local storage or even indexeddb

roklenarcic13:06:42

Of course, server caching can be better.

roklenarcic13:06:51

SPAs tend to have little client cacheable content anyway

roklenarcic13:06:30

and any BLOBs you can put behind a REST interface and write another fulcro remote

roklenarcic13:06:41

then slap a varnish in front of that REST

tony.kay13:06:03

@jasonjckn sorry, no. I could turn the asserts into warnings for defui, and leave the harder-core checking on defsc perhaps…then again, not sure I’m willing to disable a sanity check for a legacy deprecated API that no one should use 😉

jasonjckn17:06:44

Yah, well not going to push very hard for this but that would definitely be helpful here, such a change would still be inline with your design goals since I believe the only reason for defui is backwards compatibility with untangled, and that extends to supporting the old v15 react api, which is still supported in v16.0 but deprecated, also this deprecation of react legacy API showed up in fulcro between 2.4.x and 2.5.x which is a bit arbitrary.

jasonjckn18:06:02

it’s clear we’ll have to migrate off this API one day or another, but as of now, just trying to take the shortest path to fulcro, and that’s a whole other undertaking.

wilkerlucio18:06:42

Just release Fulcro Inspect extension 0.0.5 and jar version 2.2.0-beta4, I recommend everyone using to upgrade to it, the major change is that the encodings for transit are fast now, even when you have non-standard data in it, if you have a large app this will make a good performance difference. And a small extra: if you click on the button to reset the app state while the slider is the current state, you will trigger a simple force rerender on the app.

jasonjckn19:06:36

Inside a mutation I have the following code (prim/get-props (:component env)) and it’s returning nil props , and the component is non-nil there’s no way this could have nil props because (:ref env) is non-nil, so it clearly has identity which come from props

jasonjckn19:06:37

(defmethod fulcro.client.mutations/mutate :default [env k params]
  (js/console.log "mutate " k " => ENV: " env)
  (js/console.log "component c = " (:component env))
  (js/console.log "component props = " (prim/get-props (:component env)))
  (js/console.log "component ident = " (prim/ident (:component env) (prim/get-props (:component env))))

jasonjckn19:06:15

@tony.kay perhaps another bug ?

jasonjckn19:06:48

ah i switched to prim/props and that solved it, nvm

jasonjckn20:06:38

@tony.kay instead of eliding asserts, this worked

(alter-var-root #'fulcro.client.primitives/validate-sig (constantly identity))
😉

jasonjckn21:06:21

@wilkerlucio trying fulcro-inspect for the first time, on your newest release, “Fulcro app not detected”

jasonjckn21:06:04

:cljsbuild
  {:builds {:dev {:source-paths ["dev/client" "src/client"]
                  :figwheel     {:on-jsload "cljs.user/figwheel-reload-hook"
                                 :websocket-host :js-client-host}
                  :compiler     {:main                 "cljs.user"
...........
                                 :recompile-dependents true
                                 :source-map-timestamp true
                                 :external-config      {:devtools/config {:features-to-install [:hints :formatters]}
                                                        :fulcro.inspect/config {:launch-keystroke "ctrl-f"}}
                                 :preloads             [devtools.preload
                                                        dirac.runtime.preload
                                                        fulcro.inspect.preload]
                                 :optimizations        :none}}

jasonjckn21:06:19

[fulcrologic/fulcro-inspect "2.2.0-beta4" :exclusions [fulcrologic/fulcro fulcrologic/fulcro-css]]

jasonjckn21:06:56

i’m using Chromium

twashing21:06:22

Is there a way or future plan to support tolitius/mount, or any other component system, for that matter?

wilkerlucio22:06:05

@jasonjckn I never tried on Chromium, did you get any errors? the extension icon "lights up" when you open the page?

jasonjckn22:06:31

@wilkerlucio it doesn’t light up no

jasonjckn22:06:39

@wilkerlucio when I click on the button I get the error “Fulcro app not detected”

wilkerlucio22:06:45

what version of fulcro are you using?

jasonjckn22:06:48

what browser should I use? chrome canary ?

jasonjckn22:06:51

2.5.8-SNAPSHOT

wilkerlucio22:06:38

no, regular chrome is fine, weird that isn't detecting, hadn't see that before, it should light up when the content script detects the fulcro inspect injection (it writes something on the DOM)

jasonjckn22:06:40

is this compatible with dirac?

wilkerlucio22:06:49

I never tried with dirac

wilkerlucio22:06:56

just use the simple devtools

wilkerlucio22:06:05

but I don't see what would break there

wilkerlucio22:06:17

you can try making a more clean slate to see what might be getting on the way

wilkerlucio22:06:30

you see the log on console about Installing Fulcro Inspect?

wilkerlucio22:06:59

ok, so the preload seems to not been loaded

wilkerlucio22:06:06

is figwhell and preloads work fine on :optimizations :none?

jasonjckn22:06:15

my dirac preloads work

jasonjckn22:06:36

that’s weird

wilkerlucio22:06:28

@jasonjckn yeah, can you try bursting all caches and trying again?

Chris Swanson23:06:29

anybody found a way to work around performance issues with semantic-ui-react ? my compile time is 11s 😞

Chris Swanson23:06:44

i saw tony mentioned something months ago that it was on google

Chris Swanson23:06:09

but couldn't find any more recent discussion

wilkerlucio23:06:24

@chrisjswanson this has to do more with the compilation process, not with fulcro, you probably have better answers at #shadow-cljs if you are using it, or #figwheel

Chris Swanson23:06:49

right on, thanks I give that a try

wilkerlucio23:06:57

Just release Fulcro Inspect extension 0.0.6 and jar version 2.2.0-beta5, this fixes a case where the fulcro app is too fast to start and the content script wasn't ready to catch the messages, causing the inspector to not refresh on page updates

👍 8
Chris Swanson23:06:20

so it looks like i was wrong - this isn't a semantic-ui-react issue. i created a blank lein fulcro project and just ran cljsbuild auto - still seeing really long compile times ("src/main" in 38s). By comparison, the same exercise with lein luminus compiles in 1.5s

Chris Swanson23:06:40

maybe not a strictly fulcro issue, but it does seem to have something to do with the way the template is configured by default