fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
mischov 2020-11-24T00:42:07.274900Z

Thanks

genekim 2020-11-24T02:33:46.275200Z

Hmm!! Okay, that was super helpful!! Obviously, I don’t understand :jvm-opts as well as I thought! 🙂 > (System/getProperty “guardrails.enabled”) > => nil Huh. I just spent 30m scouring the docs on deps.edn…. Is it not allowed to put a :jvm-opts at the highest level in a deps.edn file?

{:src      ["src"]
 :jvm-opts ["-Dguardrails.enabled=true"]
 :deps     {analytij/analytij                   {:mvn/version "0.4.0"}
            com.fulcrologic/guardrails          {:mvn/version "0.0.12"}
            org.clojure/data.csv                {:mvn/version "0.1.4"}
            vlaaad/reveal                       {:mvn/version "1.1.164"}}
 :aliases  {:test {:extra-paths ["test"]
                   :extra-deps  {lambdaisland/kaocha {:mvn/version "1.0.700"}
                                 org.clojure/test.check {:mvn/version "1.1.0"}}}}
THANK YOU!

genekim 2020-11-24T02:36:06.275400Z

…holy cow… :jvm-opts must be inside of an alias.. 😱 https://clojure.org/reference/deps_and_cli Prepare JVM environment JVM arguments may either be passed on the command line (with `-J`) or by using data stored in an alias under `:jvm-opts` and passed with `-X` or `-A` or `-M`

genekim 2020-11-24T02:39:06.275600Z

It’s working. Thank goodness. (Trying not to weep at the time I spent on this…. Worth it, though! 🙂

genekim 2020-11-24T05:01:43.275800Z

@tony.kay BTW, can one put things like #(instance? LocalDateTime %) (or String or any class) into the parameter types? When I try, I get this error. Thx for your great work here, and I’m looking forward to your commercial offering — consider me on the “must buy” list, as well as happy to test anything you have!

(>defn tt2
    [x] [int? => #(instance? java.time.LocalTime %)]
    (+ 1 1)))
Syntax error compiling at (src/analytics/guardrails_test.clj:10:1).
Unable to resolve symbol: fn* in this context

cjmurphy 2020-11-24T08:10:28.276100Z

One thing that strikes me is your global resolver is liable to return {:foo nil}. You could slightly alter things so that if (get @foo-table 1) is nil then your resolver actually returns say :unknown-foo. I regard any resolver returning nil as a bug in my own code.

Helins 2020-11-24T13:24:17.276400Z

They are, I even println them in the rendering function to make sure that all values used for rendering are indeed what they should be. Still, when a mutation leads to changing both max and value at the same time, only max gets updated in the DOM although I know for a fact value changed as well (ie. its prop). Furthermore, If I save my files and trigger compiler + re-rendering, then value gets updated as expected. Well, to be more precise, I noticed some float wizardry. value doesn't stay exactly the same, it's changing from 1.444446 to 1.4444457 for instance. No idea what is happening there! Disclaimer, that component is not exactly trivial, it uses getDerivedStateFromProps for instance, there is room for a weirdness. However I did spend some time on it, trying different variations, the end result was always the same. I was wondering if it wasn't due to React, maybe something like the algorithm updating max before value? But I would have a hard time believing no one noticed this before.

Danny Almeida 2020-11-24T22:27:33.281300Z

I get Revision nil when using fulcro-inspect - this only happens when devtools is already open. If i close it and reopen it and then click on fulcro inspect tab, i can see the app db data. I tried reinstalling the extension and restarting the server, but i get the same issue every time including on two different systems. I'm using Fulcro inspect 3.0.2 and fulcro version 3.4.3 . Reading earlier threads, I've checked that third party cookies are enabled and also ad blockers are disabled on the page.

Henry 2020-11-26T02:31:13.303700Z

@reshef.mann Are you using Fulcro version 3.4.2+? The latest Fulcro Inspect requires that to work.

Danny Almeida 2020-11-26T02:58:01.303900Z

@henrik I'm using fulcro version 3.4.3 and fulcro inspect version 3.0.2 and see the same issue.

Henry 2020-11-26T05:24:50.304100Z

@dionysius.almeida The issue is strange because Fulcro Inspect is working fine for me... Make sure your Chrome version is up to date as well. Try setting "Site access" to "On Click" in your Fulcro Inspect extension settings. This way, when you use Fulcro Inspect, you need to click on the Fulcro Inspect extension icon to "activate" it. From your screenshot, you should click on the puzzle icon towards the right end of your navigation bar, then click on "Fulcro Inspect". Hope that manually turning on Fulcro Inspect can solve your issue of it not working all the time. The bright side is that you could still get it to work somehow, despite the workaround (i.e. closing and opening it again). Hope you can find a solution. P.S. You @ a different person, not me. I am @hk9861.

Danny Almeida 2020-11-26T06:37:11.304300Z

@hk9861 Thank you for your help. Yes I did @ a different person 😀. I did change it to "`On Click`" but it's the same result. I guess I will have to live with the closing and opening developer tools for now.

Reshef Mann 2020-11-26T09:23:28.304500Z

@hk9861 Thanks! I was indeed using and older version (I cloned the fulcro template). It works fine now.

tony.kay 2020-11-28T18:18:41.004900Z

Any further updates on this? I’m not able to reproduce on MacOS. I just updated all deps on the template and reinstalled from Chrome store to be sure. I see no problems.

Henry 2020-11-29T08:04:49.009600Z

@tony.kay This matter was interesting so I took some time to investigate. Based on the screenshot provided by @dionysius.almeida, I tried out the same piece of demo codes under chapter 3.9.1 in the Fulcro book.  The issue does exist for this particular demo. However, Fulcro Inspect works fine in other settings, like the latest Fulcro RAD Demo which I just checked.  A video is worth a thousand words, so I have prepared the following video to show the strange behaviour.  The same behaviour can also be observed when running the codes in a workspace.  Also note that after getting "Revision nil", if you send any transaction, Fulcro Inspect springs up properly again. Hope this is helpful in the debugging process.

Henry 2020-11-29T08:14:50.010200Z

P.S. The console error message is the same as stated by @reshef.mann above. So, it might be worth noting that the error message in this issue is the same as the one caused by not running Fulcro 3.4.2+. Error message points to: [fulcro.inspect.chrome.devtool.main:176] - Something was nil (anonymous) @ main.js:4081 .

tony.kay 2020-11-29T19:06:46.011700Z

Thanks a lot @hk9861. This is a very minor issue that has to do with how Inspect works now. The older inspect used to send every database delta but as a diff. This was a lot of overhead, and would also get out of sync. The new version asks for diffs based on what it already has, and the UI just sends revision numbers. So, at each swap on the state atom the UI is sending “I now have revision n+1”, to which Inspect responds by looking in the history of what it has (I have nothing) and sends a message “I need all of revision n+1". Startup is a bit of a conundrum, because the app has to send a connect message, but if Inspect isn’t running when the app starts, then there is nothing to talk to. Thus, when you open inspect it is just waiting for an app to “appear”. Remember: you can embed 20 apps on a single page. I guess each app could poll for inspect if it hasn’t reached it, but simple interacting with the app “fixes it”, because then the app knows to try to talk to Inspect. I’m sure this could be made better, but I don’t currently have the time to work on it, test it, and then do the hour of deployments stuff to get it out.

tony.kay 2020-11-29T19:09:11.012300Z

It really should work if you open the app with Inspect open, so that is a minor bug, but just interacting with the app should “wake it up” I think, no?

Ola Sikström 2020-11-29T20:49:57.012900Z

Is the latest inspector version expected to work at https://book.fulcrologic.com/ at the moment? I seem to get "revision: nil" no matter what i try.

Ola Sikström 2020-11-29T21:07:00.013100Z

Seems like the book is running version 3.0.8, so i assume that's a no then?

Ola Sikström 2020-11-29T22:06:11.013300Z

That was it. Installed an older version of inspect, and now it works fine. https://github.com/fulcrologic/fulcro-developer-guide/pull/60 with added instructions.

tony.kay 2020-11-30T01:41:52.013700Z

Ah, thanks. I had overlooked that. I upgrade the book’s deps, and recompiled, and also finished making some demos work that I hadn’t gotten around to porting from 2.x

2👍
Henry 2020-11-30T15:17:03.016500Z

@tony.kay Your explanation is spot on and helps me make sense of how Inspect works behind the scene. Agree that this is a very minor issue. In case of "Revision nil" situation that is not due to incompatible versions, one can easily "wake it up" by either interacting with the app or simply re-opening Chrome Dev Tools. To me, it is a good enough solution already.

2020-11-24T23:01:22.281700Z

It's definitely possible to run in node.js I have started down this path here: https://github.com/dvingo/dv.fulcro-template/blob/master/resources/clj/new/dv.fulcro_template/src/main/app/node_server.cljs I have to update that template with some changes I made to my own project, but it should give you an idea

1❤️1😮