Unrepl / unravel

Unravel your REPL
171 stars 6 forks source link

Bundle AND/OR Vendor compliment with Unravel #64

Open SevereOverfl0w opened 6 years ago

SevereOverfl0w commented 6 years ago

As unrepl supports out-of-band classpath loading, it would be awesome if unravel responded to requests for compliment.core.

It would be even better if unravel used it's own vendored version of compliment (at unravel_${unravel_version}.compliment.XXX) for preventing conflicts with either other clients (multiple unravel versions might hit the same server) and the project (I might offer RPC form of compliment, because, reasons…)

https://github.com/benedekfazekas/mranderson is particularly relevant to this.

arichiardi commented 6 years ago

About this, I was successfully able to pack compliment using https://github.com/boot-clj/boot-sources, and I have a task that does that + topo order.

I am not sure this is still relevant because of the new sideloading thingie but I would "only" need to add the versioning to the namespace for preventing conflicts and it should be ready to go.

pesterhazy commented 6 years ago

This works for me in master now:

unravel --method clojure --flag compliment --classpath ~/.m2/repository/compliment/compliment/0.3.5/compliment-0.3.5.jar

Next step: bundling

arichiardi commented 6 years ago

@pesterhazy are you planning to use mranderson? I am still thinking boot has an edge for this kind of things, more flexibility and stuff. Let me know if you want me to modify this gist. In there I am creating the whole blob, probably at this point I would need to just copy the sources and change the namespaces, maybe copying some part of mranderson.

arichiardi commented 6 years ago

Actually this needs to happen at runtime right?

pesterhazy commented 6 years ago

I think it can happen at build time. Unravel (or other unrepl clients) ship with their "shaded" or "vendored" version of compliment. If you connect to the same repl using the same unravel version, you'll end up reusing the same NS, but that should be fine.

arichiardi commented 6 years ago

I was more thinking about this use case: "Please side load this library for me", but maybe I am overengineering this.

pesterhazy commented 6 years ago

If you're sideloading your own library, you don't need to shade it, no? Or what would be the use case?

pesterhazy commented 6 years ago

Thanks for the gist. I'm not sure how it would be used. Could you add instructions on how to shade/vendorize compliment?

arichiardi commented 6 years ago

There is an example at the bottom but again...that builds the entire blob so I need to change it.

Boot-sources downloads the :deps and saves them in the :to-dir.

volrath commented 6 years ago

If you're sideloading your own library, you don't need to shade it, no? Or what would be the use case?

Even with sideloading, we still need shading. Without it, you might end up with classpath conflicts if you don't shade. i.e. You sideload unravel's version of compliment "X.X.X" and the user wants to use compliment "Y.Y.Y"

@arichiardi for the record, I would like to do shading with boot instead of leiningen in SPIRAL, even though I don't have a really good reason for it except that I like boot better 😄

pesterhazy commented 6 years ago

@volrath yeah I agree that sideloading and shading are complimentary (pun intended!)

My point was just when you're sideloading your own code, i.e. not something that ships with unravel/spiral, shading may not be as important.

volrath commented 6 years ago

@pesterhazy ah! got it, right!

arichiardi commented 6 years ago

I'll modify the gist and contribute it here ok? Let me take a crack at this.

pesterhazy commented 6 years ago

@arichiardi great!

cgrand commented 6 years ago

I would even say that implicit shading of user code is a bad idea.