fulcro-garden-css icon indicating copy to clipboard operation
fulcro-garden-css copied to clipboard

Drop `cljsjs` react in favour of node modules

Open danieroux opened this issue 2 years ago • 4 comments

Change the requires to pull in the node_modules installed react.

This change is needed for: https://github.com/awkay/workspaces/pull/6

danieroux avatar Feb 22 '23 16:02 danieroux

Technically I don't see any actual need to require them at all now. Neither of those namespaces uses React directly. It used to be that you needed to make sure the global js/React and such were defined, but nowadays things work a lot better. This is some old code. You might glance through the rest of the source and see if there are any js/React* usages, because that would also be bad.

awkay avatar Feb 22 '23 17:02 awkay

Yeah, I looked. I don't thing any requires for React are needed. Fulcro's namespaces take care of the low-level react stuff.

awkay avatar Feb 22 '23 17:02 awkay

This call in Fulcro is a challenge.

Since requiring ["react-dom/server" :as react.server] in that ns will declare a hard dependency on react-dom-server that Fulcro would not want?

The tests for fulcro-garden-css fails because of this (and also, the tests in this PR is failing already. Ugh.)

The tests pass if I invoke (react.server/renderToString c) instead.

danieroux avatar Feb 23 '23 09:02 danieroux

So, yes, if there are any direct refs to react things in this lib, then they need to be resolved as you noted. Yes, Fulcro's not going to change to service this lib. This lib should be fixed to do things correctly, including the tests.

awkay avatar Feb 23 '23 21:02 awkay