In most cases, I do not like Javascript and prefer strict and compiled languages ββsuch as Scala, Java, Haskell ...
However, one thing that can be nice with Javascript is that it is easy to modify the code of external dependencies. For example, if you have a bug, and you think this is one of your dependency libraries, you can easily hack and change the library method with your own override and check if this is better. You can even add methods to Array ou String prototypes and the like ... You can even switch to node_modules and temporarily change the library code if you want.
In the JVM world, this seems like a hard process to get started:
- Clone Dependency Sources
- Hack it
- Compile it
- Post it to some maven / ivy local storage
- Integrate the fixed version into your project
This is a pain, I just do not want to do this more than once a year. Today I tried to fix a bug in my application, and lib did not provide me with enough information. I would just like to put Logger on one line of this library to better understand what is happening, but instead I tried to crack the debugger without success (the error was not reproduced on my computer anyway ...)
Is there a simple alternative to quickly change the dependency code?
I would be interested in any solution for Scala, Java, Clojure or any other JVM language.
I am not looking for a deployment solution, just a quick solution for local use and, ultimately, deployment on a test env.
Change I am talking about internal libraries that are not intended to be modified by the author of the library. Suppose the class to be modified is final, not replaceable by the configuration of the library, and not introduced in any way into the library.