Fork me on GitHub
#rum
<
2017-02-20
>
mruzekw00:02:31

It seemed to work for a bit, but then I had #js in a function, and now it’s saying there’s no reader for that tag.

mruzekw00:02:04

Any pointers? Would like the initial page render to come from the server. Is it realistic to have identical component trees?

martinklepsch05:02:22

@mruzekw: the #js literal needs to be inside a reader conditional

martinklepsch05:02:13

#?(:clj [] :cljs #js [])

martinklepsch05:02:19

As for identical component trees. It can work but all your components need to be defined in rum. You cannot use any JS react components in server side rendering

mruzekw15:02:12

@martinklepsch Thanks, I think I almost have it. Now it’s having trouble with js/ namespace

mruzekw15:02:15

Here is my code ^ I’m having trouble rendering the component tree on both the server and client

mruzekw15:02:20

Any help is appreciated

kauko15:02:22

what is wrong exactly @mruzekw

mruzekw15:02:47

Caused by: java.lang.RuntimeException: No such namespace: js

mruzekw15:02:55

This is in a cljc file

mruzekw15:02:19

I guess I could pull out the application logic to the client side, and pass in an on-submit function to passwordless-login

kauko15:02:34

What is this? js/Auth0

kauko15:02:47

that's a browser API I guess, you can't use it on the server side

mruzekw15:02:53

I’m aware

kauko15:02:27

Actually, can't you just ignore that part on the server?

kauko15:02:04

The whole send-email function, can't it be something like (constantly nil) on the server side?

mruzekw15:02:20

Right, I just moved sen-email to strictly client side and am passing in a submit function. I’ll post my new code for reference

kauko16:02:15

I'd love to see your code but I need to run. First thought when you said you "moved the send-email to strictly client side" is, you don't need to do that. You can keep it in the cljc file, and just wrap it in ?(:cljs). And then have another version for :clj

kauko16:02:53

There's pros and cons to both approaches, but I'd prefer to keep the relevant code in one namespace

mruzekw16:02:21

Okay, thanks, I’ll give it some more thought