Fork me on GitHub
#fulcro
<
2018-01-08
>
tony.kay02:01:41

thanks. I'll look at it. The instructions on websockets in dev guide assume easy server, I think...and the components that are in the namespace are built to hook into it...and it is easy server that already has a pre-built handler component. The websocket demo is a roll-your-own server, and that is less well documented, I guess...other than there is that complete working demo with source.

funkrider04:01:58

Just wanted to say thanks so much to @tony.kay for all the great work on Fulcro. The video guide is awesome and really helped me to grok a lot of the om concepts.

tony.kay09:01:30

@funkrider Thanks. I appreciate the feedback.

tony.kay09:01:08

This is showing Clojure compile errors in the figwheel heads up display

tony.kay09:01:15

Clojure namespace management is kinda fiddly, so what I have so far isn't perfect, but it's basically a project that has client and server auto-hot-reload, with errors from either going to the figwheel heads up.

tony.kay09:01:27

easy to set up, actually...the hot reload was the main pain

tony.kay09:01:09

@thosmos That URL is the project with the nashorn SSR, BTW

tony.kay09:01:40

I hope to integrate these work flow improvements into the lein template, at least as an optional add-in...lots to do 🙂

johnny10:01:22

I have a problem with the router. I am using a string identifier for the ui ident. But this is unable to match because fulcro.client.routing/set-ident-route-params is changing the identifier to a keyword if it's not an integer. Is there a way around this?

tony.kay10:01:30

@johnny you're wanting to use a string for your screens ID?

johnny10:01:55

Yeah in some cases we have objects that have a string ID

johnny10:01:16

I've tried to normalize it by converting the ID to a keyword, but that's not working out

tony.kay10:01:32

yeah, the route params are probably a bit under-cooked

tony.kay10:01:58

what you get in a URL is always a string, so coercion is necessary

johnny10:01:29

Yeah I got the rationale behind it.

tony.kay10:01:25

I don't have any bright ideas in the abstract at the moment

johnny10:01:08

Alright fair enough, I'll fiddle a bit with it see if I can get an idea for this. And insert an issue later. Is that ok?

tony.kay10:01:47

Yeah, it's fine. Best idea I've got is to make sure those objects with the string IDs get converted to keyword IDs before you send them from the server.

tony.kay10:01:38

Another idea would be to somehow indicate a coercion function for a given parameter.

johnny10:01:15

Yeah I tried to return the ID's as keywords from the server. But the normalize function seems to convert that to strings in the normalize table (will check this to be sure)

tony.kay10:01:59

normalization in Fulcro does no such thing

johnny10:01:50

Ok good to know, will recheck this

tony.kay10:01:53

we could add a multimethod for parameter coercion. The default could just be what it is, could dispatch on the parameter keyword...would make the whole thing extensible

johnny10:01:53

Ok I see it now, that key seems to be dependent on how you specify it in the load function

johnny10:01:04

Got it working now.

tony.kay10:01:27

good. that was fast, so I assume it wasn't much of a pain

johnny10:01:28

No I was on the right track it seems

johnny10:01:33

Thanks for the help, want me to make an issue for further reference?

tony.kay10:01:58

You willing to test a patch? I just wrote one to make param coercion extensible

johnny10:01:26

That's fast, and yeah sure

tony.kay10:01:43

give me a min...I'll push a snapshot

tony.kay10:01:00

OK, 2.1.0-beta3-SNAPSHOT is up. It has a new multimethod in the routing namespace

tony.kay10:01:19

(defmulti coerce-param (fn [param-keyword v] param-keyword))

tony.kay10:01:29

The default processing is unchanged, but if you (defmethod coerce-param :param/Y [k v] v) for example, you could just make a string pass through for :param/Y

tony.kay10:01:03

there were existing tests on that functionality, and they all still pass, so I didn’t break anything.

tony.kay10:01:24

I assumed you’re on 2.x

johnny10:01:17

Yes, I am. Gonna check it out

johnny10:01:43

Tested it and seems to work fine 🙂 Thanks and appreciated!

tony.kay10:01:38

thanks for looking

funkrider16:01:50

hey does anybody have a recommendation for de-bouncing client side events like key-presses?

cjmurphy17:01:57

@funkrider: I use gfun/debounce since seeing it being used in Fulcro Inspect.

cjmurphy17:01:39

The require is [goog.functions :as gfun].

funkrider17:01:14

Ok great I'll check it out, thanks @cjmurphy

tony.kay21:01:23

2.1.0-beta3 on clojars. Some minor routing improvements including extensible parameter coercion and easier “current route” checking.