This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-25
Channels
- # aleph (1)
- # beginners (72)
- # boot (3)
- # cider (28)
- # cljs-dev (193)
- # cljsrn (11)
- # clojure (73)
- # clojure-brasil (3)
- # clojure-gamedev (2)
- # clojure-russia (6)
- # clojure-spec (30)
- # clojure-uk (26)
- # clojured (1)
- # clojurescript (32)
- # code-reviews (9)
- # core-async (4)
- # datascript (5)
- # datomic (9)
- # dirac (38)
- # fulcro (23)
- # garden (11)
- # leiningen (1)
- # luminus (11)
- # lumo (6)
- # off-topic (17)
- # quil (2)
- # re-frame (2)
- # reagent (3)
- # ring (3)
- # shadow-cljs (12)
- # spacemacs (4)
- # sql (2)
- # unrepl (85)
- # vim (3)
freaking Jira. I just spent a half an hour composing a thoughtful ticket for the browser-repl supplying a index.html and Jira completely ate it due to session time out.
@bronsa happy to test via deps.edn
to make sure everything looking alright before you cut another release
@bhauman I left a comment on CLJS-2553, I think we should just emit index.html
if not present - I don’t think we need to overthink this, browser REPL looks for index.html
in the current directory - we should just do that - means fewer changes
I’m sure someone has mentioned this before, but this works clj -J-Dclojure.server.repl="{:port 5555 :accept cljs.repl.node/-main}"
so the browser repl looks for the index.html in the :static-dir
's which are overridable
@bhauman we do need a flag to disable the generated file, but it should default to true
hrm, but then the user has to know what will go in there if they need to provide their own …
The tradeoff seems thin for a 3 line html file. That everyone has to learn to write anyway. Serving it will work no matter what the config is, and adding a flag to prevent an unwanted index.html seems not the best
Looking over the prepl
stuff, I think self hosted environments can choose to implement their own version of cljs.core.server/io-prepl
(which involves self-hosted eval
) and those supporting Socket REPL can allow users to hook into prepl
via :accept
.
Perhaps an interesting consequence of all of this is that cljs.core/tap>
and related fns, are really there for self-hosted environments, unless I'm thinking about this incorrectly.
@mfikes well REPLs can call add-tap
on the client side of their integration, so not just for self-hosted
When I do
clj -J-Dclojure.server.repl="{:port 5555 :accept cljs.core.server/io-prepl}"
in the root of the ClojureScript source tree, I get an exception indicating
Unable to resolve symbol: PrintWriter-on in this context
Will dig further or write a ticket.OK, I'll use https://clojurians.slack.com/files/U050B88UR/F9DNQT4TB/-.clj as a model for now
Like this
$ java -Dclojure.server.repl="{:port 5555 :accept clojure.core.server/io-prepl}" -jar clojure.jar
IMHO, Quick Start today has the potential to turn away people who are not patient enough to make it through it. With this new stuff, devs who want instant gratification will be happy.
For example, I think I spent 10 to 15 minutes figuring out index.html
. Life it too short for that.
I don’t think so, we’re just doing this so you get something if you don’t provide index.html
:local/root
deps rock (I just applied the patch and ran things without even building ClojureScript)
Safari is still doing that thing where you sometimes need to refresh your http://localhost:9000 page (but this is not a regression, this seems to have always been the case)
I have to say I think maybe adding an output-to to the client.js compile and then pulling the output-to from .repl dir might be a good solution because it doesn't couple the browser repl behavior to cljs.main
… but browser REPL server could serve out/main.js
if it doesn’t exist same as index.html
An extremely nice consequence of the synthetic generation of index.html
is that the code being compiled can now be a git dep. (This did not work previously because, even if you had an index.html
in the git repo, it wouldn't be in the working directory. Now that it is synthetically created, things just work.)
@mfikes by the way I don't know if you tried running rebel-readline.main and then launched a rebel-readline.cljs.repl/repl from inside it
I'd like to make a "one line git dep" demo of this synthetic index.html
generation. I don't know web tech enough to know if I can dynamically add a canvas
element so that I cal slap the CLJS logo into the browser (using the bit of code at the bottom of http://blog.fikesfarm.com/posts/2017-04-29-clojurescript-ejecta.html)
I'm thinking you run clj -Sdeps
...` and then go to localhost 9000 in your browser and see something cool
https://stackoverflow.com/questions/15741006/adding-div-element-to-body-or-document-in-javascript
Cool. I might try that. A browser-based version of something like https://twitter.com/mfikes/status/967038906893045760 to get more people interested in cljs.main
and git deps, etc.
man there is very little in the way of args checking a simple check that prints a message non existence of needed paths would do wonders
define a new fn in your source, reload the browser, and call it from the repl, with no compile warning
Oh that's cool indeed as does it work in node as well?