This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-12
Channels
- # aleph (3)
- # announcements (15)
- # architecture (6)
- # babashka (35)
- # babashka-sci-dev (10)
- # biff (5)
- # calva (9)
- # cherry (1)
- # cider (44)
- # clj-kondo (31)
- # cljfx (1)
- # clojure (108)
- # clojure-europe (32)
- # clojure-norway (12)
- # clojurescript (15)
- # conjure (3)
- # cursive (8)
- # datahike (1)
- # datalevin (19)
- # datascript (1)
- # datomic (59)
- # emacs (4)
- # graphql (3)
- # jobs (1)
- # luminus (6)
- # meander (9)
- # membrane (45)
- # nbb (67)
- # off-topic (16)
- # portal (3)
- # remote-jobs (1)
- # scittle (8)
- # shadow-cljs (46)
- # test-check (7)
- # tools-deps (5)
- # vim (63)
- # web-security (11)
- # xtdb (15)
is it possible to import cljs in a clj build hook file ?
a build hook file importing a function in the cljs source-paths and invoking it
requiring
I have a function written in a cljs file with the cljs file ext. the hook file is written in cljc ext and I need to grab a function in the cljs file to use in the cljc hook file
I was looking at reader conditionals https://clojure.org/guides/reader_conditionals
don't know why your hook is cljc but it sound like you are trying to do something that is not possible?
I have a hooks.main
file
and it calls hiccup html
, I need to grab a component in the cljs side and call it inside hiccups html
what do you mean by "call it inside". this is CLJS code, so it is meant to run in the browser?
if you are trying to use hooks to do some kind of server side rendering stop, they are not meant to do that and can't do that
I need to call the function that wraps the component inside hiccup’s html
form
so that it returns a string for example
it’s means to compile to an index.html file
it’s meant*
but I need to insert a component when the index.html builds
since I already have it written somewhere else
I mean that when the hook runs and invokes hiccups html
, I want to write a symbol that references a reagent component definition written in cljs, then I want that fn call to return inside the html
hiccup form, I want to eval it and return when the build calls html
said component is just hiccup markup doesn’t have anything fancy
so you want to take the html this component generates and dump it statically into a .html file
exactly
this is generally called server-side rendering. this is not supported and build hooks cannot do that and really absolutely should not do that
the build hook outputs a static index.html file, in that file I want to include that component written in cljs/reagent
I think what u said earlier is what I’m trying to do
anyway, is this possible? tried requiring the cljs with reader conditional
but doesn’t work
ok, I guess my build hook will be used strictly to prepare a static index.html to then mount the app