This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-19
Channels
- # beginners (59)
- # calva (20)
- # cider (25)
- # clj-kondo (12)
- # cljdoc (3)
- # cljsrn (15)
- # clojure (104)
- # clojure-europe (4)
- # clojure-italy (10)
- # clojure-nl (3)
- # clojure-spec (14)
- # clojure-uk (13)
- # clojurescript (33)
- # code-reviews (26)
- # core-async (1)
- # cursive (5)
- # data-science (3)
- # datomic (8)
- # emacs (3)
- # fulcro (5)
- # graphql (3)
- # hoplon (1)
- # jobs-discuss (4)
- # kaocha (14)
- # nyc (1)
- # off-topic (33)
- # pathom (4)
- # pedestal (2)
- # quil (1)
- # re-frame (5)
- # reagent (10)
- # reitit (6)
- # rewrite-clj (3)
- # shadow-cljs (173)
- # specter (7)
- # sql (4)
- # vim (58)
- # yada (3)
Not officially supported nor tested. But it might work. Reagent requires react
and react-dom
"namespaces"/JS Modules so you'd need to overwrite the ones from Cljsjs packages.
If you use tooling with Webpack, it could be quite simple: https://github.com/developit/preact-compat#usage-with-webpack (I think figwheel-main can use Webpack)
@U061V0GG2 thanks, I'm using shadow-cljs, but I think maybe I can just webpack bundle that. I just don't know will it lack some features that reagent need
@U09LZR36F thanks for the advance, but I already have my project written in clojurescript with reagent and re-frame. But I did not include any other react npm library, so I wonder how can I reduce the bundle size. I mean if react is large and I can replace it with something else, that will be great in my case.
You can analyze the optimized build to check how much the libs take up size: https://shadow-cljs.github.io/docs/UsersGuide.html#_build_report React probably isn't that large compared to Cljs standard library etc.
And one option could be to load React from a external CDN. If (when) user already has a cached version, nothing needs to be downloaded.
Aha, shadow-cljs has a example of using preact: https://shadow-cljs.github.io/docs/UsersGuide.html#js-resolve-npm
Not officially supported nor tested. But it might work. Reagent requires react
and react-dom
"namespaces"/JS Modules so you'd need to overwrite the ones from Cljsjs packages.
If you use tooling with Webpack, it could be quite simple: https://github.com/developit/preact-compat#usage-with-webpack (I think figwheel-main can use Webpack)
You can analyze the optimized build to check how much the libs take up size: https://shadow-cljs.github.io/docs/UsersGuide.html#_build_report React probably isn't that large compared to Cljs standard library etc.