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

Split library into scala-uri-core and scala-uri-cats #426

Open
jdrphillips opened this issue Feb 25, 2022 · 4 comments
Open

Split library into scala-uri-core and scala-uri-cats #426

jdrphillips opened this issue Feb 25, 2022 · 4 comments
Assignees

Comments

@jdrphillips
Copy link

Description

I would like the library split into two - one for the core functionality and one for the cats instances.

I cannot upgrade to scala-uri:4.0.0 due to the inclusion of cats:2.7.0 which at the moment is incompatible with my project. It seems the inclusion of a URI library in your project should be orthogonal to the inclusion of Future applicative instances from cats, for example.

@jdrphillips
Copy link
Author

Just FYI I can choose to exclude the transitive dependency, and as long as I don't use any scala-uri cats functionality it should work

@theon
Copy link
Member

theon commented Feb 26, 2022

Thanks for raising this. Agree that it makes sense to put the cats instances in a separate library that users can optionally add to their project.

What makes this a little more complicated is, since 4.0.0 scala-uri uses cats-parse to perform the URL parsing itself, so has a transitive dependency on cats.

We moved from parboiled2 to cats-parse in order to support scala3. At the time I didn't think parboiled2 was going to get published for scala3 (although thanks to some great work from the community over there it actually looks like it did 2 days ago).

So moving forward I'm thinking the options are:

  • Stick with cats-parse, but make the internal URL parser usage of cats use a shaded version of cats-parse/cats to remove any classpath clash (note: the separate scala-uri-cats library would need to have a regular non-shaded cats dependency)
  • Move back to parboiled2?

I'm not sure at the moment and need to spend some time weighing up the options, but if anyone has any opinions feel free to post here!

@jdrphillips
Copy link
Author

That makes sense. Using cats-parse makes sense too if it does what you need. If it's possible to shade the cats dependency that would be great. That would decouple you from the upgrade chain in client projects, and allow people to upgrade you and cats independently when required.

I'm not sure how much of a pain that would be.

@carlos-verdes
Copy link

I'm using this library with ZIO so removing cats dependency has a lot of sense for me

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

3 participants