-
Notifications
You must be signed in to change notification settings - Fork 58
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
[meta] Integrate hoa/console #8
Comments
Any news? |
Not yet, busy with Puli atm :( |
@webmozart Actually, I can help, but I just would like to know what you would like to do or not. Maybe the Symfony bridge to |
Hi @Hywan! :) Late but finally some feedback. I could look a bit at Hoa\Console today and found two major concerns when it comes to an integration into Webmozart\Console. Hoa\Console seems very tightly coupled and doesn't make a lot of use of dependency injection. For example, most classes there access the global input by calling This pattern (accessing dependencies through static calls) flows through the library. We could fix it by injecting dependencies everywhere (instead of accessing them globally), but this would be very big break for your library and probably not one that you want to make. A second "problem" (it's not a big deal for me, but for users of Webmozart\Console, hence the quotes) is the number of dependencies. The library itself has a fixed dependency on the following packages:
Now many of those seem useful, but I would prefer not to need some of them. For example, I don't see a big benefit in hoa/exception, hoa/protocol and hoa/event.
Having said all that, I think the library is great and contains great features! A bit more openness (as in the SOLID principles) would be needed to integrate it nicely though. |
Hello @webmozart! I know that Hope I am not mistaken, but the Would it be OK this way for the first issue? Next, the dependencies. Hoa libraries have small dependencies and they are all re-used. For instance I understand
So, yes, I wonder if we can prune some dependencies with Composer. However, I don't see any library that could be pruned. If I sum the files that are going to be loaded and to run, we have… (do some additions): 3 from Let me think if we could reduce the number of dependencies but this is not going to be easy. |
It's not necessarily about the number of classes, it's about the size of the dependency tree. Each additional package is a package I have to keep track of for updates (ie security). Also, each additional package is one that could potentially conflict with something else I may want to install. For example, one package may depend on one version of a package, and another package may depend on a different version of the same package, or one of its dependencies, or something like that. Also, a specific note: it appears that you have a circular dependency between It's also difficult for me to see the point of packages like All of these components that I, as a developer using PHP 7.0, see no real need for, and would therefore generally avoid any package that would bring these in as dependencies. |
Even if There's are crucial tools for improve quality and stability of others libraries. About the versions package dependence and upgrade, there's are not conflict with our Rush Release Versioning We had troubles couples months ago with BC related to From my personal opinion, each Hoa Library must be focus on the purpose of what she`s build for. In the past, we had |
Also, I obviously wasn't explicit enough about my point regarding |
I think this issue is not about natively integrating hoa Console in webmozart Console but to provide a bridge between them. Am I wrong? |
@tgalopin The initial idea here was indeed to use hoa/console as foundation for this package |
Okay. Then I agree with @djmattyg007 on the optionnal part: even if the hoa libraries as lightweight, I think most of the users won't need the low-level features they provide. I think the best way to achieve a full integration (not just a bridge) is to create an extended version of webmozart/console (you could say a different, more advanced "distrbution"). |
@djmattyg007 maybe you don't want play with low level functionality, but If you consider |
Perhaps you should reflect on the idea that a developer probably isn't going to choose |
I think we should calm down a little bit :-). @djmattyg007 There is no organisational issue or something else. Good catch for I tend to agree with @Pierozi when he is saying that if most of the libraries were embedded inside Hoa can greatly benefit of your constraints and your code analysis. Thank you for this. We are not foolproof at all (e.g. with Since several days, I am reading the code tracking if a dependency or two could be removed or not. So far, each one is required for good reasons, but I am continuing this work. I am wrong if I say that only |
Hello :-),
This is more a meta issue in order to discuss about your wishes to integrate
Hoa\Console
inside this awesome project (cf. your initial tweet and the tweet about opening an issue).Recapitulare
Hoa\Console
is more a low-level API for the terminal. First of all, every API is based ontput
(aka terminal info' or terminal capabitilies). This makes everything much more compatible with the plenty of terminals we have in the wild (see Control the terminal, the right way). Based on that, we —at Hoa— have designed an API for the cursor (Hoa\Console\Cursor
), the window (Hoa\Console\Window
) and the mouse (Hoa\Console\Mouse
). And based on that, we have designed a powerful readline (Hoa\Console\Readline
), with, of course, autocompleters. Example:Apart from that, we have also designed an option parser and reader (resp.
Hoa\Console\Parser
andHoa\Console\GetOption
). They are “standalone” classes. To make it works easier with the rest of the environment, we provideHoa\Router\Cli
as another class of another library. AndHoa\Console\Dispatcher\Kit
withHoa\Dispatcher
(another library) ease the development of complete commands (as defined by your project).Hoa\Router
andHoa\Dispatcher
are totally optional, this must be clear.Finally, there is also processus control with
Hoa\Console\Processus
: Allowing to interactivly communicate with a processus (->on('output')
,->on('input')
etc.).The documentation of
Hoa\Console
can be found on Hoa's website: http://hoa-project.net/Literature/Hack/Console.html.Needs and wishes
Now, we are ready to collaborate to integrate
Hoa\Console
insidewebmozart/console
because we think this project provides a very nice high-level API. This kind of API is missing in Hoa since this is out of our goal and it can “hurt” users in some particular cases. I personally think we have a big opportunity to make a great tool here!The only question I have is: What are your needs and wishes?
/cc @hoaproject/hoackers and especially @jubianchi who did write the Symfony bridge to
Hoa\Console
with the bundle. Maybe these projects can be re-used.The text was updated successfully, but these errors were encountered: