nrepl icon indicating copy to clipboard operation
nrepl copied to clipboard

Injection over plain socket repl

Open cgrand opened this issue 7 years ago • 3 comments

Make it possible to upgrade a plain socket repl to a nREPL connection.

A socket repl is a UTF-8 (Is it even guaranteed ?) connection, so upgrading it to bencode is not possible if real binary payloads are in use; are they? In any case we would need a custom bencoder that knows the underlying stream is already UTF-8.

The edn transport (#60) would be an easier target.

Since nREPL has multiplexed input a different injection strategy can be used than with unrepl: we can basically just inject a sideloader (#97). That would spare us all the blob generation.

cgrand avatar Dec 12 '18 09:12 cgrand

So I started working on injection based on bencode. Work lives on this branch https://github.com/nrepl/nrepl/tree/injection

Right now the nrepl.upgrade namespace is a deps-free namespace that will be sent to the socket repl to upgrade it.

Currently it starts a pseudo-nrepl equipped only with a light version of the sideloader. Meanwhile it tries to eval (require 'XXX). This (require 'XXX) is a placeholder for real code to start nrepl.

cgrand avatar Jan 10 '19 17:01 cgrand

Fantastic! Looks very promising!

bbatsov avatar Jan 10 '19 18:01 bbatsov

@cgrand We need to wrap the sideloader PR before focusing completely on this one, right?

bbatsov avatar Mar 21 '19 07:03 bbatsov