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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Polymer or React?

12 点作者 ratpik将近 10 年前
I like the entire material design thing behind polymer. I was thinking of using it as a replacement for Bootstrap. But then it comes with all these other things that basically make it a competitor to React. If the primary purpose is to build a cards style interface, which is a better choice as of today?

8 条评论

ilaksh将近 10 年前
I think Polymer is a better software design but it may still not be performant or compatible enough. If its an internal or desktop app or you do perf and compat tests maybe you can use it.<p>As of today React is vastly more popular, but that doesn&#x27;t mean its still technically the most relevant.<p>6-12 months from now I would say Polymer may be trendy in some circles.
aggronn将近 10 年前
If you&#x27;re interested in Polymer just for its material design, you can use React just the same with something like Materialize. There are also projects like MaterialUI which might be worth looking at.<p>Forgetting the question about Material design, and just addressing which is better: I don&#x27;t think its a one or the other deal. For the most atomic, cross-application, least state-full components, Web Components are a good choice. But if you&#x27;re building an entire application that is component driven, does it make sense to have a Web Compoent &lt;App &#x2F;&gt;? At some point when you get to the point of using application level state across components, you can use React.
markmarrk将近 10 年前
Here is a good write up on the trade offs between the two: <a href="http:&#x2F;&#x2F;programmers.stackexchange.com&#x2F;a&#x2F;237762" rel="nofollow">http:&#x2F;&#x2F;programmers.stackexchange.com&#x2F;a&#x2F;237762</a>
therealmarv将近 10 年前
For me the biggest difference is browser support. With React many libraries I have seen you can get pretty much running with IE9+ (often also IE8). In comparison Polymer: You need more or less the newest IE browser to get it working fully: <a href="https:&#x2F;&#x2F;github.com&#x2F;WebComponents&#x2F;webcomponentsjs#browser-support" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WebComponents&#x2F;webcomponentsjs#browser-sup...</a><p>At the moment I also see that React has the bigger community&#x2F;ecosystem but this may change in the future?!
cnp将近 10 年前
If &quot;fun&quot; or &quot;Developer Experience&quot; is any sort of measure, nothing beats working with React + Flux.
alphanumeric0将近 10 年前
Elm (elm-lang.org)
AndreasGalster将近 10 年前
As mentioned, if you just go for the Material Design look, there&#x27;s several options, Materialize, MaterialUI &amp; the elements that are on the Polymer site (Please note, they are not part of Polymer, a distinction with which Google is having problems. They want you to see them as two seperate things). Materialize doesn&#x27;t come nearly as close to the &quot;fun&quot; experience as Polymer&#x2F;React, though it&#x27;s easier to get started I guess.<p>Now, I cannot speak much about the differences between React and Polymer, I&#x27;ve never used React but as mentioned already, React has better browser support. React works great in all browsers right now, whereas with Polymer it is complicated. I&#x27;m saying complicated because the general impression is that Polymer after being 1.0 is not production ready or good yet. This is not true. It is production ready if you only use Polymer. However, it still has issues working together with other DOM manipulating frameworks such as Meteor, Angular, etc. ... This is due to the fact that Polymer heavily relies on polyfilling the shadow DOM specs that are currently only implemented in Chrome &amp; Opera.<p>Their shadow DOM polyfill worked pretty good, but performance was horrible especially in Safari. Which is why with 1.0 they rewrote the polyfill from scratch, now called shady DOM. It emulates shadow DOM in a less strict way, which results in other frameworks not working properly with Polymer as of now. So, look out for a patch that&#x27;s currently in the works for this issue.<p>Aside from that, Polymer works really well in my opinion. I think what&#x27;s imporant to understand though is that React and Polymer fulfill different purposes. Polymer is a very bold undertaking of trying to bring web components right now to your browser. React has a similar approach afaik in the sense that you can easily create reusable components but it&#x27;s just a different technological approach based on what&#x27;s possible right now. That&#x27;s also why React performs better because they don&#x27;t try to polyfill stuff. If you look at the webcomponents and webcomponents-lite polyfills you might think &quot;holy shit&quot;. That&#x27;s some serious effort they put into that. So much polyfilling will hurt performance obviously.<p>React is eventually going to use webcomponents, just like Polymer. So what will be the difference of React and Polymer in the future? Hard to say. I&#x27;m guessing they will be very similar, in fact who knows maybe React will use Polymer, not for the polyfills (which technically isn&#x27;t a part of the Polymer project ... anymore[?]) but rather for the webcomponents sugar coating on top that makes writing web components easier and more fun.<p>Now, your question was what should you use for Material design. If you just use Polymer go for it right now (some browsers will be a bit slower, namely Safari but whatever. Progressive enhancement FTW. It&#x27;ll get better, they&#x27;re working on implementations). If you need to couple it with another framework, carefully do some first tests. If you know you only ship in a few months from now then it&#x27;s probably safe to go with it, since a patch will certainly be out by then.<p>If you want great performance and browser support right now, go for React.<p>If you don&#x27;t care about supporting ancient browsers and want to support only evergreen browsers then choose whatever you like better.<p>As for me, I&#x27;m about to launch my startup&#x27;s site with Polymer soon, hacking some of the issues that are still there when integrating it with meteor.
评论 #9962844 未加载
therealmarv将近 10 年前
For me the biggest difference is browser support. With React many libraries I have seen you can get pretty much running with IE9+ (often also IE8). In comparison Polymer: You need more or less the newest IE browser to get it working fully: <a href="https:&#x2F;&#x2F;github.com&#x2F;WebComponents&#x2F;webcomponentsjs#browser-support" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WebComponents&#x2F;webcomponentsjs#browser-sup...</a><p>At the moment I also see that React has the bigger community&#x2F;ecosystem but this may change in the near future?!