This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-11
Channels
- # aws (6)
- # beginners (167)
- # cider (41)
- # cljs-dev (6)
- # cljsrn (3)
- # clojure (399)
- # clojure-dusseldorf (1)
- # clojure-nl (2)
- # clojure-spec (3)
- # clojure-uk (47)
- # clojurescript (16)
- # core-async (8)
- # cursive (56)
- # datomic (14)
- # devcards (1)
- # docs (2)
- # duct (2)
- # editors (3)
- # emacs (3)
- # fulcro (178)
- # graphql (10)
- # off-topic (107)
- # onyx (7)
- # pedestal (21)
- # planck (13)
- # re-frame (58)
- # reagent (76)
- # ring-swagger (3)
- # shadow-cljs (85)
- # slack-help (2)
- # sql (1)
- # tools-deps (11)
- # uncomplicate (5)
- # vim (24)
- # yada (4)
is the push-state built-in support :devtools { :http-handler shadow.http.push-state/handle
supposed to handle more than one path? localhost:xxxx/foo
still directs to /index.html, and all downstream resources still point to <asset-path>/cljs-runtime/<asset>
but localhost:xxxx/foo/bar
will direct to /index.html and all downstream will incorrectly(?) point to /foo/<asset-path>/main.js
@lwhorton if I reload on localhost:xxx/app/doc/6
or whatever it will reload the main bundle for me. is that what you are asking?
i get the main bundle reloaded, but in dev mode where everything is spit into js/cljs-runtime files, the asset path is off
I can write my own handler to fix it, but i’m not sure if that was the original intent
so i use it with an spa that uses html5 browser history. so no matter what url you hit, it should return index.html. my code then dispatches to the right page. index.html loads the right stuff at that point. it really shouldn’t matter what url you are at, if i understand correctly
am i going crazy? if I remove :asset-path
from my configuration, it looks like main.js is dumped into my :output-dir
, but for some reason everything beyond the main.js file gets a js/cljs-runtime
attached? if I look at the main.js file itself i see
var CLOSURE_BASE_PATH = '/js/cljs-runtime/';
maybe it has to do with aws-sdk
I tried installing a different version, and got a different error
have you noticed module/method
and module.method
are different in shadow-cljs, if module is from npm?
> have you noticed module/method
and module.method
are different in shadow-cljs, if module is from npm?
What is this?
actually, I am trying to use aws-amplify
but I can't even get aws-sdk
to :require
... and I think aws-amplify depends on aws-sdk...
yeah error thrown, I just tried a different version of aws-sdk
and got a different error...
I couldn't get this working with leiningen
either (or at least :foreign-libs
, :npm-deps
) context here: https://stackoverflow.com/questions/49767358/aws-amplify-with-clojurescript
@quang I identified the problem. aws-sdk
has a weird circular dependency in their code which shadow has trouble with. will see if I can fix that.
when in cursive
I follow the instructions to connect to the cljs repl. all works great, however, i cant access the cljs.repl apis... what am i missing?
Connecting to remote nREPL server...
Clojure 1.9.0
(require '[shadow.cljs.devtools.api :as shadow])
=> nil
(shadow/nrepl-select :b2)
To quit, type: :cljs/quit
=> [:selected :b2]
(require '[cljs.repl :refer [doc source]])
=> nil
(doc map)
=> nil
thankshehe doh. @fj.abanses the output is printed to the browser console. the browser REPL client just didn't forward that to the REPL itself.
@quang should work in 2.2.29
. at least the require works. didn't know what/how to test further. let me know if you run into other issues.
my next goal was to get aws-amplify
required, (steps were 1. moment, 2. aws-sdk 3. aws-amplify) Got a weird Uncaught ReferenceError: Buffer is not defined
error, but it might not be related to shadow-cljs
https://github.com/aws/aws-amplify/issues/140
I don't get how anyone can ever say that clojure is slow when yarn add aws-amplify
takes Done in 74.61s.
@quang create a
(ns starter.buffer-fix
(:require ["buffer" :as b]))
(js/goog.exportSymbol "Buffer" b)
and then require this in starter.browser
BEFORE aws-amplify
Thanks @thheller!! I had serious contemplation of going back to JavaScript last night... even hired a VA to research javascript-alternatives for me... hah
this is the problem btw: https://github.com/crypto-browserify/createHash/issues/20
Hi there - is there any way to specify different configurations when running shadow-cljs release
? I’m using (goog-define api-host "
along w/ :closure-defines
in my shadow-cljs.edn
to switch config for dev/release, but I feel like I need one more option.
@bauerpauer https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration
But maybe I’m missing something. I could certainly just make a new build altogether.
Yep - I’ve got that goin already @thheller
What I’m up against is wanting to essentially do something like shadow-cljs release API_HOST=
and shadow-cljs release API_HOST=
when I run shadow-cljs dev
, my (goog-define api-host "
works great.
one option is to use the :closure-defines {foo #shadow/env "API_HOST"}
in your config
but this has various problems because the env of the server is used when a server is running
apart from that you can use clj-run
to call (shadow.cljs.devtools.api/release* build-config-map)
(shadow.cljs.devtools.api/get-build-config :your-build)
loads your build config from shadow-cljs.edn
(defn release [api-host] ...)
could be called with shadow-cljs clj-run your.build/release
Ya, clj-run
might be perfect. Thanks, I’ll give it a shot!
Skipping around the manual has bitten me again 😉 One of these days I’ll read it straight through I swear!
Is
new?
@jmckitrick no. it has been online a while. @jiyinyiyong made it.
Figwheel comes with its own web server for serving up your html/css/cljs using the information it gets from lein presumably. Does shadow-cljs? I assume not. If I'm right, can anyone recommend a server that does exactly what Figwheel does, except doesn't do its primary job of live code reloading? A web server that can be used with shadow-cljs when you don't really need one of your own.
yes it does come with one. https://shadow-cljs.github.io/docs/UsersGuide.html#browser-http-server
From the intro: "The built-in development server aggressively fixes browser caching issues"