This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-18
Channels
- # announcements (2)
- # babashka (65)
- # beginners (104)
- # boot (8)
- # calva (23)
- # circleci (3)
- # clj-commons (1)
- # clj-on-windows (3)
- # clojure (43)
- # clojure-europe (45)
- # clojure-france (2)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-norway (13)
- # clojure-uk (4)
- # clojurescript (5)
- # core-typed (2)
- # cursive (5)
- # data-science (2)
- # datalevin (10)
- # emacs (38)
- # events (2)
- # fulcro (11)
- # graphql (6)
- # gratitude (2)
- # helix (11)
- # hugsql (3)
- # jobs (2)
- # lsp (17)
- # luminus (1)
- # malli (15)
- # missionary (3)
- # nrepl (6)
- # off-topic (6)
- # pedestal (2)
- # portal (16)
- # reagent (33)
- # reitit (4)
- # releases (12)
- # ring (2)
- # sci (3)
- # shadow-cljs (21)
- # spacemacs (7)
- # sql (5)
- # tools-build (36)
- # web-security (2)
@slack1338 no, that is only setup to require exports
To give a little bit of context, I’m looking into other ways to combine CLJS and Jest. Jest supports ESM and has some nice advantages to using those files.
As an alternative, would it be possible to configure the :js-options :js-provider
for the :npm-module
target? I tried to but it didn’t seem to work and I’d like to be able to set it to :import
so that it uses import("./some-file")
rather than require(…)
Hi, I have a vanilla browser-test setup working and I visit the browser-test page on localhost. When I remove the config from shadow-cljs.edn and invoke the api like this:
(shadow.cljs.devtools.api/watch
{:build-id :test
:target :browser-test
:test-dir "target/public/js/test"
:devtools {:http-port 8021
:http-root "target/public/js/test"}}
{:verbose false})
the watch appears to start normally, but there is no browser-test server started. is there something else I need to do when using the api to make this work?I see it's getting the config from file, rather than using what was passed in to start shadow server https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/server/dev_http.clj#L380
ended up alter-var-rooting the get-server-configs
var in that ns.
I think I can get by with just dev servers passed at top level, so if it used the server config passed in to start the shadow server, rather than reading from the file, that would work in that case at least
can you explain a little bit what you are doing? http servers are not coupled to builds and all http related :devtools
config is deprecated. I just still allow it to not break old templates and such
sure. briefly, I am using shadow via api functions. my shadow-cljs.edn file is currently empty. I call the function to start the main server, then call things like watch
that I posted an example of.
this is because we have many builds across many projects and so benefit from sharing boilerplate via code.
we could write out shadow-cljs.edn files and then invoke api calls with build ids and so on but since I can pass in config directly to the functions that seems preferable.
the pr still means changes from shadow-cljs.edn are picked up as it is changed - everything still works. it just also means the config from the initial call to start the main server (whether passed as arg or got from shadow file) is used to start dev servers
:dev-http
is nothing but a simple static webserver. when you start your "main server" I assume that already has a webserver? why not use that?
by main server
, I mean the shadow one, which has the dashboard ui. yes if I could get that to serve some resources of my choosing, that would work
most people that go with this type of total custom setup (ie. no shadow-cljs.edn
) tend to use their own servers?
oh I see. yeah that's a possibility. I'd rather configure it as per the shadow guide though. It makes it easier for others to follow
to be clearer about what I mean about getting shadow to use the config passed in to the main server, I mean I want the args I pass to
shadow.cljs.devtools.server/start!
to make it through to the dev-http stuff. that's what the pr achieves, while keeping the watch on shadow-cljs.edn working
yeah I get that, implemented in https://github.com/thheller/shadow-cljs/commit/378028ddb79913a5f8104306b0a9c8a691a2977c
also updated https://shadow-cljs.github.io/docs/UsersGuide.html#target-browser-test to make it not use http-root given its deprecated status