5 ms·
I'm not sure I'm understanding the point behind this. If the main point is to allow people to reuse components (i.e. a calendar widget) across frameworks, then
by ubersoldat2k7 9y ago
I'm not sure I'm understanding the point behind this. If the main point is to allow people to reuse components (i.e. a calendar widget) across frameworks, then good, but it's going to be quite messy when things start to get complicated and we start hitting integration problems, because some guy on the Internet writing a widget is not going to test & maintain it on all frameworks.
It also bothers me the whole Typescript deal. I might be wrong, but I don't want to have Typescript installed & integrated into my build process so I can use a widget. The only way I can see this working out is that I suck it and follow the Typescript paradigm or widget creators can distribute their widgets on some sort of "built" pure JS file, something like JAR files... and we know how well that goes.
- manucorporat 9y agoHere an engineer at Ionic. You don't need to integrate typescript to use a "widget" generated with Stencil. Stencil is a compiler that generates vanilla web components in javascript. You can just import the generated .js and use the component just like a "button" or native "input".
- ubersoldat2k7 9y agoGreat, that makes so much sense. But then, how about other dependencies that might come into play? For example, underscore, is that "packaged" with this generated JS file or some other way around? Thanks for the prompt response BTW.
- manucorporat 9y agoNo, Stencil.js is like a "real stencil", it is used to produce something, but it is not in the final product. There is nothing like "window.stencil" or any stencil related API in the output of the stencil compiler. It generates vanilla JS web components without dependencies. The documentation of stencil linked in this HN post was in fact created with stencil itself. Just open the Dev Tools!
- ubersoldat2k7 9y agoOK, so if I want to use a calendar Stencil (there will be lots of this for sure), which depends on Moment I would have to include Moment into my dependencies and manage all the dependency clashing (the stencil used 2.x but I'm using 1.x)
- manucorporat 9y agoIn fact we use the type information provided by typescript to generate the web component as performant as possible.
- arxpoetica 9y agoI think you should consider disassociating the TypeScript requirement in the compiler. You'll alienate developers (like me) who prefer Vanilla™ JavaScript. It's one of the things I love about Svelte (which you claim heritage to), in that they really try to conform to vanilla everything, i.e., HTML, CSS, JS. Everything else sounds terrific, though, especially the ability to do SSR.
- tobr 9y agoIt isn't really true that Svelte is just "vanilla" Javascript. For example, the compiler looks at the argument names of your computed properties to determine which data they depend on, which breaks with the semantics of Javascript. This means that Svelte only allows you to use function literals for computed properties.
- manucorporat 9y agoIt was announced today at Polymer Summit, please take it a look: https://youtu.be/rY233a4tp2s?t=2h6m50s https://youtu.be/rY233a4tp2s?t=2h6m50s
- doubleorseven 9y agoMaybe this one: https://www.youtube.com/watch?v=UfD-k7aHkQE https://www.youtube.com/watch?v=UfD-k7aHkQE
- slackingoff2017 9y agoThat's a very "get off my lawn" argument against Typescript :). You install it off npm and type one command to compile everything to JS, then you can pretend it doesn't exist. It's like you're arguing against distributing a large number of files in a zip archive. Actually... that's what a jar is. They're not scary, you can just unzip them to see everything inside.