Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will StencilJS be available as a development option in Ionic?

I wonder if Stencil JS will be adopted as an option for developing mobile apps in Ionic.

Let me explane what I mean by "an option for developing". In other frameworks like NativeScript, you can choose to start a new project with Angular + Typescript or Javascript. Furthermore, other "options" exist (for example VueJS for NativeScript)

StencilJS is an interesting alternative to existing javascript frameworks like Angular, and it would be great to build Ionic apps with it.

Now, because the StencilJS framework was created by the Ionic framework team, I wonder if one day it will be available to all Ionic developers as an alternative to Angular.

like image 530
F.Ricceri Avatar asked Oct 20 '17 10:10

F.Ricceri


2 Answers

Update 24-01-2018:

Another great article from Josh: An Introduction to Stencil

Yes, you can.

Stencil is a compiler that generates Web Components (more specifically, Custom Elements). Stencil combines the best concepts of the most popular frameworks into a simple build-time tool.

Since Stencil generates standards-compliant web components, they can work with many popular frameworks right out of the box, and can be used without a framework because they are just web components. Stencil also enables a number of key capabilities on top of Web Components, in particular Server Side Rendering (SSR) without the need to run a headless browser, pre-rendering, and objects-as-properties (instead of just strings).

You can read more about it here

Here you can see how to do it with Vue.js

like image 133
Sampath Avatar answered Oct 11 '22 14:10

Sampath


Yes! As @Sampath already mentioned Stencil itself is just a compiler for building WebComponents. But I think what you are asking is if the ionic components will be available for development without Angular. The ionic team is currently working on porting all of their UI elements to WebComponents using Stencil to make this process easier.

After the porting process is finished ionic-angular will still be available like it is now but there will also be something new which is called ionic-core (or just core) which contains all of ionics UI elements as standard conform web components. You can use these components wherever you want: In a React application, in a Vue application or without any framework in vanilla JS.

I don't know this for sure because I did not read anything about that exact topic up to now but I'm pretty sure that you will have options in the ionic CLI for creating different projects based on the core library.

Stencil itself will stay as it is - a tool for creating WebComponents. Of course you can use Stencil to build your entire application, meaning every component you use is built with stencil.

You can follow the progress of the core library on github at the core branch of the repo. As you can see in the packages folder there are different packages for ionic-angular and core.

like image 21
David Avatar answered Oct 11 '22 12:10

David