TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: What are the cons of Google Polymer?

87 点作者 LukeFitzpatrick大约 9 年前

18 条评论

sshumaker大约 9 年前
Disclaimer: I led development of gaming.youtube.com. We chose Polymer at the time for non-technical reasons.<p>Some downsides: Performance is not great. Lack of coherent data architecture (e.g. Redux). Difficult to manage state change (as opposed to React) due to a more limited programming model - e.g. template ifs and repeats don&#x27;t know to reevaluate in many cases. This makes it harder to integrate with third party js libraries. Inferior tooling vs React.<p>Philosophically Polymer is more about the DOM and React is more JS-focused. Some of this is personal preference.
评论 #11654524 未加载
评论 #11654218 未加载
评论 #11681230 未加载
评论 #11654295 未加载
david-given大约 9 年前
It pretty much requires you to use the babel&#x2F;crisper&#x2F;vulcanize toolchain, which in my limited experience doesn&#x27;t do nearly a good a job of minifying Javascript than other tools (because it can&#x27;t do symbol renaming). I haven&#x27;t found a way to use browserify with web components, for example, so no ES6 modules.<p>Polymer is made of magic. It uses magic cutting-edge browser features where available, and where they aren&#x27;t it fakes them using magic. Some of its APIs like Polymer.dom(x) are completely magic. When it works, it works really well. When it doesn&#x27;t you are going to waste so much time trying to find out why.<p>It also assumes that everything you&#x27;re doing is through Polymer; so you won&#x27;t get much mileage out of, say, JQuery. While it admits the existence of other Javascript libraries it tends to blank them at parties.<p>If I were to do my current project again... I&#x27;d probably still choose Polymer, although I&#x27;d take another look at the other Javascript UI toolkits. Web components are so, so nice for designing UIs --- I can finally use actual computer science techniques like abstraction and modularity for building UIs! --- and it&#x27;s got the best consistent look and feel that I&#x27;ve ever seen in a Javascript UI toolkit.
评论 #11654310 未加载
评论 #11658781 未加载
评论 #11657524 未加载
eob大约 9 年前
We use it pretty extensively at Cloudstitch and like it on the whole.<p>A few commenters mentioned poor browser support, but we haven&#x27;t experienced any problems other than IE&lt;=10.<p>In many ways Polymer is just a shim for the WebComponents spec with data binding added in, along with a standard library of web components. The resulting framework-style is basically plain-JS&#x2F;HTML with a la carte use of Web Components where appropriate. Unlike [my perception of] React or Angular, you can use Polymer a bit without going all in. (Ironically the one thing you can&#x27;t currently do is mix Polymer Elements from Source A with Polymer Elements from Source B at runtime if they have common, but separately hosted, dependencies).<p>WebComponents feel a bit like Java swing, in that making HelloWorld is high overhead, but once you&#x27;ve got a nice toolbox of components going, you can pull them out and use them flexibly. This is not unlike React components, except Polymer&#x2F;WebComponents use an HTML-centric definition format while React uses a JS-centric definition format.
评论 #11656725 未加载
评论 #11655471 未加载
pfooti大约 9 年前
If you are using the shady dom (web components lite, rather than the low perf full polyfill), the library requires you to do dom manipulation through the polymer local DOM API. [0]<p>That means without shimming other libraries, polymer is incompatible with any other libraries you might use to manipulate the DOM. For example, you can&#x27;t easily mix angular, react, or ember templates with some polymer elements, because (e.g.,) angular&#x27;s ng-if directive doesn&#x27;t use polymer.dom to inject created nodes.<p>This is currently my biggest beef with polymer. Someday, webcomponents will be great, principally due to composability and portability. Just plug the one component you need in to your extant work. But for now, that promise is not quite realized.<p>[0]: <a href="https:&#x2F;&#x2F;www.polymer-project.org&#x2F;1.0&#x2F;docs&#x2F;devguide&#x2F;local-dom.html#dom-api" rel="nofollow">https:&#x2F;&#x2F;www.polymer-project.org&#x2F;1.0&#x2F;docs&#x2F;devguide&#x2F;local-dom....</a>
评论 #11654580 未加载
appleflaxen大约 9 年前
I&#x27;ve never used it, because the official demo site was incredibly slow. If the resources of google can&#x27;t even make their own library feel responsive, then I&#x27;ll spend my time hitting my head against a different platform.
评论 #11654231 未加载
IshKebab大约 9 年前
Slow as hell in Firefox because Firefox doesn&#x27;t natively support web components so they use a JavaScript polyfill.<p>Also it is over-complicated for simple websites. You&#x27;ll end up in bower-npm-grunt-etc-etc hell very quickly.
评论 #11654571 未加载
评论 #11654568 未加载
lucb1e大约 9 年前
For those who (like me) have never heard of it, here&#x27;s a link: <a href="https:&#x2F;&#x2F;www.polymer-project.org" rel="nofollow">https:&#x2F;&#x2F;www.polymer-project.org</a>
评论 #11655193 未加载
dccoolgai大约 9 年前
For the moment, it doesn&#x27;t really have great browser support and less intent to implement than some other features of the OWP. Whereas service workers at least had Mozilla pushing along with it, Google seems to be &quot;going it alone&quot; a bit more on Polymer and having a tougher time building a coalition for it.
评论 #11660630 未加载
评论 #11654090 未加载
dominotw大约 9 年前
you are kind of forced to use bower.<p>lacks older browser support<p>mixing it with other virtual-dom libraries like react is not easy or straightforward.
评论 #11654036 未加载
etimberg大约 9 年前
I recently used Polymer for a large project. Performance is ok on chrome with full web-components, but unsurprisingly the full webcomponent polyfill is very slow elsewhere. Stick to the ShadyDom polyfill if possible.<p>Vulcanize is pretty cool, though we had a hard time getting it to work right in a gulp workflow.
评论 #11655606 未加载
arisAlexis大约 9 年前
If you want to compare with react for example or angular it lacks a mobile framework.
评论 #11654370 未加载
wanda大约 9 年前
Excluding the performance issue, which largely seems to be confined to instances where polyfills are required, the cons don&#x27;t seem so bad. The tooling will improve as the library and community mature, and other problems are being addressed already by the looks of it.<p>I&#x27;ve got a project in the pipeline for which I was planning to use Cycle.js, but I&#x27;ve always had a niggling interest in Polymer.<p>What I&#x27;d like to know is whether Polymer offers any significant pros, because after consuming some of the docs the offer seems to be a <i>better</i> reimagining of ASP.NET WebForms. What are the benefits?
sidcool大约 9 年前
An issue we faced is with different versions. Each new major version changed so much that we had to rewrite some things. I will wait for a stabler release
评论 #11657545 未加载
kolar大约 9 年前
I&#x27;ve used Polymer.dart for browser game consiting mainly of simple windows. From that I can say the most important downside is the poor performance on mobile (even with shady DOM). Despite that I&#x27;d probably still choose Polymer if I need browser framework because webcomponents encapsulation feels great from developer perspective.
elcritch大约 9 年前
Don&#x27;t forget to take a look at <a href="http:&#x2F;&#x2F;x-tag.github.io" rel="nofollow">http:&#x2F;&#x2F;x-tag.github.io</a> especially if you&#x27;re looking for alternatives to Polymers take on a Web components. Haven&#x27;t used either extensively yet but x-tag seems more bare metal.
andreapaiola大约 9 年前
More http requests (or vulcanize, maybe...)
评论 #11729291 未加载
评论 #11654094 未加载
andreapaiola大约 9 年前
And from a SEO point of view?
vayarajesh大约 9 年前
It lacks a routing system
评论 #11654062 未加载
评论 #11657146 未加载