Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Building enterprise-level apps with Ionic #845
I'm not sure whether this is a good place to bring this up, but I wouldn't know where else is a good place. So if this belongs somewhere else, please let me know.
I'm the initiator and maintainer of Generator-M-Ionic. It's the result of more than 2.5 years of experience of me and my colleagues with building enterprise-scale apps with Angular 1 and Ionic/Cordova for the company I work at. As you can see we've been developing with Ionic since the beginnings and we're big fans <3 Thank you very much. It's a lot of fun :)
So why am I creating this issue?
I'm trying to address some issues we have with the Ionic CLI when it comes to building larger and more complex apps.
We started developing this generator because the Ionic CLI's scaffolding (e.g the sample apps) were and still are missing a lot of features that are important to us. Especially code quality options and various workflows that we needed when building our apps in CI/CD environment. In case you are interested here is a gist with the most important features I compiled for a different discussion.
Initially we built the generator for ourselves but more and more a community gathered around it, which has the same issues with the Ionic CLI, cherishes the generator's enterprise-level features and brings valuable input to the continued development. It now provides a very broad list of features and neat tools that help to develop Ionic apps quicker and better.
For a long time it was just possible to get the most out of Ionic without the use of the Ionic CLI. And I saw the CLI just as a more simple project setup tool than our generator. So for beginners it would be easy to get started using the CLI and if you want to get more advanced features you could just switch to our generator.
Recently, some of our users brought up that our generator doesn't work with new Ionic Platform features (e.g. mwaylabs/generator-m-ionic#322). That's no surprise. It was never built for that. However, we do realise that it would be very convenient to not have to choose between the generator's scaffolding, testing and CI workflows and everything else it delivers AND using the Ionic Platform features of the CLI.
Separation of concerns
This is where I'm at now. And I want to open a dialog/discussion and get your opinion. Here are some of the issues I want to address, which are the reason I initiated the generator in the first place and are causing problems for the integration. I would like to know how you'll handle this in the future and how this will play out in Ionic 2. Because we want to get on board of Ionic 2 as well and right now we're feeling like we need to write a new generator ourselves.
If you address those I think it could greatly help boosting the tooling ecosystem for Ionic.
There's a similar discussion with the guys from the angular-cli angular/angular-cli#49 and I also made a fairly long comment about the whole framework-cli approach, just in case you are interested.
I'm not 100% sure where I want to go with this, all I'm seeing there's a lot of different things going on and innovation is scattering. Instead I would love to see it converge and I would very much like to help in doing so.
This topic is a bit large, but let me drop in a more technical insight about code generation.
Yeoman generators can easily be wrapped in any cli tool using our integration capacities.
Your cli could easily continue provide scaffolding transparently through the cli (users don't need to know it's running Yeoman) while providing an extensible generator for people who wish to expand the functionalities of the base project.
@gruppjo thanks for the issue and sorry for the late reply! I don't want to let this sit for any longer without answering, but there's a lot to address here and I haven't had the time to write out a proper response yet. I'm hoping to outline my thoughts on the CLI and its future direction this week, so please ping me if you haven't heard from me in a few days!
I originally wrote out a pretty lengthy response of the various issues surrounding the Ionic CLI, but you seem to understand the issues at hand as well as I do, so I think it comes down to this:
The Ionic CLI was meant to be a lightweight tool for getting up and running with Ionic quickly and easily.
But with the arrival of Ionic/Angular 2 there is now a mandatory build step, which adds complexity to the whole getting started quickly and easily thing.
It was decided by Ionic as an organization that the CLI should be responsible for starting Ionic 2 apps, which means the CLI is at least partly responsible for deciding how the build works. However, the CLI was never meant to be a build tool, just a small utility. So we added support for a default build using Gulp which will “just work” for new users. Gulp is well known by many Ionic 1 users, has a lot of existing documentation and is relatively flexible.
Now that Ionic 2 apps are not necessarily Cordova apps, is it still prudent for us to wrap Cordova? I agree with you that a lot of the “magic” we do is a false economy, because there is a large time cost when things go wrong and users don’t understand what is going on under the hood.
The 2.0 release of the CLI will see us pare down/deprecate a lot of existing commands in an effort to make sure that the features we do support work really well. If you have issues using the platform commands with projects not started by the CLI please open an issue, because this should be supported. We are still deciding if removing Cordova is something we want to do, since we don’t have a good story for things like livereloading on the device yet, but it is something I personally would like to see happen.
So I think for building enterprise-level apps you’ll have two options going forward: Start your app with a generator that sets up all the features you want, or use the Angular CLI with an Ionic addon, once addons are supported. This may change if we decided going forward that the Ionic CLI should assume more responsibility (for things like scaffolding/generation, testing, CI, etc.).
That's really good to know. I was worried that the Ionic CLI and our Generator were eventually trying to provide the same functionality just with different foci. That way it feels much more like a different mission that deserves two different tools.
WONDERFUL! I'm more than willing to make contributions in Code/PRs/Discussions if it turns out to be necessary. Actually this is one of very next things that I'm trying to get to work with the generator soon. Expect updates!
Two more questions:
In the future it is certainly possible that the Ionic CLI will assume more responsibility, but my goal right now for the 2.0 release is to work on some of the maintainability issues we have with the codebase and make it easier to contribute. One of the things I'm working on this week is changelog generation, which should make it easier to stay up to date with things like breaking changes. At the moment we don't have a good place to stay on top of CLI changes, but improving this is my focus for the next two weeks with better tooling in the repo (linting, automatic releases, CI, changelog generation) and better documentation on the framework site.
Another area that needs some love is issues, which is where discussions like this should be taking place. So two things I will be trying to do a better job of going forward is triaging issues and also opening up the discussion regarding changes to the CLI with relevant issues.
Also I just want to say thanks for your interest, feedback and general positive tone, it's much appreciated!
Regarding blog contributions, shoot me an email at tim [at] ionic.io and I can put you in touch with the proper people to ask about it :)
@tlancina. Thanks for pointing towards that repo and issue. That seems like a good place to turn to.
Regarding your ambitions for the next weeks and beyond that. Good luck! I'm very interested to see where you are taking things :)
Thank you! Very welcome. And I'd like to throw that right back at you :) You've been very helpful and I like that kind of constructive dialogue!
I would like to leave this issue open, if that's ok for you? That way we (and possibly other) can come back here for future discussions and pick up where we left off.
referenced this issue
Sep 2, 2016
This issue has been automatically closed because it had the
If this issue is still a problem in CLI v3, please create a new issue. Thank you!