This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-22
Channels
- # bangalore-clj (6)
- # beginners (110)
- # boot (49)
- # cider (13)
- # cljs-dev (35)
- # cljsrn (5)
- # clojure (145)
- # clojure-conj (3)
- # clojure-dev (60)
- # clojure-italy (2)
- # clojure-nl (3)
- # clojure-russia (3)
- # clojure-serbia (1)
- # clojure-spec (116)
- # clojure-uk (58)
- # clojurescript (235)
- # cursive (14)
- # datascript (7)
- # datomic (31)
- # dirac (144)
- # emacs (1)
- # events (1)
- # hoplon (12)
- # leiningen (11)
- # luminus (60)
- # lumo (19)
- # off-topic (18)
- # om (74)
- # onyx (5)
- # pedestal (13)
- # precept (3)
- # re-frame (3)
- # reagent (15)
- # remote-jobs (7)
- # ring-swagger (25)
- # rum (1)
- # untangled (53)
- # vim (3)
for sure...it is better approach for sure
this means to write a regex against this though:
"body": "# A maintenance release\r\n\r\n## Rolling DevTools\r\n\r\nMerged commits from [official DevTools]().\r\nShould [work best]() with Chrome ~61.0.3126.2.\r\nLinks to matching [Chromium snapshots](): [Mac]() | [Linux_x64]() | [Win]() | [Win_x64]().\r\n\r\n## Notable commits\r\n\r\n05d1e3c380c773bb251165859a85db0e0309a88f project: bump cljsjs/parinfer to \"2.0.0-0\"\r\n\r\nAll new work: "
yes, shouldn’t be that hard, grab the line with Links to matching [Chromium snapshots].*
it's ok for now
I’m afraid slack somehow cached the snippet, at least it seems to be the old version on my end
Ok I will post the finished job and delete it for now
Tomorrow I will tackle the hard part, how to autoinstall dirac 😀 I am going to make sure to read carefully all your previous messages this time 😅
@darwin have you considered / have already inline installation links? https://developer.chrome.com/webstore/inline_installation
I could just redirect to a page that contains one
Although now that I am reading, it looks like you need to comply to some stuff
Np not in a rush thanks!
It has been quite a while since the last time I have used dirac 😄
I am testing it with boot-figreload
...I have a ws server for reloading stuff but I don't think I have anything connected to the Chrome debugger
however, I get :
console.warn("Cannot attach Dirac DevTools. Likely cause: another instance of DevTools is already attached.
Don't you have internal DevTools open in the tab?
See .
tab-url= , debugger-url=
what do you see when you visit http://localhost:9222/json in Safari?
@darwin don't have safari, I am on linux 😄 Do you need safari?
let me see
$ http-prompt
Version: 0.8.0
get
HTTP/1.1 200 OK
Content-Length:2035
Content-Type:application/json; charset=UTF-8
[
{
"description": "",
"devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9222/devtools/page/b65a440c-9bb1-402a-b790-5e611dfd4df8",
"faviconUrl": "",
"id": "b65a440c-9bb1-402a-b790-5e611dfd4df8",
"title": "New Tab",
"type": "page",
"url": " ",
"webSocketDebuggerUrl": ""
},
{
"description": "",
"devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9222/devtools/page/387dcf2c-b817-43ff-9a42-835a6c796b22",
"id": "387dcf2c-b817-43ff-9a42-835a6c796b22",
"title": "Developer Tools - ",
"type": "other",
"url": "",
"webSocketDebuggerUrl": ""
},
{
"description": "",
"id": "958f5ea2-06ba-4266-92e0-f084afb6d5bf",
"title": "localhost:3000",
"type": "page",
"url": " "
},
{
"description": "",
"devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9222/devtools/page/e2ccfd78-536f-4723-8f54-0aa39c1e8a6b",
"id": "e2ccfd78-536f-4723-8f54-0aa39c1e8a6b",
"title": "Dirac DevTools",
"type": "background_page",
"url": "",
"webSocketDebuggerUrl": ""
},
{
"description": "",
"devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9222/devtools/page/80263c05-d504-4da9-9a68-dcde40aa6ce0",
"id": "80263c05-d504-4da9-9a68-dcde40aa6ce0",
"title": "Worker pid:4961",
"type": "service_worker",
"url": "",
"webSocketDebuggerUrl": ""
}
]
what is that 387dcf2c-b817-43ff-9a42-835a6c796b22 record? it looks to me like internal devtools opened with your app
oh right lol...so that now is working, but I get:
Internal Dirac Error Could not load content for : HTTP status code: 404
where is that path calculated from?
uhm ok, let me see then
nope, .cljs files in the sources are empty unfortunately
this is with boot-figreload
so maybe I am messing up myself with the source maps
this url must work in your “other browser” http://localhost:3000/main.out/figwheel/client/main.out/figwheel/client/socket.cljs
ok yeah it looks off
is served correctly
so it means that the computed link is off ... somewhere, I will debug
look into https://github.com/clojure/clojurescript/wiki/Compiler-Options#source-map-path and friends
if you want to debug it, open generated socket.js and investigate sourceMappingURL comment at the end of the file
@darwin it looks like the comment is ok... //# sourceMappingURL=socket.js.map
do you have one lil' minute to expand a bit on how/where Chrome reads those urls?
given a js file, it looks for sourceMappingURL
comment, then loads associated .map file
ok so the content of the file is what fails here
look into socket.js.map, it has source-map json inside, some fields point to cljs source files
lemme check...
yeah so I have ,"sources":["main.out\/figwheel\/client\/socket.cljs"]
and :source-map-path "main.out"
probably that gets added to
I think it is added by boot-cljs
looks like some refactor has been done in an unreleased version of boot-cljs
after 2.0.0
trying 2.1.0-SNAPSHOT
yes! got it working!
Dirac + boot-figreload
😉
good! to me it sounds like someone was setting :source-map-path
without knowing what they are doing 😉
well they fixed it, I am ok with it 😄
need to write a blog post or better...docs for dirac
this is maybe figwheel client sending things
not maybe...
will try to setup a repo for you
ok, is this correct btw?
{:nrepl-server {:host "localhost"
:port nrepl-port}}
oh I wanted to customize the port
oh scratch that
should (require '[rest-resources-viz.util :as util])
then (util/)
autocomplete?
yeah and js/
does not work either for some reason...
think I need to enable the logs as above
trying now
yes I see the logs and it seems that on js/
nothing happens
yes true and thanks for that! an arbitrarily required namespace is not complete (do you get
cljs.compiler/env
for completions?)
have you read this? https://github.com/binaryage/dirac-sample#hello-world
uhm maybe not 😄
ok got it
so I have to change namespace
however, I think you'd have the info for completing a generic ns/
alias if you have access to the compiler state
you can see it on code-completion screenshots here: https://github.com/binaryage/dirac
no promises, but I will try to have a look, cider uses: https://github.com/clojure-emacs/cljs-tooling
basically only the completion with alias is missing from what I see
the fully qualified namespace completion works smoothly
“By design we don’t want Dirac to talk to nREPL and rely on some “connection” to provide some kind of server-side code completions. Dirac code completions should work without Dirac Agent (with no REPL enabled).”
this is for future, if I ever implement self-hosted mode, you could type simple cljs code without having nREPL connection at all
also requiring people to config another nREPL middleware sounds like a usability problem, even now Dirac is really for advanced cljs hackers
yep got that, I opened an issue as reminder
I like that you don't depend on nRepl
but lumo
can do it so you probably can do it too client side only
if you have the compiler env/state
cljs.user=> (require '[clojure.string :as str])
nil
cljs.user=> (str/
(str/blank? (str/capitalize (str/ends-with? (str/escape (str/includes?
(str/index-of (str/join (str/last-index-of (str/lower-case (str/replace
right now, dirac uses source map for given ns, to fetch cljs file and read its ns form to understand aliases
oh ok, now I understand why it would be some work
you parse the source maps for that...
uhm right
yep gotcha
@darwin do you want me to open an issue with that snippet above?
Yeah this one: java.lang.AssertionError: Assert failed: (instance? WebSocketServer server)
it is weird because it is sending :cljs/quit
back
probably figwheel sends that from the browser client
I don't know...maybe I am misinterpreting, in any case it is good to report it
I will probably wait for more people to hit that issue, or if you prepare a repro repo I would try to investigate
no thank you! we have boot + figwheel support as well now, it is super great!