what's the right way to connect to the lumo REPL with VS Code?
I tried a plugin with the Connect to existing nREPL
feature, but it couldn't establish a connection with lumo
why does lumo
fail to build for the browser with optimizations
?
(require 'lumo.build.api)
(lumo.build.api/build "src"
{:main 'hello-world.core
:output-to "out/main.js"
:optimizations :advanced})
☝️ build.clj
src/hello_world/core.cljs
:
(ns hello-world.core)
(enable-console-print!)
(println "Hello world!")
error:
WARNING: :preloads should only be specified with :none optimizations
^CScript execution interrupted.
ContextifyScript.Script.runInThisContext (vm.cljs:50:33)
Object.runInThisContext (vm.cljs:139:38)
(Object.ct)
(Object.lumo.repl.caching_node_eval)
(NO_SOURCE_FILE <embedded>:6124:273)
E (NO_SOURCE_FILE <embedded>:6125:269)
(NO_SOURCE_FILE <embedded>:6118:207)
(NO_SOURCE_FILE <embedded>:6016:190)
Object.cljs.js.load_macros (NO_SOURCE_FILE <embedded>:5989:199)
(NO_SOURCE_FILE <embedded>:6010:433)
Object.cljs.js.load_macros (NO_SOURCE_FILE <embedded>:5989:199)
(NO_SOURCE_FILE <embedded>:6008:316)
(NO_SOURCE_FILE <embedded>:6021:218)
Function.cljs.js.load_deps.cljs$core$IFn$_invoke$arity$7 (NO_SOURCE_FILE <embedded>:5965:474)
(NO_SOURCE_FILE <embedded>:5962:570)
(NO_SOURCE_FILE <embedded>:5948:318)
(Object.lumo.repl.run_sync_BANG_)
Object.cljs.js.process_deps (NO_SOURCE_FILE <embedded>:5924:185)
Object.cljs.js.process_libs_deps (NO_SOURCE_FILE <embedded>:5927:60)
(NO_SOURCE_FILE <embedded>:5945:474)
(Object.lumo.repl.run_sync_BANG_)
Object.cljs.js.process_deps (NO_SOURCE_FILE <embedded>:5924:185)
Object.cljs.js.process_macros_deps (NO_SOURCE_FILE <embedded>:5925:62)
(NO_SOURCE_FILE <embedded>:5945:198)
Object.lumo.repl.load_bundled (NO_SOURCE_FILE <embedded>:6454:141)
Object.lumo.repl.load_and_cb_BANG_ (NO_SOURCE_FILE <embedded>:6467:114)
Object.lumo.repl.load_other (NO_SOURCE_FILE <embedded>:6469:234)
lumo.repl.load (NO_SOURCE_FILE <embedded>:6473:96)
Function.cljs.js.require.cljs$core$IFn$_invoke$arity$5 (NO_SOURCE_FILE <embedded>:5951:77)
Function.cljs.js.load_deps.cljs$core$IFn$_invoke$arity$7 (NO_SOURCE_FILE <embedded>:5962:119)
Function.cljs.js.ns_side_effects.cljs$core$IFn$_invoke$arity$6 (NO_SOURCE_FILE <embedded>:6020:287)
E (NO_SOURCE_FILE <embedded>:6116:369)
Object.cljs.js.eval_str_STAR_ (NO_SOURCE_FILE <embedded>:6126:373)
Function.cljs.js.eval_str.cljs$core$IFn$_invoke$arity$5 (NO_SOURCE_FILE <embedded>:6129:508)
Object.lumo.repl.execute_text (NO_SOURCE_FILE <embedded>:6618:475)
Object.lumo.repl.execute_source (NO_SOURCE_FILE <embedded>:6624:370)
(NO_SOURCE_FILE <embedded>:6608:187)
Object.lumo.repl.load_external (NO_SOURCE_FILE <embedded>:6465:252)
Object.lumo.repl.load_and_cb_BANG_ (NO_SOURCE_FILE <embedded>:6467:223)
Object.lumo.repl.load_file_STAR_ (NO_SOURCE_FILE <embedded>:6470:123)
Object.lumo.repl.load (NO_SOURCE_FILE <embedded>:6472:154)
Object.lumo.repl.execute_path (NO_SOURCE_FILE <embedded>:6605:55)
Object.lumo.repl.execute_source (NO_SOURCE_FILE <embedded>:6624:342)
Object.lumo.repl.execute (NO_SOURCE_FILE <embedded>:6625:202)
yt ([eval]:1:30437)
Ct ([eval]:1:30965)
([eval]:161:82046)
Generator.next (NO_SOURCE_FILE <anonymous>)
r ([eval]:161:81101)
([eval]:161:81248)
Promise (NO_SOURCE_FILE <anonymous>)
([eval]:161:81045)
<http://qt.Writable.as|qt.Writable.as> ([eval]:161:82304)
([eval]:161:83025)
([eval]:161:83032)
([eval]:161:83036)
ContextifyScript.Script.runInThisContext (vm.cljs:50:33)
Object.runInThisContext (vm.cljs:139:38)
Object.<anonymous> ([eval]-wrapper:6:22)
Module._compile (module.cljs:624:30)
evalScript (bootstrap_node.cljs:467:27)
startup (bootstrap_node.cljs:169:9)
(bootstrap_node.cljs:613:3)
I'm running 1.8.0-beta
@johnjelinek lumo does not currently have nRepl implementations, you can connect to it via TCP socket
I use inf-clojure with emacs, but any Socket REPL connector should would (lumo implements a plain socket server)
Yeah inf-clojure
is my choice as well
is there documentation on how to connect via TCP socket -- or maybe how plugins in VS Code could connect over TCP?
is there a guide to help fall into the pit of success of using lumo
?
for example: as I scaffold out my new project, I want to take advantage of cucumber-js
so I can write BDD features/specs
what I'd like to do is write features
like this: https://github.com/cucumber/cucumber-js/blob/master/docs/nodejs_example.md and have lumo
execute a task builds the cljs
in the features
directory and then runs the cucumber
runner against the output
So lumo does not implement any protocol at the moment, the tcp socket is a simple endpoint where chars are flowing, so when you connect you will receive cljs.user=>
and you can send chars (forms) to evaluate. I am not familiar with VS code TCP connections, but I know it uses Language Server Protocol. I had in mind to implement the protocol in lumo but haven't got time to do that.
@johnjelinek I don't see any issue in using that, but have never tried (I probably will at some point at my team is using it for Typescript)
ya, conceptually, I don't see any issues with that -- but I'm too new to lumo
, so figuring out the right scaffolding is taking a long time
LSP would be awesome!
cool, I just accessed lumo
with telnet
-- but the exit commands don't seem to work ^D
you can us nc localhost port
, less ancient 🙂