lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
johnjelinek 2017-10-21T05:37:43.000019Z

what's the right way to connect to the lumo REPL with VS Code?

johnjelinek 2017-10-21T05:38:11.000047Z

I tried a plugin with the Connect to existing nREPL feature, but it couldn't establish a connection with lumo

johnjelinek 2017-10-21T06:04:32.000005Z

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})

johnjelinek 2017-10-21T06:04:44.000036Z

☝️ build.clj

johnjelinek 2017-10-21T06:05:08.000012Z

src/hello_world/core.cljs:

(ns hello-world.core)

(enable-console-print!)

(println "Hello world!")

johnjelinek 2017-10-21T06:05:38.000040Z

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.&lt;anonymous&gt; ([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)

johnjelinek 2017-10-21T06:06:11.000008Z

I'm running 1.8.0-beta

richiardiandrea 2017-10-21T15:55:13.000090Z

@johnjelinek lumo does not currently have nRepl implementations, you can connect to it via TCP socket

futuro 2017-10-26T15:00:27.000117Z

I use inf-clojure with emacs, but any Socket REPL connector should would (lumo implements a plain socket server)

richiardiandrea 2017-10-26T15:41:29.000226Z

Yeah inf-clojure is my choice as well

johnjelinek 2017-10-21T19:02:59.000107Z

is there documentation on how to connect via TCP socket -- or maybe how plugins in VS Code could connect over TCP?

johnjelinek 2017-10-21T19:21:22.000029Z

is there a guide to help fall into the pit of success of using lumo?

johnjelinek 2017-10-21T19:41:07.000078Z

for example: as I scaffold out my new project, I want to take advantage of cucumber-js so I can write BDD features/specs

johnjelinek 2017-10-21T21:22:19.000033Z

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

richiardiandrea 2017-10-21T21:55:04.000053Z

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=&gt; 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.

richiardiandrea 2017-10-21T21:57:02.000001Z

@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)

1👍
johnjelinek 2017-10-21T21:57:57.000073Z

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

johnjelinek 2017-10-21T21:58:47.000002Z

LSP would be awesome!

johnjelinek 2017-10-21T22:00:09.000021Z

cool, I just accessed lumo with telnet -- but the exit commands don't seem to work ^D

richiardiandrea 2017-10-21T23:14:52.000021Z

you can us nc localhost port, less ancient 🙂