This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-02
Channels
- # announcements (14)
- # beginners (133)
- # cider (27)
- # cljs-dev (7)
- # cljsjs (13)
- # clojure (105)
- # clojure-dev (58)
- # clojure-italy (1)
- # clojure-nl (17)
- # clojure-russia (33)
- # clojure-spec (5)
- # clojure-uk (154)
- # clojured (1)
- # clojurescript (35)
- # cloverage (4)
- # cursive (35)
- # datomic (58)
- # duct (8)
- # editors (9)
- # emacs (15)
- # events (1)
- # figwheel (47)
- # figwheel-main (132)
- # hyperfiddle (5)
- # immutant (29)
- # instaparse (21)
- # luminus (3)
- # off-topic (5)
- # onyx (5)
- # overtone (5)
- # pedestal (8)
- # re-frame (7)
- # reagent (6)
- # reitit (3)
- # schema (2)
- # shadow-cljs (178)
- # spacemacs (49)
- # specter (2)
- # sql (1)
- # tools-deps (110)
i've successfully put together a clojure cli based figwheel.main
environment here:
https://github.com/enumatech/cljs-abi-viewer/tree/dex
i was also going thru all the cljs repl solutions via this article:
https://lambdaisland.com/guides/clojure-repls/clojurescript-repls
but it's still unclear how can i have a cljs.repl
over an nREPL connection to the figwheel.main
environment using a deps.edn
setup, so I can send forms to it from Cursive.
is there an example project for such a setup somewhere?
@onetom you have to start it from within an nREPL session, with (figwheel.main/start "dev")
also have you seen this guide https://clojurescript.org/guides/webpack to help you with cycle.js
no, i haven't looked into the webpack setup, but it sounds a bit insane. one of the main reasons we are trying to get away from javascript is to simplify our builds and the depth of the required toolchain
if you are inside nREPL you will need to have an nREPL server with piggieback in its middleware
I'm not sure what cursive is providing in terms of Clojure tools support, I don't know if its injecting nREPL or piggieback or what not
we just built the https://gitlab.com/oax/dex-poc project over the last half year and as an experiment we tried to build it with the least amount of tooling
so it has no bundler. the frontend code is fully ES6 modules, which the browser can understand natively and nodejs can load it with the help of the very small esm
library and run tests against them on nodejs with mocha.
i've actually prepared a blog article about this experiment but it's still in a draft form. my conclusion was to look into the state of clojurescript, because it's madness where the js world is heading to...
I recently did a tiny project just using the Google Closure API, it was so refreshing
so i was expecting to get away from this whole module misery, hoping that the new closure compiler module support will obviate the need for webpack, browserify, rollup, asbundle, etc bullshit
as i understood so far, the main issue is that there are no clear standards for packaging something into an npm module and then there is still a divide between code for the browser and code for nodejs...
oh, actually i've already open sourced an example repo for my above mentioned article and its readme is practically covering the article, just using a different story flow: https://github.com/enumatech/browser-nodejs-es6
yes, cursive repl! if i could make it work, it would seriously raise the chance of adoption in our company it already works from emacs actually, but only one out of 5 people in this specific project are well versed enough in emacs so far
cider-jack-in-cljs
has a figwheel.main
option specifically and it just works after we guessed that we need piggyback 🙂
but if you have to you can start your own nREPL server with piggieback middleware installed
i would just still start my app from the terminal (within intellij) and use cursive's "built-in" nREPL client if possible
so we can model my desired setup as 2 processes:
1. clojure -A:dev
2. lein repl :connect
in this case dev would have to start the nrepl server https://github.com/clojure/tools.nrepl
i see a fresh open ticket on the topic: https://github.com/nrepl/piggieback/issues/91
Sorry for barging in but Bohzidar also added the following nrepl.cmdline
, if it can help - https://nrepl.readthedocs.io/en/latest/usage/
nrepl/piggieback
is the 2nd result in my piggieback clojure cli
search indeed.
who is behind that nrepl
github org?
@richiardiandrea ah, i guess u just answered my question
The nRepl project was transferred to the cider/clojure-mode community.. 👍
From contrib -- a couple of months ago iirc
@richiardiandrea what do u mean by the cider/clojure-mode
community?
I mean, the same people working on the most of the Clojure tooling, Bruce here included :)
Before it was a Clojure contrib project
Some more history here: https://nrepl.readthedocs.io/en/latest/installation/
@richiardiandrea is refering to the new one thats not supported by figwheel.main yet
Bohzidar as usual did a great job with the doc ;)
@richiardiandrea solution is a great solution I just have to fix figwheel.main first
aaah. im starting to see clearer now.
but wondering where would one learn about for example this org.clojure/tools.nrepl
-> nrepl
transition?
It was announced some time ago in places. Cider does the bootstrapping with the right deps already so you don't really need to know which dep. Manual REPL is still considered an art 😃
btw, i read somewhere recently that there is some way to support your work, @bhauman how and where can i send funds? can you handle ETH for example? that would be the quickest and easiest way for me to support you
im planning to use devcards
too, but maybe with hoplon or just with my own, simple, direct DOM tooling you can see in my above mentioned project:
https://github.com/enumatech/cljs-abi-viewer/blob/dex/src/cljs/dom.cljs
btw, what's the story behind https://github.com/clojure/clojurescript/blob/master/src/main/cljs/clojure/browser/dom.cljs i see it's a work of @dnolen @mfikes i just found it after i typed up my own js DOM wrappers... is it something we can expect to be maintained and documented?
i saw there are some tests for it but i couldn't even figure out quickly how to run them
im just worried that it might get removed, because without docs and more thorough tests probably not many project would depend on it
oh, i just saw your names on https://github.com/clojure/clojurescript/commits/master/src/main/cljs/clojure/browser/dom.cljs
the "better stuff" is usually a lot more complex too, that's why im looking for some low-key, readily available tooling, which can serve as a gateway drug for ppl who stuck in jquery times (because they gave up on frontend development after wrangling with jquery :)
I've deployed com.bhauman/figwheel.main
0.1.5-SNAPSHOT
with fixes for the new nREPL
my figwheel-main seems stuck in some sort of cached state - I have removed target/public and simplified my server to bascially your config ⋊> ~/D/c/re-frame-figwheel-deps clojure -m figwheel.main -b dev -r [Figwheel] Validating figwheel-main.edn [Figwheel] figwheel-main.edn is valid! Unable to find :ring-handler ~/D/c/re-frame-figwheel-deps tree target target 0 directories, 0 files
ok removing :ring-handler config-manager.server/handler form figwheel-main.edn fixed loading - doesnt seem like that option there
so still compile error om server.clj and your basic config except for the http://java.io require
(ns config-manager.server
(:require [ :as io]
))
;; define index content
(def home
"<!DOCTYPE html>
<html>
<head>
<meta charset=\"UTF-8\">
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
<link href=\"css/style.css\" rel=\"stylesheet\" type=\"text/css\">
<link rel=\"icon\" href=\"">
</head>
<body>
<div id=\"app\"></div>
<script src=\"/cljs-out/dev-main.js\" type=\"text/javascript\"></script>
</body>
</html>")
(defn handler [request]
(if (and (= :get (:method request))
(= "/" (:uri request)))
{:status 200
:headers {"Content-Type" "text/html"}
:body home}}
{:status 404
:headers {"Content-Type" "text/plain"}
:body "Not Found"})
yeah my emacs paredit config doesnt seem to pick that up that it matches with diff bracket types - thats my biggest issue with clojure bracket matching
this is more interesting
cljs.user=> (require 'config-manager.server)
Could not Analyze: No such namespace: config-manager.server, could not locate config_manager/server.cljs, config_manager/server.cljc, or JavaScript source providing "config-manager.server" (Please check that namespaces with dashes use underscores in the ClojureScript file name) at line 1 <cljs repl> <cljs repl> line:1 column:1
not sure I understand.
clj -R:dev -A:fig -b dev -r 08:34:55
[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid!
Unable to find :ring-handler
clj -R:dev -A:fig 08:35:39
[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid!
[Figwheel] Compiling build figwheel-default-repl-build to "target/public/cljs-out/figwheel-default-repl-build-main.js"
cljs.user=> (load "config_manager/server")
Compile Exception:
ok so the compile exception is becaue i have http://java.io in my clj loading form cljs repl and I have to set non root pths in my server.clj is what you are saying - sorry still waking up
ok whats the fix as I am back at Unable to find :ring-handler and my server.clj compiles ok
got to get to work, would like to know how to setup figwheel like https://github.com/bensu/doo/wiki/End-to-end-testing-example - not sure if figwheel already has cors middleware loaded?
Bruce, just curious about your thoughts on having a Clojure noob try implementing nREPL support in rebel-readline?