I was looking at the git repo, trying to get my head around the save-exact versions of angular dependencies in my package.json (specifically, looking to see if there’s movement to upgrade to newer versions of angular), and some of the active branches in ionic-team/ionic are interesting (although a tiny bit worrisome too).
It looks like the documentation is being shifted to talk about Ionic as being a web-component framework, rather than an angular one. Is the plan to make more general the UI framework and cordova stuff, so people could (say) write react stuff inside an ionic app if they so desired?
Mostly, this is curiosity, but it’s also me trying to get a lay of the land here - I don’t want to spend a ton of time writing my hybrid mobile app using a lot of angular syntax and code if version 5 of the framework is going to end up deprecating angular, requiring me to go and replace all those
ngOnInit bits with
ionDidInit or whatever.
My crystal ball is broken, so I can’t comment on your question about the future, but I will say that you should be doing this right now. If there is an Ionic version of something, such as component output properties or lifecycle events, it’s there for a reason and you should prefer it over whatever Angular equivalent may be close.
the fundamental problem is that I’m also re-using code in pure-angular environments (hence the interest in which version of angular is the GCD here), which makes lifecycle hooks somewhat difficult to deal with. That, and subtle differences in how the AOT compiler works.
I guess I could see some potential value in doing this with service-layer providers, but frankly not when it comes to view-layer things. Pages are just inherently tied to their UI component library, be it Ionic or angular-material or whatever, and I don’t think it does them any good to try to pretend otherwise.
I don’t read it that way. Goal #1 for Ionic 4 is to continue to use Angular.
Ionic will continue to work with Angular in the future, and Angular will likely be the primary framework used for building Ionic applications.
What they are doing with their new Stencil project is removing the requirement that Ionic applications be built with Angular. They are creating generic versions of their components by using web components, which could then be used with any framework you choose (or you could also use Ionic components without using a framework at all).
This is all behind the scenes stuff, though. The way in which you build applications with Ionic and Angular will remain largely unchanged, the API will be almost identical to the way it is now. The only difference will be that you could also use Ionic with React, Vue, jQuery, whatever (also, stuff will be faster). Since so many people are already using Angular for Ionic applications, I suspect this will remain the “de-facto” framework to use with Ionic.
Done well, this could be pretty exciting. I for one would probably love ionic more if it were a little less opinionated in certain places where the opinion clashed with angular’s opinions (mostly because I’m more used to working with angular, but do love ionic as an interface framework even when I’m only building PWAs and not worrying about native app cordova builds).
So if a future release of ionic got decoupled, you could pull in react devs, vue devs, and be more future-proofed against big changes in angular that could catch you unprepared.
Hi there! Just wanted to add an official stance on this.
- No we’re not moving away from Angular.
While we love angular and love what it has to offer, we do realize that Angular is only one framework in a sea of many. Many people don’t need everything has to offer, or dont need any framework at all. We want Ionic to be usable everywhere, even without a framework. So expanding Ionic’s components to work without any one particular framework fits this need.
We’ll have more to offer/explain in time, as we get further along
I find this news quite exciting. Regardless of how much I like Angular, sometimes I just don’t need it.
Not necessarily @dhammer. It can be vanilla JS, jquery, polymer or vanilla
web components. What makes me excited about this news is that I am a strong
believer in web components and seeing Ionic work on a way to get the
goodness of that to developers without reliance on Angular, in my view is a
very progressive and well thought-out move.
Ok, makes sense. Thanks @avago
I watched the Ionic presentation at Polymer conference this year, in Aug 2017.
I got the distinct impression that Ionic will be moving away from Angular - I imagine it will still be available, but will be the same as the switch between Ionic v1 and Ionic v2. They mention using JSX, Virtual DOM, Reactive Data Binding, and the speed/size problems with Angular
No, in the contrary.
Stencil is not a full framework, but a tool to output building blocks that can be used in a full framework. Stencil is “just” a compiler for web components. It doesn’t use Angular, right, but produces (plain JS) web component that will be used in the next Ionic Angular v4 for improved speed and performance.
(This will by the way also in no way be comparable to the change from Ionic v1 to Ionic 2+. There will be some updated and cleaned up syntax, but not much more. What I have seen from Ionic v4 yet will be a very smooth update)
Ionic will stay Angular. It might become possible to use the Ionic components in other frameworks as well. But Stencil itself is nothing “normal” developers will have to (and should) use.
That is not what I take from watching that video, or reading about Stencil on their site:
With Ionic’s classic use of traditional frameworks and bundling techniques, the team was struggling to meet latency and code size demands for Progressive Web Apps
The PWA market was something that Ionic was targeting - Stencil is an alternative to that from reading that website. If not, then there are a lot of confused people around, because it is just unclear enough to make anyone wonder!
Ionic switching their components to web components will make almost no difference to the way Ionic works now (apart from size and speed improvements). I don’t recall where I saw it, but I’ve seen the WIP changelog for Ionic v4 and the breaking changes were very insignificant -
<button ion-button> is changing back to
<ion-button> and a few other minor changes to other directives.
The normal user won’t have to know anything about Stencil or the concepts discussed in the Polymer summit video, this is just a tool the Ionic team are using to build the components behind the scenes (and you could build your own components with Stencil if you wanted to, but you can still just use Angular as per normal).
I understand how you get the impression you are under right now. As @mhartington said above, there will be a lot of explaining to do in the coming weeks. Probably also fixing wording on the website, in blog posts all over the web etc.
As I am not part of Ionic, I can only offer what I gathered from my conversations with them and reading a lot on Twitter, Github and Slack:
If we take the quote you posted: That is the reason why they created a new compiler to create web components, that replace the traditional bundling techniques they were struggling with. This will enable Ionic to build great PWAs.