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

Modularize project to minimize unnecessary transitive dependencies #19

Closed
feature opened this issue Feb 21, 2019 · 8 comments
Closed

Modularize project to minimize unnecessary transitive dependencies #19

feature opened this issue Feb 21, 2019 · 8 comments

Comments

@feature
Copy link

feature commented Feb 21, 2019

I currently think the amount of supported formats and dependencies is excessive for most projects. I think we should move the JSON, XML, YAML, HOCON, and TOML providers into separate modules, and let users opt-in to use these different providers. Furthermore I also think it would be a good idea to move the functionality for loading from git repositories into a different module. The primary motivation for this is to reduced amount of dependencies on the core library.

What I propose is to have 7 different modules in total;

  • konf-core
  • konf-json
  • konf-xml
  • konf-yaml
  • konf-hocon
  • konf-toml
  • konf-jgit

I've forked the project and started making progress on this in a separate branch. I intend the API to stay mostly unchanged, however it's necessary to remove some fields and replace them with extension properties (DefaultLoaders specifically). The README and documentation must be updated to reflect these few changes, and add that you must manually add providers as a dependency, and register them to the Provider companion object.

@char
Copy link

char commented Feb 22, 2019

If there are formats that you aren't using, have you tried doing anything like:

implementation(myKonfDependency) {
  exclude(module = "org.eclipse.jgit")
}

Does this result in Konf failing outright or just throwing an exception whenever the end-user tries to interface with JGit?

@uchuhimo
Copy link
Owner

@feature I agree with your proposal. I'm sorry that I don't have enough time to do such a large project refactor in these two weeks. Your pull request is welcome if you finish this refactor in your branch.

@feature
Copy link
Author

feature commented Feb 22, 2019

@half-cambodian-hacker-man
I was considering simply just doing that, however it's not a very nice approach and it creates pitfalls in the library that would most likely crash the application, if you happen to trigger any of them by accident.

@uchuhimo
I expect to be able to get it done within a few days. Jackson seems to be used throughout multiple parts of the library, so I'm not yet sure if I can extract that into a different module or not, regardless if I it is not possible, keeping it as a dependency in the core module is a reasonable compromise to me. When I'm done modularizing the project, I'd appreciate some help to ascertain that the all the build configurations are correct, and that the documentation is up-to-date. I'll make sure to try to attach a comprehensive checklist to my PR.

@uchuhimo
Copy link
Owner

@feature Jackson is used in mapping between config items and fields in classes, so it is a necessary dependency in the core module. I think we will finally have 6 different modules in total (except konf-json, it will be part of konf-core).

@stale
Copy link

stale bot commented Jun 27, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.

@stale stale bot added the stale label Jun 27, 2019
@stale stale bot closed this as completed Jul 27, 2019
@uchuhimo uchuhimo reopened this Aug 12, 2019
@stale stale bot removed the stale label Aug 12, 2019
@pie-flavor
Copy link

what's the status on this? I too want this feature.

@feature
Copy link
Author

feature commented Aug 19, 2019

I made a pull request for this issue. All the modularization is done, I just need to update the documentation, and tests. I'm a busy at the time, so any help on the PR would be appreciated.

#23

@uchuhimo
Copy link
Owner

@pie-flavor @feature I release a new version v0.15, which contains the modularization feature. Documents and tests have also been updated. You can give it a try.

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

No branches or pull requests

4 participants