This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-30
Channels
- # announcements (15)
- # beginners (143)
- # boot (2)
- # calva (48)
- # cider (93)
- # cljsrn (2)
- # clojure (127)
- # clojure-europe (3)
- # clojure-italy (8)
- # clojure-losangeles (8)
- # clojure-nl (10)
- # clojure-spec (67)
- # clojure-uk (51)
- # clojurescript (20)
- # cursive (9)
- # data-science (2)
- # datomic (10)
- # duct (13)
- # figwheel-main (1)
- # fulcro (74)
- # instaparse (10)
- # jobs (3)
- # joker (8)
- # juxt (4)
- # lumo (1)
- # malli (11)
- # nrepl (3)
- # off-topic (4)
- # pathom (5)
- # pedestal (6)
- # planck (5)
- # re-frame (18)
- # reagent (5)
- # reitit (17)
- # shadow-cljs (165)
- # sql (30)
- # vim (12)
- # xtdb (6)
For data that is static for the lifetime of the server, can {:reconciler-options {:shared …
be load!
ed from the server?
@tony.kay I just cut a significant amount of code from the shadow-cljs UI release build by adding this file to my local code: https://github.com/thheller/shadow-cljs/blob/master/src/dev/com/fulcrologic/guardrails/core.cljs
build goes from Module: :app [JS: 1.2 MB] [GZIP: 309.45 KB]
to Module: :app [JS: 998 KB] [GZIP: 248.96 KB]
not sure if guardrails actually still works though, but you are falling for the typical CLJC issues that I mentioned here https://code.thheller.com/blog/shadow-cljs/2019/10/12/clojurescript-macros.html
my UI code still runs fine but the guardrails stuff is disabled, so if it is enabled my hack might break stuff
So I didn’t need analyzer…that was cruft I accidentally copied in from ghostwheel. Looks like I can get guardrails almost completely out of a production build. Working on a release to update Fulcro…testing now.
If you have a moment @thheller, force in version 0.0.9-SNAPSHOT of guardrails and remove your file. That should eliminate the need for analyzer, and also shrink the guardrails overhead to nearly nothing (I get 5.5k on a react native build, but I suspect there is something more DCE could do that I’m missing)
so with your fix my build goes to Module: :app [JS: 1.03 MB] [GZIP: 263.7 KB]
while mine is at Module: :app [JS: 869.25 KB] [GZIP: 222.68 KB]
I wish all this would work better ... but I can't think of a reasonable way to handle all this
well, the side-effecting of specs is handled by guardrails…but spec itself is going to come in, yes
https://github.com/thheller/shadow-cljs/blob/master/src/dev/com/fulcrologic/fulcro/specs.cljs
I did the same treatment to this https://github.com/thheller/shadow-cljs/blob/master/src/dev/edn_query_language/core.cljc
since it was bringing in all the test.check stuff and generated a bunch of spec generators
yes, for sure. I was just digging through things because I wondered why my build got so big
and was thinking about possibly teaching the closure compiler about this stuff so it can remove more
so basically I hope to support more "dev-time" stuff in a way that doesn't mess with the build too much
Yeah, that’s nice. In the guardrails use-case I really just find using specs as a loose type system brings quite a bit of value to dev and testing.
but data exporation is also a big help (thus Fulcro Inspect)…but having REBL like facilities we could hook into (auto-follow idents) would be super nice
Module: :app [JS: 869.28 KB] [GZIP: 222.68 KB]
after a couple more tweaks but those weren't fulcro related
@thheller thanks for the heads up. I’ll see if I can make all the macro stuff go away for cljs.
I’ve release 0.0.9 of Guardrails and 3.0.8 of Fulcro (which upgrades deps). The production build size and CPU overhead of guardrails in CLJS is now zero in advanced builds (assuming you don’t enable guardrails in production).
Haven't done much with guard rails, but I switched my project over today to 3.0.6 and Guardrails 0.0.9. All seems well.
I don't see any 3.0.8 though, just the snapshot version on github of 3.0.7 you pushed.
I updated the Fulcro 3 release of workspaces to also remove ghostwheel references. Version 1.0.0-RC2 on clojars. https://clojars.org/com.github.awkay/workspaces