Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement user land middleware #1529

Closed
1 task done
benjamin-asdf opened this issue Apr 6, 2023 · 5 comments
Closed
1 task done

Implement user land middleware #1529

benjamin-asdf opened this issue Apr 6, 2023 · 5 comments

Comments

@benjamin-asdf
Copy link

benjamin-asdf commented Apr 6, 2023

User land middleware

The reason we would like to have this is because it is a step towards cider middleware (and beyond) implementations on bb.

  • Defined in bb user sources
  • Additional --middleware arg to bb nrepl-server
  • Use middlware wrapper semantics, it gets wrappep by middleware->transducer internally.

I basically have the hard part working, loading a middleware in the sci context then passing that to the nrepl server as middleware.
What is left to do is adding the middleware arg to bb main, make examples and document.

Current Questions

  • I am trying to (sci/resolve sci-ctx middleware) where middleware is a symbol on the classpath (added via bb.edn, :local/root, -> deps.edn)
    but it doesn't resolve.
    (sci-ctx is the one we start early in the exec function)
@borkdude
Copy link
Collaborator

borkdude commented Apr 6, 2023

@benjamin-asdf you should probably use requiring-resolve instead since the namespace wasn't loaded yet, you could do this with (sci/eval-form sci-ctx (list 'requiring-resolve middleware))

benjamin-asdf added a commit to benjamin-asdf/babashka that referenced this issue Apr 7, 2023
@benjamin-asdf
Copy link
Author

image

@benjamin-asdf
Copy link
Author

I gave up https://faster-than-light-memes.xyz/meta-the-meta.html - just using a jvm repl for development is good.

@borkdude
Copy link
Collaborator

OK, let's just give up on this for now and recommend the JVM REPL for advanced REPL features. This also keeps the bb binary more lean and we don't have to port any cider middleware stuff. I might roll back the existing middleware commits in bb.nrepl as well to clean up the work that was half done in there.

@borkdude
Copy link
Collaborator

borkdude commented Jun 17, 2023

I think a nice (very optional, vacation-project-ish, super low priority) challenge might be to run the original nrepl completely in babashka, instead of having nrepl as a built-in:

bb -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"}}}' -m nrepl.cmdline --interactive --color

:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants