These are chat archives for jdubray/sam

6th
Sep 2017
Paolo Furini
@pfurini
Sep 06 2017 06:51
Yes, it seems really cool! I rarely got impressed by presentations, but this particular one I think is a milestone in front end development (if they'll be successful in the field)
Jean-Jacques Dubray
@metapgmr_twitter
Sep 06 2017 08:10
I agree, it definitely has a feel of a game changer
from performance to architecture
Johan Alkstål
@johanalkstal
Sep 06 2017 08:15
Sounds a lot like https://svelte.technology/
Paolo Furini
@pfurini
Sep 06 2017 08:25
@johanalkstal more or less, yes.. one major difference: stencil is promoted by ionic, that powers roughly 600,000 mobile projects 😉
Paolo Furini
@pfurini
Sep 06 2017 09:24
Joke aparts, a real game changer must be an entity able to traction the entire market, it cannot be a lone developer or small OSS project in the wild.. before react there were tons of similar ideas around the web, but today we speak of "react-like" frameworks and not "somelonedev-like" frameworks. they were speaking at the polymer conference, if that's not a sign of the potential traction.. 😀
devin ivy
@devinivy
Sep 06 2017 12:19
i am very excited– i've been plugging web components in here for a while because that community could really use a bump in innovation in user space!
and it's very promising :)
Jean-Jacques Dubray
@jdubray
Sep 06 2017 15:33
@devinivy this approach sounds somewhat different from Polymer. Would you agree?
devin ivy
@devinivy
Sep 06 2017 15:44
yes, very! polymer basically subclasses HTMLElement so that the base custom element has certain functionality. i think this is the natural thing one would do first.
it sounds like stencil compiles your class into a plain HTMLElement at build time.
it's weird, but i can see how the timing there has benefits.
Paolo Furini
@pfurini
Sep 06 2017 15:51
Yeah exactly. The primary goal is to let everyone embrace web components in every workflow. So irrespective of frameworks, the only requirement is a browser..
devin ivy
@devinivy
Sep 06 2017 15:53
right, it's largely about interop, which is ionic's core problem to solve
but not necessarily every app's
polymer v3 will look similar to this. jsx and all. but will be a bit different. i don't know if it will leverage vdom, for example.
Paolo Furini
@pfurini
Sep 06 2017 15:54
A component maker like telerik/progress could stop making kendo for "whatever" and instead build universal web components. They will be usable in Cordova/ionic, angular, vue, react, .... plain js.. this is the future I want
They showed the path: web components must be real independent entities to be successful, and making a compiler is the right way
Why I need polymer to use web components? I want to open an editor, put a google map tag, include a script, and publish it
devin ivy
@devinivy
Sep 06 2017 15:58
yeah, you wouldn't need polymer for that!
i think it's best used to author components for your own application
perhaps not for others' applications
Paolo Furini
@pfurini
Sep 06 2017 15:59
Not only that.. think about components that one keeps adding over and over in a page, like the google maps example
They should become natural like html itself. Html5 is born for that, for a future of componentized web
If you think not as a developer, but as a power user, it makes sense having easy components that everyone can put on a page to achieve something like displaying a map, or view a Facebook comments feed or the like
devin ivy
@devinivy
Sep 06 2017 16:03
yes certainly!
Paolo Furini
@pfurini
Sep 06 2017 16:04
I like the fact that the only requirement is a script tag in the page.. everything the component need is then lazy loaded on demand, even the polyfills required for legacy browsers
What makes a technology really shines is striving for simplicity, not exactly the direction that the react community is embracing..
devin ivy
@devinivy
Sep 06 2017 17:40
true!
Janne Siera
@jannesiera
Sep 06 2017 18:15

it sounds like stencil compiles your class into a plain HTMLElement at build time.

This is impossible. Every web component inherits from HTMLElement. Stencil outputs a bunch of web components and each of those components inherits from HTMLElement. That's the only way to create web components.

Whether you extend HTMLElement or extend from the base Polymer class (which extends from HTMLElement) doesn't matter in the end. The outward facing API is always 'regular' HTML (a dom node with attributes, properties and events).

The only difference is that to use a Polymer component you must include Polymer on your page and Stencil pre-compiles them thus removing this (runtime!) dependency.

In theory, Polymer could decide to start doing the same thing to accomodate interop.

Now, if anyone still hasn't looked into Skate. They offer a lot of the same, and that lib is tiny.
devin ivy
@devinivy
Sep 06 2017 18:16
@jannesiera yes i misspoke. i meant to imply that with stencil it's MyComponent > HTMLElement vs. MyComponent > PolymerElement > HTMLElement
i have looked into skate and am quite interested
Janne Siera
@jannesiera
Sep 06 2017 18:18
@devinivy okay, we are on the same page then :). Inheriting from PolymerElement just gives you access to their API. The same way you write your component to a Stencil API. It doesn't really carry any more meaning than that. In both cases you can still subclass and Mixin your component.
devin ivy
@devinivy
Sep 06 2017 18:19
totally!
Janne Siera
@jannesiera
Sep 06 2017 18:19
@devinivy I'm taking a very similar approach to skate but I don't like the vdom template language they use, so I'm adding a compile step to compile from template language of preference to render function.
devin ivy
@devinivy
Sep 06 2017 18:20
have you seen what they're thinking in polymer v3? templates will be something but i haven't heard what yet (jsx, literals, etc.)
Janne Siera
@jannesiera
Sep 06 2017 18:21
No, I haven't
I don't follow Polymer too closely
I go there for inpsiration but that's abou tit
BTW that async rendering demo on Stencil was amazing
reading up on that very soon!
Paolo Furini
@pfurini
Sep 06 2017 18:22
Yes I looked into skate, and it is on the same page.. but if I must invest my (limited) time I'll do with stencil. I mean, if I'd want to write a reusable component to be used outside my own projects, I'll base it on something that has some chance to survive into the wild 😜
devin ivy
@devinivy
Sep 06 2017 18:24
yes, i think it's fair to assume that polymer components will primarily be used by apps that already use polymer. and beyond that something like stencil is great.
Paolo Furini
@pfurini
Sep 06 2017 18:24
To me polymer is too much, stencil approach doesn't go into my way. I want to put my components in different repos, compile them, and use them as pure dependencies
devin ivy
@devinivy
Sep 06 2017 18:24
still need to dive into the "lazy-loading" it seemed cool but a little hand-wavy. i realize it's hard to go into depth in a short talk so i don't fault them
but i wouldn't take it for granted either– got to try it out.
@pfurini i agree that the web component revolution (if it happens) will happen via interop using tools like stencil :thumbsup:
i also think there's value in writing applications on top of something like polymer. they can go hand in hand, of course– that's part of the point :)
they all but mutually exclude each other
Paolo Furini
@pfurini
Sep 06 2017 18:26
It is too early to judge, they are only in alpha.. we'll see how they'll evolve the project, and the next version of ionic will be the first heavy use of the library
devin ivy
@devinivy
Sep 06 2017 18:27
right, but "something like" stencil will be important
polymer is trying to say "hey, we're light– it's not a big deal to include us on your page" but in practice i'm not sure if people totally feel that way.
p.s. related to SAM and state management... did you hear what they said in the stencil demo?
Paolo Furini
@pfurini
Sep 06 2017 18:28
I do NOT feel that way indeed 😉
devin ivy
@devinivy
Sep 06 2017 18:28
what way don't you feel? you think stencil and polymer compete directly?
and that one is better than the other, whether you're building apps or building distributable components?
Fred Daoud
@foxdonut
Sep 06 2017 18:29
@devinivy what did they say in the stencil demo?
devin ivy
@devinivy
Sep 06 2017 18:29
they said something incredibly vague, like: "we need state management a la redux, we're working on it"
:grimacing:
Paolo Furini
@pfurini
Sep 06 2017 18:30

they said something incredibly vague, like: "we need state management a la redux, we're working on it"

yes, see my earlier comment diretcted to @jdubray

@jdubray if you see any value in the stencil project, please tell them to avoid introducing state management stuff ala redux! they mention it at the end of the presentation, and I started to feel the pain.. 😓

here it is

what way don't you feel? you think stencil and polymer compete directly?

sorry but I can't quote from the mobile app, switched to desktop.. I was referring to this comment: polymer is trying to say "hey, we're light– it's not a big deal to include us on your page" but in practice i'm not sure if people totally feel that way.

I don't feel polymer should be included on my pages..
I want dependency free (read: self-contained) web components, and use them in my architecture of choice: a legacy Angular app, a new ionic/cordova project, a light vanilla js project
Paolo Furini
@pfurini
Sep 06 2017 18:38
If polymer were actually successful in that claim "we're light, use polymer for pure web components", then now we should have kendo ui web components, or DevExpress, or Syncfusion.. but that's not the case, so clearly it's not the right approach
devin ivy
@devinivy
Sep 06 2017 18:39
okay i see– yes, i agree. i'm very unlikely to include a polymer element on my page unless i'm already using polymer
even though overall i like polymer fine
Paolo Furini
@pfurini
Sep 06 2017 18:41
Given that the Ionic team were speaking at the Polymer conference, I predict something like this: sometimes during next year, polymer will announce that they'll use stencil (or a joint venture Ionic/Polymer team) to compile the core components, leaving the polymer APIs as an higher level layer
devin ivy
@devinivy
Sep 06 2017 18:42
ooooh, juicy!
i agree that polymer must like stencil– they play their cards pretty close to their chest (i.e. they protect their OSS like a product)
Paolo Furini
@pfurini
Sep 06 2017 18:44
Probably they'll try the road of a combined effort, or they'll start with experimenting with only the core components, it's too early to predict the exact strategy, but for what I can guess the Polymer team is really interested in the stencil approach
another possibility is that they'll fork the strategy, but I don't care if they'll maintain code compatibility between projects (that is, use the same decorators, or make a compatibility layer)
Janne Siera
@jannesiera
Sep 06 2017 18:47
Guys, while criticizing Polymer please concider the context in which it was created. Polymer was created in a time where people wanted frameworks that do everything for them and where web components didn't exist. The project was created specifically to push the idea of standalone interop components that are just like html. The whole end goal of Polymer is to not exist as a dependency because the whole framework is incorporated in the browser itself. And thus their slogan #usetheplatform
devin ivy
@devinivy
Sep 06 2017 18:48
i'm not criticizing polymer, i've been a fan since 0.5 :D but we finally have some fresh ideas in that space
and it's good!
however, i don't think polymer intended for the whole framework to become part of the browser
Paolo Furini
@pfurini
Sep 06 2017 18:49

