15 ms·
Polymer, a Web Components library built by Google
- unwiredben 14y agoThis is what a lot of the former engineers on the Enyo team have been working on. However, Enyo is a living and growing project, now under the sponsorship of LG Electronics. If you want to see what their older implementation does check out http://enyojs.com/ http://enyojs.com/.
- ganarajpr 14y agoThis is not the same as Enyo. Probably not even close. Agreeably they are both Component Frameworks but the similarity ends there. Enyo's component description is in Javascript. Polymers is in HTML. And that is what sets them apart.
- napoleond 14y agoI mentally parsed this as "Web UI Components" and thought to myself, "Wow, this looks a lot like Bootstrap". Turns out that the page is indeed built using Bootstrap, and the library is a collection of polyfills.
- NatW 14y agoit seems to support primarily 'evergreen' browsers according to this: http://www.polymer-project.org/compatibility.html http://www.polymer-project.org/compatibility.html
- andyl 14y agoIs related to Angular in any way ??
- jasoncartwright 14y agohttp://www.polymer-project.org/faq.html#is-this-project-related-to-angular-js--closure--google-web-toolkit http://www.polymer-project.org/faq.html#is-this-project-rela...
- chrisfarms 14y agoSolving some similar problems, but the aim of this appears to be a mega-polyfil playground for the (still work in progress) HTML Web Components standards: https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shado... https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/impor...
- deleted 14y ago[deleted]
- deleted 14y ago[deleted]
- eldude 14y agoI was at the Google IO talk and talked to Matt McNulty, my old boss from Palm, and was blown away with what they're building. This is the future of UI in the browser. The declarative nature, the encapsulation, the data bindings, the attribute and event-driven APIs are all orders of magnitude simpler than existing JavaScript / HTML UI element componentization. The reusability of a custom element compared to an HTML snippet with some associated JavaScript and CSS cannot be overstated. EDIT: understated > overstated
- deleted 14y ago[deleted]
- ble 14y agoHave you tried using the polyfills yet? From the sound of it, they are good enough that future is already here-- except for some glaring exceptions like shadow DOM re-projections.
- MatthewPhillips 13y agoThe future is here, but we don't know how to deal with it yet. How we currently create web applications is so fundamentally different... that it's almost like learning from scratch. It still doesn't tell you how to construct your application (aside from using components, of course). You'll still have some type of "application wide script", I think, to do stuff like routing.
- dustingetz 13y agoI see it more as a potentially native impl of MVVM which is currently done in the application layer. the speed optimization is important if we want to have UIs as complex as, say, an IDE in the browser, which is pretty clearly where we are headed this decade.
- ibdknox 13y agoLight Table is pretty darn fast and that's using the regular old html/js/css we have now. :)
- rjd 14y agoSo... is this XSLT reinvented? I'll admit it looks like it'd be a tonne nicer (less verbose and strict) than XSLT but it all looks very familiar to me... just add a client library and you have the same thing? Or am I missing something here?
- bbllee 14y agoYes, you are missing something. :) This is trying to provide polyfills for and build on top of Shadow DOM and Custom Elements. While some of the features in them could be provided just by templating stuff (though it would be mildly to very inconvenient), at least the visible DOM / shadow DOM separation and scoped styles wouldn't be possible.
- randomfool 14y agoNot really, this deals a lot more with lifecycle events, constructors, inheritance, scoping of styles, etc. To do so it's operating at a completely different level, very much in the DOM.
- petercooper 14y agoMeta question: Is there still a compelling point to having long-term unique URL checking on HN if submitters are going to tack on things like "?repost"? It makes sense over the period of a day or so to avoid 100 simultaneous duplicate items, but beyond that it seems people are working around it all the time anyway.
- superchink 14y agoI don't think there is any long-term unique URL checking. I'm pretty sure it only checks for recent duplicates. I think that's by design.
- bpierre 14y agoThis is an interesting question. I submitted this link yesterday, and it did not make it to the HN homepage. Still, I was almost certain that it could start an interesting HN discussion to read. Today I chose to repost it with a clear ?repost rather than a less visible trick, and it was still upvoted (better timing I suppose): the fact that it is a repost did not seem to bother the upvoters. I have no solution to propose, but the timing seems to be the most important factor for HN submissions, as we already know [1][2][3], and I think these small hacks are acceptable to work around the problem: reposts are not a big source of pollution, and users can report abusive behaviors with the flag button. [1] http://hnpickup.appspot.com/ http://hnpickup.appspot.com/ [2] http://hnbuffer.com/ http://hnbuffer.com/ [3] http://jacquesmattheij.com/How+to+make+the+Hacker+News+homepage http://jacquesmattheij.com/How+to+make+the+Hacker+News+homep...
- btilly 13y agoGiven comments from pg like https://news.ycombinator.com/item?id=5693221 https://news.ycombinator.com/item?id=5693221, it is clear that if tricks like this become common, using them will be ban-worthy.
- wmf 13y agoPerhaps /newest should show 30 random items submitted in the last 24 hours.
- 13y ago
- deleted 14y ago[deleted]
- dmragone 14y agoCan someone explain this to me like I'm a 5 year old and have no idea what any of it means? What will it help me do that I can't otherwise? What tech does it compare to, if any (direct competitors)?
- ilaksh 14y agoSimilar to AngularJS also a Google project.
- dmragone 14y agoYeah I got that feeling. I've used and like Angular, but can't figure out why I'd want to use this instead.
- liamk 14y agoI have the exact same question. Polymere does databinding, and custom html elements, but I think Angular does it a little better.
- ilaksh 14y agoI think AngularJS has more features but Polymer is more modular and designed to be more easily adoptable over time and also fit in with Web Components. I also think that a few things in Angular are hard to figure out, whereas this looks a little more straightforward. So if this Polymer thing could add some of the stuff that Angular has like routing with pushstate then I will definitely consider using it.
- randomfool 14y agoOne difficulty with building large single-page web applications is having a decent component model. Right now, web pages are mostly composed of primitives (divs, etc) which are the building blocks for complex UIs, but there's not a first-class way of bundling these together into richer components such as a tab control, or a data bound listbox. The web components basically standardize a way to encapsulate more complex UI components, so you can do something like: <x-tab-view></x-tab-view>. Even beyond a rich community of pre-built components for you to consume, they make it easier for you to make your applications composable- <my-header></my-header> <my-paging-content> ... lots of content ... </my-paging-content> <my-footer></my-footer> Hopefully this all makes it much easier to build larger single-page apps.
- neilk 14y agoThis framework looks really cool, but "built by Google" is a misnomer. Software like Closure, or the gold linker - these deserve to be called "built by Google". Internal tools, battle tested over years, released to the public. Angular and Polymer are more like what I'd call "technologies by Googlers".
- tjholowaychuk 14y agoIt's a good way to get more interest, look at "twitter"'s bower
- tjholowaychuk 14y agoGiant polyfills are scary! Looking forward to native implementations! Curious about the perf of this one, going to check it out, looks like solid work!
- drivebyacct2 14y agoNeeds more overlap with Angular. (Sorry, this isn't meant to be sarcastic if it were being interpreted as such)
- visarga 13y agoI thought Angular was becoming the One True Way. Now I am confused.
- drivebyacct2 13y agoI'm a bit myself as well, I need to fire up a Polymer project tonight and work through a few things and see how it goes compared to my experience with Angular. I was always under the impression that the Components infrastructure of Angular.JS was what was driving the spec for Web Components. Maybe I misunderstood, maybe it is and it's just doing so alongside Polymer, or maybe I should play around with them more and write something up (or the best option, wait until someone more knowledgeable has done the work and summarized it for me)
- jhuckabee 14y agoGoogle now has 3 players in the single page web app framework game: Angular, Dart (with web ui), and now Polymer. Why not join forces and make one killer framework?
- dragonwriter 14y ago> Google now has 3 players in the single page web app framework game: Angular, Dart (with web ui), and now Polymer. Why not join forces and make one killer framework? Because when you have lots and lots and lots of resources and the best solution to a problem isn't immediately apparent, often pursuing multiple solutions until one shows itself to be the winner is a more effective use of those resources than picking one when the right choice is unclear and focussing all your efforts there.
- tosh 13y agoAs far as I know all of the teams are aware of each other and even share some resources (code) as well as insights about best practice and API design. The angular people probably have the most experience re real-world usage and what works better and what doesn't. Web UI afaik is getting inspiration from Angular and closely tracking polymer spec & API wise. I expect (and I don't have a crystal ball) that Angular will eventually adopt more and more Web Component stuff as it gets supported by browsers and might add polyfills from polymer (many projects will want to look at and use polyfills from polymer I think) If you want to experience the power of Web Components right now Web UI is the project that will get you the farthest in terms of browser support from what I understand. It might look like three different efforts but they are closely related from a 'learn something new & push boundaries'-POV :) We as web developers are the ones who benefit from this.
- ebidel 13y agoDart's Web UI is built on top of Web Components. At least in the case of Polymer and Dart, Web Components are the "framework" :)
- spankalee 13y agoAnd GWT and Closure. Google isn't a single entity.
- drivebyacct2 14y agoSeeing people excited about this reminds me of the thread the other day with the desktop developers insisting that web design is still like it was 10 years ago and is still the same hacky cludgy mess it was then. Fortunately, Angular.JS and now Polymer have given us much cleaner and more mature methods.
- v13inc 14y agoHmm, there seems to be quite a bit of magic here that is a bit offputting. For example, in their Getting Started page [0], they have an example of binding component data to elements. It appears that the Age slider is bound to the {{age}} value because its ID is "ageInput". I would prefer to declare the binding with a data-bind="age" attribute on the input, or something else equally explicit. [0]: http://www.polymer-project.org/getting-started.html http://www.polymer-project.org/getting-started.html
- ebidel 14y agoData binding happens at the property level. For example, you can remove the id/for attributs from those elements and things still work correctly: http://jsbin.com/ecejiy/2/edit http://jsbin.com/ecejiy/2/edit
- v13inc 13y agoThanks for the example! Does this mean that it is the value="{{age}}" attribute that is causing the binding? What happens if I want to do something like: <input value="{{firstName}} {{lastName}}"></input>?
- v13inc 13y agoI just tweaked the GP's example to used <input value="{{name}} ({{age}})"></input>, which rendered as expected. The field wasn't bound to the age or name properties though, which makes sense. In practice, this almost seems like "sugar" that automatically binds an input to a value if it's value contains ONLY the property. To test out the binding sugar, I tried using this input: <input value=" {{name}}"></input> (note the space before {{name}}), which did not bind {{name}} to the input. I'm still of the opinion that the binding should be more explicit. Edit: typo fix
- scottjmiles 13y agoThis is good feedback. We wanted to start with an easy mode, so people could on ramp quickly. In this case, you just use {{ }} for various kinds of binding and Polymer will (try to) do the right thing. I suspect we will need an alternative syntax for folks like yourself that want an explicit, engineering mode.
- stephen 13y agoSo, I know Google is putting out a lot of these Web component specs--how likely are they to get certified/widely accepted? Is Mozilla/etc. on-board with all of it? I can't tell if it's an industry-wide movement, or just a bunch of the Google AngularJS guys having fun writing up W3C specs.
- tosh 13y agoMozilla has a very similar project that is aligned with polymer: http://www.x-tags.org/ http://www.x-tags.org/ Looks like we'll get actual browser support for Web Components eventually :)
- visarga 13y agoWhen they decide to include it in the browser the change will come fast - these days browser updates go very well.
- level09 13y ago1.Clone the project to your app’s root folder. See Get the code. 2.Fire up a web server in your app’s directory. 3.Include polymer.js in your main page: <script src="Polymer/polymer.js"></script> 4.Read the Getting Started guide. I dont know why, but I really found step 4 very funny at this point.
- salimmadjd 13y agoWith angular and now polymer, we are seeing a complete paradigm shift in approaching web client development. This is a beautiful metamorphosis to watch. From the days of early HTML tag race (blink, marque, etc.) to addition of asynchronous XML reading with IE 4, to various AJAX helper libraries (jquery, etc) to frameworks with their own complexity and now what we are seeing in the past 12 months or so.
- ams6110 13y agoJust think, at some point we might achieve the replication of capabilities local/native applications had 15 years ago. And then what's the difference, except probably now your data is stored online somewhere.
- salimmadjd 13y agoThe "network computer" is becoming a reality 15 years later
- purplelobster 13y agoThe difference is, I can give a URL to anybody and expect my app to work on their phone, tablet or laptop, without installation, within a matter of seconds. Their data stored online somewhere means that their devices are always synced, and it doesn't matter from where they use the application.
- tolmasky 13y agoWe'll see. In a lot of ways that was already the case with the web. People seem to ignore that email was, and remains, more or less this very ubiquitous web app "dream". Even 10 years ago I could log into hotmail from any computer on any browser, my mail was always "synced" (since I was always more or less directly manipulating the server), and I could see my mail on my phone way before the smartphone revolution. But it remains to be seen whether these technologies will actually make that possible for a wider array of applications. That is to say, is email just a fluke because it happens to have very simple constraints? The problem of saying "once you can easily write an app you can hit with a URL you get all this for free everywhere!" is that it ignores the "pesky details" of data conflicts and fundamental differences in platforms. Just because my tablet or phone can hit the Photoshop web app URL doesn't mean that app that was designed for a desktop is going to be at all usable on my tablet or phone. No amount of pointer events or reactive layout will fix the problem of sometimes (often? rarely? who knows) needing a truly differently well thought out design for these very different platforms. Is the problem with getting complex apps like these missing "frameworks" or just the leg work of actually rethinking what it means to edit a photo on a tablet vs a desktop. Time will tell I suppose. Regarding data conflicts, the second you give people the perception that there data is just magically going to always sync and be there when they need it you are going to run into the very real abuse of multiple edits that need to be conflict resolved and the fact you designed your app for a theoretical world where you always have internet when that really isn't the case yet. All that being said, I agree this is some approximation of the model we will be using some day when we "figure this out".
- ams6110 13y agoSounds like Cappuccino? http://www.cappuccino-project.org/ http://www.cappuccino-project.org/
- lenkite 13y agoWhy do all the hip UI frameworks nowadays have type that you have to struggle to see ?
- kickingvegas 13y agoSo let's see where Polymer ends up 2 years from now. Sincerely, an ex-GWT developer.
- cshenoy 13y agoFrom their FAQ: Over time as more browsers implement these emerging standards, the foundation layer will diminish and ultimately disappear. So more or less, they want it to be gone.
- kickingvegas 13y agoI can only hope this to be true. I consider such a statement to be aspirational at best.
- ma2rten 13y agoPolymer IS a backport of a new web standard, which lets you use it with current browsers.
- ebidel 13y agoThe foundational layer goes away over time. Everyone's app gets better/stronger/fast :) The opinionated sugaring layer on top of Web Components (the Polymer layer) won't go away. That said, one goal is to have a continuous feedback loop with standards bodies to get things spec'd out if it makes sense to add them to the web platform. Similar to how querySelector landed after jQuery made it "a thing".
- bowyakka 13y agoI am confused, doesnt google already have Angular.Js, Closure.Js, GWT, and many others .?
- scriptproof 13y agoIf i have well read the doc, while angular has new attributes, Polymer adds new tags to HTML. That seems a step ahead apparently.
- bsaul 13y agoAngular also adds new tags ( and custom ones too). You can decide whether you want to use your component ( or "directive") as an attribute , an element, or a css class, and angular will automagically replace them.
- abhidilliwal 13y agoI don't think this is officially by google, instead by some googlers
- mariusandra 13y agoThere's a bug in your getting started guide. Under "Binding between components and native elements" index.html contains <tk-element></tk-element>, but should contain <tk-binding-to-elements></tk-binding-to-elements> :-)
- ebidel 13y agoThanks for the heads up. Fixed through the magic of PRs! https://github.com/Polymer/docs/commit/1b9f0c361f84ce0157a1396ed03336355fba7b7c https://github.com/Polymer/docs/commit/1b9f0c361f84ce0157a13...
- namespace 13y agoLooks strikingly similar to Mozilla's XUL and XBL for web. They were far too ahead of their time.
- regularfry 13y agoWhat a frustrating website. I had to read the comments here to figure out why I might be interested in it.
- beatpanda 13y agoI'm tired of this crap. I like HTML. It works, everywhere. Why does everyone hate it so much?
- newbie12 13y agoThis is HTML! But with tags that you can create, and pass values to, and do things in the browser. It actually empowers developers who don't grasp javascript by encapsulating it.
- rimantas 13y agoProbably because people keep ignoring what "T" stands for in HTML and keep trying to morph it into WAML.
- jkomoros 13y agoWe love HTML, too. That's why we're so excited about web components--it brings the power back to HTML (and DOM) instead of in some parallel universe in script.
- qompiler 13y agoDid Google just patent pieces of HTML? Hilarious! https://github.com/Polymer/toolkit-ui/blob/master/PATENTS https://github.com/Polymer/toolkit-ui/blob/master/PATENTS
- yareally 13y agoAs a independent software developer that does a fair amount of web based work, I wished they had included Opera (Presto based Opera) in their compatibility list[1]. Yes, I'm aware most people don't use Opera before someone reminds me, but there are a lot of Opera Mobile/Mini users. On a personal standpoint, I like to make sure the js/css I write degrades gracefully and supports Opera Desktop too (something that Google has had troubles with caring about in certain sites they maintain). They also don't mention how it works on older versions of browsers (specifically IE and if it works fine on IE 9 and 8). I generally don't care about anything before IE 8 anymore, but with jQuery dropping support for IE 8 in jQuery 2.0, I am wondering if Google followed suit. It says only the latest versions of browsers[2], which if taken literally, means IE 10 only and that's a very small subset of IE use as a whole (like 1-2%) [3]. Also don't see any mention for how it works with the non-Chrome (though still webkit) stock Android browser that most Android devices come with by default. I mean it could fall under Chrome, but it's not the same and not all features are supported by the non-Chrome stock browser (and varies by Android OS version). I'm guessing it's similar to mobile safari though[4]. [1] http://www.polymer-project.org/compatibility.html http://www.polymer-project.org/compatibility.html [2] http://www.polymer-project.org/faq.html http://www.polymer-project.org/faq.html (In practice, this means we support the most recent versions of Chrome, Safari, Internet Explorer, and Firefox.) [3] http://arstechnica.com/information-technology/2013/02/internet-explorer-still-growing-as-windows-7-starts-its-decline/ http://arstechnica.com/information-technology/2013/02/intern... [4] http://mobilehtml5.org/ http://mobilehtml5.org/
- gcr 13y agoI am completely confused by this. Here's what their getting started guide looks like: The basics of using Polymer are simple: 1. Load platform.js to polyfill missing platform features, such as Shadow DOM and HTML Imports. ... What does "polyfill" mean? What is "Shadow DOM" and "HTML Imports", and how does it benefit me as a web developer? It would help if the front page had something like this, but with blanks filled in: "Polymer helps the web developer to ____ more [easily|quickly|reliably] than ____. This is what doing ___ looked like before: _____; this is what it looks like with Polymer: ____"
- dragonwriter 13y ago> What does "polyfill" mean? What is "Shadow DOM" and "HTML Imports", and how does it benefit me as a web developer? Polymer is a pre-alpha framework with a warning on every page that "only the daring need apply." If you don't know what things Shadow DOM and HTML Imports are (and can't be bothered to click the links under "Platform technologies" for those things"), you probably aren't in the audience Polymer is addressing right now. > It would help if the front page had something like this, but with blanks filled in: "Polymer helps the web developer to ____ more [easily|quickly|reliably] than ____. This is what doing ___ looked like before: _____; this is what it looks like with Polymer: ____" It probably would, except that right now those blanks would be hard to fill out since except for the low-level infrastructure, most of it hasn't been built yet, and the concept seems mostly to be "lets see what kind of app framework we can build on top of a set of emerging standard technologies, now that we've built polyfills that let us use those technologies on current browsers that lack native support for them".
- gcr 13y agoThanks for the clarification. I think I'll check back once these things solidify.
- edwinyzh 13y agoWouldn't it be amazing if Twitter Bootstrap get re-implemented in Web Components (now Polymer)? Then the html code that uses it will be much cleaner.