Ionic-Stencil HN app
Stencil is a compiler for building fast web apps and components using Web Components.
Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.
Stencil components are just Web Components, so they work in any major framework or with no framework at all. In many cases, Stencil can be used as a drop in replacement for traditional frontend frameworks given the capabilities now available in the browser, though using it as such is certainly not required.
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).
This PWA is a Hacker News demo built with Stencil and our Ionic core components that are also built with Stencil.
Want to try it live? Check it out here.
We use WebPageTest to keep track of the loading performance of this demo on real, low end devices and an emerging markets 3G network. Here is the latest lighthouse from our latest WebPageTest. This is with a Moto G with an emerging markets 3G network.
To start devving on this project, clone this repo and run:
npm run dev
to get a live reload server that watches for changes
To build the app for production, run:
npm run build