Live data from Hacker News

Stencil – A reusable web component generator

stenciljs.com

81–90 of 107 posts

Re: Stencil – A reusable web component generator

#81

Does this mean we will be able to use Ionic components with React or Vue in the not too distant future?

You will be able with Vue and preact, react has some issues (that hopefully will be adressed soon). https://custom-elements-everywhere.com/ check this site for more info.

Re: Stencil – A reusable web component generator

#82

> Stencil components are rendered using JSX... What's the point? Why not just use React? Like many others - I dropped Cordova and Ionic in favor of React-Native. So, what is Ionic trying to do here? Are they throwing in the towel and adopting React? Will they end up making a kit that renders native components using JSX just like React-Native?

React is not really interoperable with other frameworks, libraries. Thats probably one of its bigger drawbacks. It is not an issue if you create a react application, but when you want to provide reusable components it might be problematic.

Re: Stencil – A reusable web component generator

#83

Hey all, founder of Ionic (team behind Stencil) here. Didn't expect to see this up on HN so soon (released this morning), thanks for understanding there's still rough edges with docs, etc We built Stencil for a selfish reason: we needed more mobile web performance for Ionic apps being deployed as PWAs (in addition to App Store apps) and we were struggling getting that with traditional framework component/bundle appro…

What kind of events are stencil events? In order to respond to an emitted stencil event, do I have to use the stencil listener, or can I use addEventListener?

Hello! Good question. There are no stencil events, we just use the custom events api that is built into the browser. Therefore, you can use addEventListener.

Re: Stencil – A reusable web component generator

#84
post #5

" Stencil is a new approach to a popular idea: building fast and feature-rich apps in the browser. Taking advantage of new capabilities in the browser, such as Custom Elements V1, Stencil enables developers to write faster and lighter components without the weight of frameworks. The tooling also a solution to teams and library authors building components that support many frameworks. Stencil components work in Angula…

Hello all! Just to clear up the confusion here. Components built with stencil are, after compiling, just custom elements. Custom elements (the V1 of the spec) are supported in Chrome and Safari natively. According to https://www.w3counter.com/globalstats.php that means about 77.6% of users globally are running a browser that supports custom elements natively. For these browsers stencil will not load the custom elements polyfill. For IE 11, Edge and Firefox we load a 5KB gzipped custom elements polyfill automatically for you. Its also worth mentioning that Firefox and Edge are both working on custom elements, so eventually these browsers will not need the polyfill either.

Re: Stencil – A reusable web component generator

#87
post #72

> Stencil components are rendered using JSX... What's the point? Why not just use React? Like many others - I dropped Cordova and Ionic in favor of React-Native. So, what is Ionic trying to do here? Are they throwing in the towel and adopting React? Will they end up making a kit that renders native components using JSX just like React-Native?

> Like many others - I dropped Cordova and Ionic in favor of React-Native. Few years ago PhoneGap apps were really slow and ugly. So I built native Android app. This year I started building hybrid Ionic 3 app because it has to work on Android and iOS. It works good enough on Nexus 5 (Snapdragon 800). The biggest problem is 4-5 seconds startup time. Stencil and component lazy loading should greatly reduce that startup…

Quick tip, did you remove the hardcoded 3000ms splash screen delay? https://github.com/ionic-team/ionic-conference-app/blob/mast...

Re: Stencil – A reusable web component generator

#88

Earlier quoted context omitted.

Yes right this second, but next on our list is providing a seamless solution to dependency dedupe. Not yet ready but it's promising.

Okay, that is definitely needed if we want to build serious components. Else it's gonna go crazy heavy!

A simple solution today would be to put the shared, heavy code in it's own component and call methods directly on that component. That's how we're share code across components in Ionic.

Re: Stencil – A reusable web component generator

#89
post #27

Here's a new library to solve a problem you don't have yet.

WebComponents in general are a solution in search of a problem. Despite being 6 years in development: - they basically delivered none of the original promises - they are extremely cumbersome to use without a library/framework on top (Polymer is the jQuery of WebComponents) - they are plagued by multiple problems and shifts in the ecosystem (browsers don't want to support `is=`, HTML imports are being dropped in favou…

Custom Elements are quickly gaining traction. They're in Chrome and Safari, and will be in Edge/FF soon based on discussions with those teams. The Angular team is toying with using them directly (not sure if this will ever come to fruition or not). We'll work with the React team to get it working with better compatibility. Right now our components work in React use just need to use a tiny "polyfill" wrapper. The experience in React isn't as good as we'd like, but it's pretty darn solid in Preact.

To me, it doesn't seem like too big of a stretch to think that the popular frameworks of today will move to the custom element spec instead of their own proprietary component model.

Re: Stencil – A reusable web component generator

#90
post #15

Earlier quoted context omitted.

Adding a "Yes, but..." Microsoft's refusal, or inability, to release a version of Edge (or even a port of an earlier IE) for macOS exacerbates this situation. I virtualize Windows on my MacBook for IE/Edge testing of my designs and code, but it requires a workflow and context shifting that I'd perfer I didn't have to do. Edit: s/I.E./IE

Ironically we have the exact same problem, except worse with Safari, since it has (relatively) poor support for some cutting edge APIs, and unlike Edge/IE we can't even legally test it in a VM because Apple doesn't even allow their OS to be put in a virtual machine. At least Microsoft has the good grace to put up free VMs for browser testing - https://developer.microsoft.com/en-us/microsoft-edge/tools/v...

You can rent a MAC server here: http://www.macincloud.com/
Post reply on HN