How Clojure (and ClojureScript) REPL connections work - feat the creator of Calva!

Поделиться
HTML-код
  • Опубликовано: 4 янв 2025

Комментарии • 17

  • @notjustsilicon
    @notjustsilicon 2 года назад +8

    This is a super useful walkthrough of the underlying system. Thank you very much! Based on the video, here is a summary of the steps that happen under the hood when cljs is evaluated with the help of nREPL:
    1. The user evaluates code in the editor.
    2. The code is delivered to nREPL.
    3. A middleware (shadow.cljs.devtools.server.nrepl/middleware or cider.piggieback/wrap-cljs-repl if using Figwheel) grabs the code and rather than sending it to Clojure for compilation and evaluation it is sent to the...
    4. ClojureScript compiler, which instead emits JavaScript.
    5. The ShadowCLJS server (or Figwheel server), which has a web socket open to the browser runtime, receives this js and sends it to the browser.
    6. The evaluation is carried out by a runtime evaluator, which when appropriate modifies the state of the browser (application) and also sends the evaluation result back to the...
    7. server (ShadowCLJS or Figwheel), which forwards it to...
    8. nREPL through which finally the...
    9. editor REPL receives the evaluation result for the user to inspect.

  • @CalvaTV
    @CalvaTV 2 года назад +22

    At 0:20:40 I accuse VS Code of having a bug. Shame on me. It was actually Calva that had this bug. It is now fixed! Calva is back at zero bugs. Haha.

  • @designernasser
    @designernasser 2 года назад +9

    It's really great to see what goes on behind the scenes! Thank you both for this awesome video! 👍

  • @andresgomez4267
    @andresgomez4267 Год назад +1

    Great video, I have been struggling with running the repls of a deps.edn and shadow-cljs.edn project at the same time and this video not only gives several ways of fixing that problem, but it also gives a clear view into what happens behind the scenes. Thanks so much to the both of you for everything you do to make the clojure world accesible to new programmers.

  • @eopjohnson7466
    @eopjohnson7466 Год назад

    I liked all the questions on the internal plumbing and the brief real-world activities, like Tap, or the having to reloading the browser to allow shadow-cljs to connect. I also appreciated the clipping of the white space, to crank up the speed of the conversation. I have virtually no hands-on experience with Clojure but have read a book, and have a background in JavaScript and felt I was able to 900% follow along with what you were doing, with PEZ explanations and your intentional questions that were very much the same things I was wondering. 👍🏼

  • @andora5539
    @andora5539 2 года назад +3

    Awesome video guys! Thanks for uncovering Calva repl magic Peter, this helped me a ton in figuring out what goes behind the scenes. 🤘

  • @9to5Magic
    @9to5Magic Год назад +1

    Thanks so much for doing this. I've been trying to connect to the browser repl from Neovim using Conjure and just getting confused. The explanation of how nrepl connects to the various repls will hopefully help me to get it going.

  • @joshuaeichler-summers2173
    @joshuaeichler-summers2173 Год назад

    Great video by the way!
    Thanks for making it

  • @daryoushmehrtash7601
    @daryoushmehrtash7601 Год назад +1

    Very helpful. Thanks.

  • @MohammodnazmuSakiB
    @MohammodnazmuSakiB 2 года назад

    Why prefer shadow-cljs over deps.edn?

  • @unowpl
    @unowpl 2 года назад

    Great content

  • @johnharriott7878
    @johnharriott7878 2 года назад +1

    I found it difficult to follow along. Perhaps I need more lead in knowledge?

    • @onthecodeagain
      @onthecodeagain  2 года назад +2

      What parts were confusing? Maybe we can exapnd on them in later videos :)

    • @CalvaTV
      @CalvaTV 2 года назад

      I'm also curious about if there are another video we should make that gives more of the lead in knowledge. Please elaborate a bit on where you lost track on what we were doing/talking about.