This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-28
Channels
- # beginners (226)
- # boot (18)
- # bristol-clojurians (4)
- # cider (1)
- # clara (77)
- # cljs-dev (79)
- # cljsjs (27)
- # clojure (178)
- # clojure-austin (9)
- # clojure-dev (30)
- # clojure-gamedev (11)
- # clojure-italy (5)
- # clojure-losangeles (3)
- # clojure-poland (1)
- # clojure-spec (42)
- # clojure-uk (34)
- # clojurescript (182)
- # core-async (5)
- # core-logic (2)
- # cursive (17)
- # datascript (12)
- # datomic (33)
- # emacs (8)
- # figwheel (1)
- # fulcro (25)
- # jobs (6)
- # jobs-discuss (27)
- # lein-figwheel (1)
- # lumo (18)
- # off-topic (17)
- # onyx (5)
- # pedestal (7)
- # re-frame (30)
- # reagent (52)
- # remote-jobs (1)
- # ring (2)
- # ring-swagger (1)
- # shadow-cljs (40)
- # spacemacs (5)
- # sql (31)
- # unrepl (12)
- # vim (25)
I made browser REPL a bit smarter, it only compiles the preload stuff now, and it always requires it when starting up - that means you should be able to use browser REPL on a project where you weren’t initially using it
soooo 🎉 @dnolen this compiles fine now!
clojure -A:cljs-canary -m cljs.main -cf "$(cat cljsc_opts.edn)" -c ep-cloud.handlers
@dnolen apologies if this is off of the main thrust of development, but this ticket and patch seems like pretty clear win https://dev.clojure.org/jira/browse/CLJS-2581
are JS dependencies working in a node
REPL? just checking now, I thought they did
oh ok I have just discovered that cljs.repl/repl
accepts compiler options
If you use cljs.main
to compile a browser-based project specifying -O advanced
you can still add -r
to cause the browser to launch and run your project, which is actually useful IMHO. But, of course, an interactive REPL connection won’t be established.
It is tempting to think of -r
in this usage as short for “run” and of these two lines displayed
Serving HTTP on localhost port 9000
Listening for browser REPL connect ...
it tempting to simply omit the second if -O
is anything but none
.Yep I think I found a problem and I opened a Jira, I also wonder whether having the compiler options should behave as a -c
, having all the options in there that you need...or maybe allow an empty -c
when -co
is there
Probably the latter is better, if -cf
contains a :main
it should be used
Just so that I understand better, no empty -c
for now but yes :main
in -cf
option?
The whitespace and negative space in the default index.html
were really bothering me so I've added a patch to https://dev.clojure.org/jira/browse/CLJS-2584 that tweaks things in a way that look much better to me personally. Here is what the patch would do. Left is before, right is after.
The result is somewhat responsive, placing a max width on the paragraphs, and centering, etc.
@bhauman Thanks. I think it is important—it is perhaps one of the first impressions new users might have of ClojureScript.
@bhauman Yeah. My only feeling at this point is perhaps more succinctness, while still trying to clearly convey what is important.
I didn’t. Feel free to try that variation. It might look better. If done, I wonder if the logo might need to be a tad bit smaller to then give the textual content more “weight”.
What you just said reminds me roughly of http://cljsrn.org
Hmm. Does this look like a code-gen error, where we need some extra parens in the generated JavaScript?
cljs.user=> ((or int? string?) 1)
#object[cljs$core$int_QMARK_]
The JavaScript generated is
(cljs.core.int_QMARK_) || (cljs.core.string_QMARK_).call(null,(1))
Rare to see one of these ^ https://dev.clojure.org/jira/browse/CLJS-2585
@bhauman I think you are right. And making the logo smaller seems to be the right thing to do.
Cool, put a 3rd patch in https://dev.clojure.org/jira/browse/CLJS-2584 that does that.
OK now that I see this, the body should probably have a white background with black text 😉 and endless tweaks from there
Feel free to take my patch in https://dev.clojure.org/jira/browse/CLJS-2584 and produce a revision. My HTML skills are not that strong.
I suppose things would end up looking a bit more like https://clojurescript.org
yes, and then of course we could have a like to some appropriate docs for first time REPL users.
trying to release figwheel and rebel this morning for the last day of the first month of clojurists together
Cool. I assigned https://dev.clojure.org/jira/browse/CLJS-2584 your way so David doesn’t accidentally apply it prior to tweaks.
@richiardiandrea https://dev.clojure.org/jira/browse/CLJS-2582 do not include random commands, only stuff that can be repeated w/o whatever setup you have, thanks 🙂
kk, I thought you wanted to know only the command not a full repro
will do that
no thank you!
from my local experiments the map is merged correctly, it seems something else is off in cljs.repl.node
with the form (do (.require js/goog "cljs.core") (enable-console-print!))
. Haven't gotten deeper yet.
white bg, black text, code/pre now http://cljs.org blue
wow http://cljs.org that's an actual website
Yeah, I was testing something and was distracted by its beauty and forgot what I was doing.
There's a bit of repetitive verbiage that we can probably eliminate surrounding "your own HTML file" and "providing your own index.html
". Perhaps we can somehow improve the copy without a bunch of patches (via gist, or somesuch?)
No rush... I think getting the copy right takes walking away from it to actually see the awkward bits.
@mfikes I think the cljs.main
stuff probably deserves a tour blog post which shows all the neat things you can do - if you’re interested in writing one that would be cool
For the index page, how about something like this? It answers a question I had when reading the current copy:
Welcome to the ClojureScript Browser REPL.
This page provides the evaluation environment for the Browser REPL and your application.
You can validate the connection by typing (js/alert "Hello CLJS!") into the ClojureScript REPL that launched this page. When everything works correctly, you will see a popup in this window.
Use your own start page by creating an index.html file in the directory that you launched this REPL from. After you create or save changes to this file, Reload Page in the browser to see the new version. Begin with this template to get a blank page:
[should the template have a <h1>index.html</h1> instead of being blank?]
For more examples, see our <a>ClojureScript Browser REPL tour</a>.
Thanks for the feedback! It sounds like @bhauman and I have an interest in revising the copy, and we'll take a look at your input as well.
Interesting thought: If there were some way to avoid the absolute need for a disk-based "out"
(effectively compiling to memory, a lot like self-hosted), some of the cljs.main
use cases (like "run this script", or "evaluate this form") could benefit a little by not needing the file system. I think we are far away from being able to support something like that, but it is an interesting thought nonetheless.