Fork me on GitHub
#fulcro
<
2019-04-11
>
currentoor04:04:59

@souenzzo have you looked at the mutations and network tab of the inspector?

currentoor04:04:15

could be that you’re getting duplicate data like Tony said (network tab), or duplication transactions invoked (transactions tab)

currentoor04:04:44

or non-duplicate transactions but poorly behaving ones

currentoor04:04:05

seems like it has to be of those three, and it would be good to figure out which one first

beetleman08:04:05

is the any way to provide :vendors and other options(https://github.com/noprompt/garden/wiki/Compiler) to garden.core/css when im using colocated css?

beetleman09:04:07

I saw it but I had hope that I missed something. Any objection about possible pull request with this? I will need this so I prefer have this in fulcro than in my code:D. Is good idea to extend css related function by one extra arrity?

(defn css-something 
  ([component]) 
  ([subset-of-garden-options component]))
? is it good idea for first fulcro PR?

kszabo10:04:27

Usually the codebase tends to keep the argument order the same, adding extra params at the end for option maps/etc.

👍 8
kszabo10:04:48

Just a preliminary code review comment 🙂 I would appreciate a PR for sure, now that I’ve read about it. Thankfully we support modern browsers but the prefix support would be nice if we decided to support older ones as well. 👍

beetleman10:04:12

args order was inspired by garder/css api. But usually i prefer adding extra options on the end. about browsers, clojurescript compile to es5 by default if i remember correctly so fulcro should support older browser. Prefixes in CSS are missing piece form me. My current project will be tested against IE and other older browsers so I'll catch all this kind of issues:D

👍 4
hmaurer09:04:36

That’s a question for @tony.kay 🙂

tony.kay16:04:14

@mateusz.probachta I’m working on a strategy to get this kind of stuff out of fulcro core. As it stands anything in the options map of defsc is hard to mess with…using protocols, so changes at that layer need new names or they are unacceptable breaking changes. As far as “helper” functions in the css namespace (e.g. for converting through garden), I don’t mind adding an extra arity for an “options” map if that makes sense. Also, why are we talking about the deprecated things in the old ns? Please don’t ask me to read a bunch of docs and source I wrote years ago to understand your request…

tony.kay16:04:41

A clear pointer to a real function in current version with what you want to do will get a clear answer

beetleman16:04:28

Sure, my bad. I meant fulcro-css.css-injection

tony.kay16:04:11

@mateusz.probachta sorry that was snippy…just get a lot of requests and been busy lately

tony.kay16:04:53

If you’re asking if you can add an arity to a normal function in css-injection to pass extra args to garden, the answer is yes, as long as it is a non-breaking change for existing users.

tony.kay16:04:42

the arg order should prefer the component…options are last by convention in Fulcro.

tony.kay16:04:32

I keep trying to figure out what the wording is for this “implicit convention” we have for argument order…sort of like “you pass the things you have the least influence on first”…not sure that’s the right way to say it…but a db connection, or component, or something…typically “first”…

mdhaney18:04:28

Same thing, but I usually think of it as “most stable” -> “least stable”. In most contexts, less -> more specific also works. The main point being, you want the stuff least likely to change first for partial application (which I seem to use way more often than most code I’ve seen, but that’s another discussion).

tony.kay21:04:51

That’s a better way of saying it: what the implications are for use: in threading or partial application.

beetleman16:04:50

Ok, i do not want break this convention. And yes i want add it;).

tony.kay16:04:46

another general rule is “multi-arity functions preserve the order of the lesser arities”…you don’t switch arg order as it goes up

tony.kay16:04:12

so sure, send over a PR

eoliphant18:04:42

Hi, quick question one of my guys is trying to implement an autosave feature, for a form component that has a generic save mutation. we need the save func to check the form state etc, prior to firing the mutation. of course the issue is that is that if we say call setInterval during the component’s mount, we’re closing over component’s this in the callback at the point that setTimeout is called, so when it actually executes, it’s not getting the current data. Any ideas on how we might circumvent this?

eoliphant18:04:00

That’s what he sent me, I haven’t had a chance to play with it myself

currentoor18:04:05

also you could instead call a mutation with the reconciler (that should never change)

currentoor18:04:22

and in the mutation you can look up the data in app state

currentoor18:04:26

and use that

currentoor18:04:36

that will never be stale

currentoor18:04:43

does that make sense?

eoliphant18:04:51

yeah that works for the data just fne, but we also were trying to check on the form state, etc with the apis

currentoor18:04:09

right, why can’t you do that in the mutation?

eoliphant18:04:15

which want a this

currentoor18:04:14

oh, which one?

eoliphant18:04:53

ah fs/dirty? etc etc

currentoor18:04:29

those take in props, not this

mdhaney18:04:51

This doesn’t sound right. I pass around functions that close over ‘this’ all the time without any issues.

currentoor18:04:12

^ i agree, i’ve never noticed it going stale

currentoor18:04:13

also, you can get the props in a mutation with prim/db->tree and you can get the query from the component class with prim/classname->class

mdhaney18:04:53

Are you setting the timer in :component-will-mount or :component-did-mount? You should be using the latter.

mdhaney18:04:02

Also, you’re creating the timer in the component that manages the form, not the form fields themselves, right?

eoliphant19:04:58

i think it’s in did-mount but will double check, and yes it’s the form

eoliphant18:04:13

false alarm, turned out to be his code ugh thanks