Guys, while criticizing Polymer please concider the context in which it was created. Polymer was created in a time where people wanted frameworks that do everything for them and where web components didn't exist. The project was created specifically to push the idea of standalone interop components that are just like html. The whole end goal of Polymer is to not exist as a dependency because the whole framework is incorporated in the browser itself. And thus their slogan #usetheplatform

I like what Polymer did for the component revolution, and what you say is exactly the reason why they MUST love the stencil (or skate) approach

devin ivy
@devinivy
Sep 06 2017 18:50
elephant in the room: i'd be surprised if polymer adopted typescript :P
Paolo Furini
@pfurini
Sep 06 2017 18:51
Typescript is only a temporary polyfill.. ESNext is capable to do the same as well
Janne Siera
@jannesiera
Sep 06 2017 19:15

still need to dive into the "lazy-loading" it seemed cool but a little hand-wavy. i realize it's hard to go into depth in a short talk so i don't fault them

If you can, definitely let me know what you find out! I'm interested, but waaay too many things to figure out right now ;P

Paolo Furini
@pfurini
Sep 06 2017 19:19
Agree, the lazy loading part is not crystal clear to me either
Fred Daoud
@foxdonut
Sep 06 2017 19:56
@devinivy
i realize it's hard to go into depth in a short talk so i don't fault them
I'm facing that problem now preparing for my Meiosis presentation :worried: