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

Building enterprise-level apps with Ionic #845

Closed
gruppjo opened this Issue Mar 15, 2016 · 8 comments

Comments

Projects
None yet
5 participants
@gruppjo

gruppjo commented Mar 15, 2016

Hi everybody,

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.

Background

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.

  • scaffolding
    • the CLI just downloads starter repos
    • generators are a far more powerful approach here, why don't you supply one and leave the scaffolding out of the CLI, like our generator does? Then me and other developers could just build on top of that instead of reinventing the wheel every time.
  • workflows
    • what's actually happening when I type ionic build ios? Why not deliver the workflows in a readable and extensible way, like for instance gulp files. I see the beta for Ionic 2 is already moving that way https://forum.ionicframework.com/t/attention-upcoming-ionic-2-starter-changes/45058
    • what about testing with karma and protractor
    • integration into Travis / Jenkins
    • injecting build variables like the build number into an app
    • applying different sets of icons and splash screens to different builds
    • injecting different environment configuration (dev/staging/prod) during a build
    • these an much more are already built into the generator, I could help get this into a separate project that the CLI and others can use
  • Cordova CLI
    • I understand that it's sexy and easier to start with, if everything's just ionic ... but I think you're not helping your users here, since you're effectively obscuring the fact that under the hood it's using the Cordova CLI. That way many people don't even learn about Cordova.
    • And what if I want to use the latest features of the Cordova CLI? Bummer... I even had to click through 3 dependency trees to find out which version of the CLI you're using, only to find out you're actually using your own fork. https://github.com/driftyco/cordova-lib. Which I really don't understand. Additionally it's quite heavily outdated: you're using cordova 5.1.10 and cordova 6 is out since January. http://cordova.apache.org/news/2016/01/28/tools-release.html
  • Ionic Platform features
    • I think that's the only part that should really be in the CLI since it's only thing that is specific to ionic. Everything else can done via npm packges, generators and the Cordova CLI. This would make it so much easier for everybody to understand what's actually happening, contribute and eventually build better apps.
    • configurability would be great, for instance if it was possible to write ionic deploy --path='app' instead of expecting everyone just to have their app built according to your starters.

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.

Conclusion

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.

@Ionitron Ionitron added v2 labels Mar 15, 2016

@gruppjo gruppjo referenced this issue Mar 15, 2016

Open

2016 Roadmap #1571

3 of 16 tasks complete
@SBoudrias

This comment has been minimized.

Show comment
Hide comment
@SBoudrias

SBoudrias Mar 15, 2016

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.

SBoudrias commented Mar 15, 2016

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.

@tlancina

This comment has been minimized.

Show comment
Hide comment
@tlancina

tlancina Mar 21, 2016

Member

@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!

Member

tlancina commented Mar 21, 2016

@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!

@gruppjo

This comment has been minimized.

Show comment
Hide comment
@gruppjo

gruppjo Mar 22, 2016

@tlancina I know there's a lot of topics in there so no worries. Take your time. Still thanks for the heads up and letting shine through that you are taking this seriously :)

gruppjo commented Mar 22, 2016

@tlancina I know there's a lot of topics in there so no worries. Take your time. Still thanks for the heads up and letting shine through that you are taking this seriously :)

@tlancina

This comment has been minimized.

Show comment
Hide comment
@tlancina

tlancina Mar 28, 2016

Member

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.).

Member

tlancina commented Mar 28, 2016

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.).

@gruppjo

This comment has been minimized.

Show comment
Hide comment
@gruppjo

gruppjo Apr 5, 2016

Hi @tlancina,
thank you for your very insightful response and again for taking these concerns seriously! This clears up a lot of things for me.

However, the CLI was never meant to be a build tool, just a small utility

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.

If you have issues using the platform commands with projects not started by the CLI please open an issue, because this should be supported.

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:

  • How do you recommend staying on top of the changes of the CLI and possibly participate in discussions concerning Cordova CLI, deprecating existing comands, assuming more responsibility (scaffolding/generation/testing/CI/...)? I'm sure I can provide valuable insights, suggestions and experiences when the time comes. Are you discussing those things publicly?
  • Are you guys interested in blog article pitches? I'm thinking about writing one or even a series, explaining how we build enterprise-level apps with Ionic. Using the Ionic Platform for delivery and services like push, could be a part of it. Usually my articles are published on our company blog but it might be great for your audience as well to see that it's possible to build large-scale apps with testing/CI/CD and other neat features using Ionic. What do you think?

gruppjo commented Apr 5, 2016

Hi @tlancina,
thank you for your very insightful response and again for taking these concerns seriously! This clears up a lot of things for me.

However, the CLI was never meant to be a build tool, just a small utility

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.

If you have issues using the platform commands with projects not started by the CLI please open an issue, because this should be supported.

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:

  • How do you recommend staying on top of the changes of the CLI and possibly participate in discussions concerning Cordova CLI, deprecating existing comands, assuming more responsibility (scaffolding/generation/testing/CI/...)? I'm sure I can provide valuable insights, suggestions and experiences when the time comes. Are you discussing those things publicly?
  • Are you guys interested in blog article pitches? I'm thinking about writing one or even a series, explaining how we build enterprise-level apps with Ionic. Using the Ionic Platform for delivery and services like push, could be a part of it. Usually my articles are published on our company blog but it might be great for your audience as well to see that it's possible to build large-scale apps with testing/CI/CD and other neat features using Ionic. What do you think?
@tlancina

This comment has been minimized.

Show comment
Hide comment
@tlancina

tlancina Apr 5, 2016

Member

@gruppjo regarding the platform commands, you may find ionic-team/ionic-platform-web-client#41 insightful and possibly want to weigh in there.

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 :)

Member

tlancina commented Apr 5, 2016

@gruppjo regarding the platform commands, you may find ionic-team/ionic-platform-web-client#41 insightful and possibly want to weigh in there.

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 :)

@gruppjo

This comment has been minimized.

Show comment
Hide comment
@gruppjo

gruppjo Apr 6, 2016

@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 :)

Also I just want to say thanks for your interest, feedback and general positive tone, it's much appreciated!

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.

gruppjo commented Apr 6, 2016

@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 :)

Also I just want to say thanks for your interest, feedback and general positive tone, it's much appreciated!

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.

@dwieeb

This comment has been minimized.

Show comment
Hide comment
@dwieeb

dwieeb Jul 28, 2017

Contributor

This issue has been automatically closed because it had the v2 label. Please install the new CLI v3 (npm install -g ionic@latest). See CHANGELOG.md#Upgrading from CLI v2 for details.

If this issue is still a problem in CLI v3, please create a new issue. Thank you!

Contributor

dwieeb commented Jul 28, 2017

This issue has been automatically closed because it had the v2 label. Please install the new CLI v3 (npm install -g ionic@latest). See CHANGELOG.md#Upgrading from CLI v2 for details.

If this issue is still a problem in CLI v3, please create a new issue. Thank you!

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