This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-14
Channels
- # babashka (43)
- # beginners (47)
- # biff (1)
- # calva (16)
- # cider (7)
- # clerk (6)
- # clj-kondo (39)
- # cljdoc (49)
- # clojure (29)
- # clojure-brasil (1)
- # clojure-europe (93)
- # clojure-losangeles (1)
- # clojure-norway (34)
- # conjure (7)
- # datalevin (8)
- # events (1)
- # gratitude (3)
- # honeysql (6)
- # hyperfiddle (2)
- # introduce-yourself (1)
- # javascript (1)
- # jobs-discuss (9)
- # lsp (3)
- # malli (10)
- # off-topic (8)
- # pedestal (3)
- # rewrite-clj (2)
- # shadow-cljs (17)
- # sql (33)
- # vim (1)
- # xtdb (31)
is there a way to opt into dead code elimination for certain npm modules? Concretely I’d like to use https://www.framer.com/motion/guide-reduce-bundle-size/
no, and the tree shaking mentioned there is entirely different to what the closure compiler does. you can make use of that by using https://shadow-cljs.github.io/docs/UsersGuide.html#js-provider-external though
the JS style tree shaking is not support by the closure compiler, and I haven't been able to figure out what they do exactly to replicate that in shadow-cljs directly.
Has anyone expirience with migrating a next.js react typescript monorepo to clojurescript? I was thinking of rewriting the toplevel components first. And add the existing components to a shadow cljs build with webpack bundler. Is it possible to do it step by step? Background is that the project has not the resources to stop the universe and do a complete rewrite at once.
The serverside api is very small. Rewriting that as a ring web application should be no problem.
Thanks for your response. I now that ring is clojure. With that I just wanted to mention that the backend side of next.js is not the problem. Sorry for the confusion. I don’t want to import cljs modules into js, but the otherway around. Importing js modules into cljs. Problem is, that these are not modules on npm, but are available as typescript source code. So I guess, that there has to be a bundler? Or is shadow able to import typescript from local folders?
shadow-cljs does not support typescript no, but you can just output the compiled typescript code into node_modules
so just compile it into node_modules/your-thing
and access it via (:require ["your-thing" :as x])
in CLJS
or if you prefer it to be not in node_modules
you can output to some-folder/your-thing
and :js-options {:js-package-dirs ["node_modules" "some-folder"]}
in your build config
ok. I give it a try. If I get it to work , then a step-by-step migration should be feasible 🙂 . Thanks for your advice!
Has anyone looked into Modern Yarn (aka yarn 2.0?), I'm glancing over the changes and see that because it https://github.com/thheller/shadow-cljs/issues/670 & I don't see anything my SPA is going to use. If anyone else looked into yarn 2 and has a quick experience report, i would love to hear it ❤️ .