Fork me on GitHub
#fulcro
<
2020-05-02
>
Mr. Savy00:05:43

css style are a paint to maintain. my best guess would be to minimize css overlap for deeply nested elements maybe.

Mr. Savy00:05:12

I've run into a really weird issue myself. Is anyone familiar with an issue where a bunch of garbled text is put between a "[" and a "]:"? I'm starting with a empty shadow-cljs project, but when I add the deps.edn file for for fulcro and s-cljs via the ":deps" section of shadow-cljs.edn to the page throws this error when I pull up the local host page. maybe it has to do with windows charater encoding? I see that it's referencing bidi, but I'm not sure if bidi has anything to do with this.

Mr. Savy00:05:51

In the meantime I'm going to clone a template and if the issue still persists. If not that may help me narrow it down.

Jakub Holý (HolyJak)17:05:43

Does it happen both in FF and Chrome?

Mr. Savy23:05:26

I'm new to slack and didn't see this so sorry for having not responded sooner

tony.kay02:05:35

@ajsnow2012 that is one I’ve seen….what caused that…is was some NPM weirdness

tony.kay02:05:37

or something

tony.kay02:05:25

@danvingo you sure that is the problem? Inputs require error to be set of the form and input in order to show

dvingo17:05:24

Turned out I needed to add "field" to the wrapper div.. shrug..

tony.kay02:05:09

@ajsnow2012 I have some vague memory that it was semantic-ui causing some set of crazy things. In my more recent projects if I use semantic-ui css, I make a diff directory for pulling just THAT in and building it, so it cannot hose the deps on the other layer…also, might have been node version…npm is just a nightmare.

Mr. Savy04:05:31

does fulcro and/or s-cljs use semantic ui or node.js by default? I didn't think I was even using node or any other libraries yet.

Mr. Savy04:05:49

oh wait you meant node for npm, duh. mb. hmm, maybe I should upgrade node/npm

thheller07:05:38

@ajsnow2012 typically that is caused by not specifying a proper encoding in your page. there should be a <meta charset="UTF-8"> in your <head>

murtaza5213:05:18

from the RAD book (attr/register-attributes! model/all-attributes), is this no longer required ? Cant find the above var in pathom "2.2.28"

Chris O’Donnell13:05:57

@murtaza52 The RAD book is out of date; it doesn't make sense to keep it updated given the frequent changes to RAD. It's recommended to use the demo and docstrings as documentation for the moment.

👆 4
folcon15:05:29

Question, is it general practice to aim to be up-to-date with shadow-cljs? or stay a few versions behind? If it’s the second, what’s the version people are finding stable?

thheller15:05:59

@folcon I generally recommend updating when there is a new feature you'd like to have or bug fixed that you run into. otherwise if everything works fine for you there is no real reason to stay up-to-date 🙂

👍 4
folcon15:05:04

I’m finding it difficult to move off "2.8.80"

thheller15:05:54

most likely a version conflict of some sort. especially likely if you use deps.edn or project.clj

folcon15:05:59

Different things break as I try and update, I’ve tried, 2.8.102 and 2.8.109. Sure but all I get is warnings and then the site doesn’t load… So it’s really hard to debug where the issue is?

thheller15:05:37

as I said. 99.9% sure its a version conflict

folcon15:05:37

I’ve also taken to rm -rf .shadow-cljs regularly, as I can’t clean…

thheller15:05:53

most likely trying to mix the newer shadow-cljs version with an older clojurescript version

folcon15:05:56

I find things a bit more stable that way…

thheller15:05:02

or closure-compiler with the wrong closure-library etc

folcon15:05:08

I’m running clojurescript 1.10.741

folcon15:05:00

I don’t think I require closure compiler myself, I leave that for deps.edn to handle =)…

thheller15:05:04

[org.clojure/clojurescript "1.10.741"
    :exclusions
    [com.google.javascript/closure-compiler-unshaded
     org.clojure/google-closure-library
     org.clojure/google-closure-library-third-party]]

   [com.google.javascript/closure-compiler-unshaded "v20200406"]

   [org.clojure/google-closure-library "0.0-20191016-6ae1f72f"]
   [org.clojure/google-closure-library-third-party "0.0-20191016-6ae1f72f"]

thheller15:05:10

those are the verisons you should have

thheller15:05:17

anything else is not guaranteed to work

thheller15:05:28

anything that is fixed by rm -rf .shadow-cljs should be considered a bug and be reported

thheller15:05:44

but the first thing I'm going to have you do is triple check your dependencies 😛

folcon16:05:58

Sure =)…

folcon16:05:07

Where do I get the versions/exclusions?

folcon16:05:23

As in how do I know the way to build a good deps list? It’s normally obvious, but I’m really not used to how shadow/deps works…

folcon16:05:22

Just as a sanity check, is the message server version: 2.8.80 supposed to give the shadow-cljs version? If so I’m really trying to work out how npx shadow-cljs server keeps launching 2.8.80 even after installing 2.8.109

thheller16:05:53

server version is the relevant version yes

thheller16:05:06

I guess you are using project.clj or deps.edn

thheller16:05:13

in which case you specify the version there

thheller16:05:25

package.json only controls the npm version which is just the CLI utils

folcon17:05:32

ok, just trying to get the relevant version, I created a minimal project to try and debug this =)… and now my main project isn’t updating >_<…

folcon17:05:27

@thheller:

failed to load shadow.module.main.append.js Error: No protocol method IMapEntry.-key defined for type string: absolute !important
    at Object.cljs$core$missing_protocol [as missing_protocol] (core.cljs:324)
    at cljs$core$IMapEntry$_key$dyn_60484 (core.cljs:659)
    at Object.cljs$core$_key [as _key] (core.cljs:659)
    at cljs$core$key (core.cljs:9028)
    at Object.eval [as cljs$core$ITransientCollection$_conj_BANG_$arity$2] (core.cljs:7087)
    at cljs$core$_conj_BANG_ (core.cljs:801)
    at eval (core.cljs:2482)
    at Function.eval [as cljs$core$IFn$_invoke$arity$3] (core.cljs:2482)
    at Object.eval [as cljs$core$IReduce$_reduce$arity$3] (core.cljs:3506)
    at Function.eval [as cljs$core$IFn$_invoke$arity$3] (core.cljs:2552)

Jakub Holý (HolyJak)19:05:04

@tony.kay Any special reason why ::report/layout-style , ::report/row-style , ::report/control-style are missing from the report-options ns or should I send a PR to add them?

genekim20:01:12

Thanks for mentioning this, @holyjak. cc @tony.kay FWIW, I just stumbled onto this — I made a new control layout, and was looking for how to activate it. Adding this to a RAD report option map worked. (Exposing it as an actual report-option var would be great, and saved me a bit of searching. In fact, I looked for 15m, and then searched Slack — and wasn’t surprised that Jakub already there. :)

::report/control-style :compact
PS: compact style moves the pagination control into the first row, between the report title. Again, Fulcro RAD continues to amaze me how every piece of the UI can be patched in. https://gist.github.com/realgenekim/5218bf72c64c613a5499175aae2bd295

❤️ 1
Jakub Holý (HolyJak)20:01:58

Thank you for sharing! I'm just working on a RAD app so it might be handy.

Eva O19:01:51

Yeah Fulcro is incredibly brilliant and RAD is a brilliant addition onto it. It cuts down on so much code and makes everything neater. It might be nice to have a report/install-control-renderer! function to go with the existing functions for installing renderers.

thheller19:05:04

@folcon that looks like you are calling (key some-string) where some-string is "absolute !important". no clue what that is about .

folcon19:05:23

It’s a little bit of a puzzle, I don’t believe I’m calling any such string in code I’ve written (I don’t use !important as a rule), it’s hard to pin down from the stacktrace where it’s coming from… and I don’t see it unless I update from 2.8.80 to 2.8.109, which doesn’t at all mean it’s coming from shadow, just that the version update surfaced it… I am using the standard fulcro template, I’ve been trying to update it so it’s using newer libs, but this approach wasn’t really working… Hence trying to write a fully clean minimal implementation, update all the libs and then add code until it breaks ;)…

thheller20:05:03

it is coming from your :init-fn, so some work you do in there ends up in some bad code

folcon20:05:57

Thanks for the heads up, not sure where you got that from the stacktrace, but I’ll dig in there =)…

thheller20:05:19

shadow.module.main.append.js is the generated source file that calls your init-fn

folcon20:05:38

Did not know that =)… Thanks!

folcon20:05:57

btw, quick question, why does the build status now say “Missing.“? It used to be a pretty nice message if I remember correctly =)…

thheller20:05:53

that happens when you open the UI after the build completed

thheller20:05:23

when the compile finishes while the UI is open it shouldn't show that

thheller20:05:50

need to store the last result server side so that it isn't missing but haven't gotten to tuning that 😛

4
dvingo20:05:28

found this strategy to start some form fields off in a completed state:

:pre-merge     (fn [{:keys [data-tree current-normalized]}]
                    (merge current-normalized
                      data-tree
                      (assoc-in data-tree
                        [::fs/config ::fs/complete?]
                        #{:field/one
                          :field/two})))

❤️ 4
Mr. Savy23:05:46

ok the fulcro template doesn't cause the weird issue so that's good. but also the template already comes with more code than I was even planning to write for my own project lmao

folcon23:05:45

It does that =)… I think there’s a ton of value in the template, but I’m finding it’s a lot more straightforward to just watch the video tutorial, grab the github code and then start from there? Then use the template to pull in bits you need =)…

folcon23:05:38

You end up adding only bits you understand more or less ;)…

genekim20:01:12

Thanks for mentioning this, @holyjak. cc @tony.kay FWIW, I just stumbled onto this — I made a new control layout, and was looking for how to activate it. Adding this to a RAD report option map worked. (Exposing it as an actual report-option var would be great, and saved me a bit of searching. In fact, I looked for 15m, and then searched Slack — and wasn’t surprised that Jakub already there. :)

::report/control-style :compact
PS: compact style moves the pagination control into the first row, between the report title. Again, Fulcro RAD continues to amaze me how every piece of the UI can be patched in. https://gist.github.com/realgenekim/5218bf72c64c613a5499175aae2bd295

❤️ 1