Live data from Hacker News

Material design with Polymer

polymer-project.org

31–40 of 47 posts

Re: Material design with Polymer

#33
post #10

Where does Polymer stand in relation to React.js from Facebook?

They're only similar in that they're both for building component based DOM UI. Polymer is tied into the WebComponents standardization effort (also driven by google-related people). Pieces of the DOM are managed by relatively small, contained objects that maintain their own internal state and keep the DOM in sync. It achieves component state synchronization via data binding like Angular or Ember and some sort of KVO m…

As much as I want to like web components, Google's behavior with this new "standard" has been very suspect. The "intent to ship" thread from February this year is something everyone should check out.

Here is Maciej Stachowiak's response to Google's irresponsibility on the intent to ship announcement:

http://lists.w3.org/Archives/Public/www-style/2014Feb/0103.h...

Shoehorning more and much junk into HTML, a markup language with only two types, strings and children, will likely result in bad juju. It may be great for setting things up declaratively, but not for controlling something with state that changes over time. It will serve to reduce what's possible instead of enabling others to explore ideas on the web that are currently only possible in native.

What we need is a low-level retain mode scene graph with a JavaScript API. DOM is a pretty inadequate replacement for a real scene graph. DOM is simply too costly to manipulate and re-arrange and I don't see what WebComponents does to fix that problem.

This might delay the crisis the web feels relative to native, but will just punt the problem a few years down the road at best.

Lastly, some required reading for anyone who wants to educate themselves on the Shadow DOM:

http://acko.net/blog/shadow-dom/

Re: Material design with Polymer

#34
post #25

Earlier quoted context omitted.

Haven't tried it but you can integrate React with pretty much anything. Looking at the Polymer lifecycle methods[1], I'd start by trying a `React.renderComponent` in Polymer's `domReady` callback for an element and then setState/setProps/forceUpdate in the `attributeChanged` callback. [1] http://www.polymer-project.org/docs/polymer/polymer.html#lif... That said, I don't expect it to be common since you'd basically be…

Yeah, what I'd want is the polymer "look and feel" and the react update model... doesn't seem like that's possible.

Completely agree that the Polymer Material "look and feel" is really nice and well thought out. The WebComponents ideas it is based on gives me the jibblies though.

You could do the polymer look and feel with the react update model via famo.us (disclaimer: I work for famo.us). Famo.us also plays pretty nicely with Ember.js (tutorials coming soon) and React.js.

Re: Material design with Polymer

#35
post #3

Looks good but runs extremely slow on my phone (LG G2)

Clearly you need a more modern phone.

Clearly software should be written more efficiently so that his phone is still capable. The LG G2 is a two year old smartphone. It's pretty unacceptable that something doesn't run well on it, so long as the underlying software (operating system and browsers) are up to date.

Re: Material design with Polymer

#36
post #17

On one hand, I worry that Google is monopolizing the future of the web, but on another, I'm glad because they are effective at producing the features that us developers want. I have mixed feelings about Polymer, currently its high browser requirements make it too radical to use at work (IE, Firefox & Safari be broken yo), but forward enough to get me experimenting with it on my personal projects. At the workplace, I'…

I love the look and feel that went into the design of Material here, but with respect to web components, we should be worried that Google is monopolizing the future of the web. See my comment below: https://news.ycombinator.com/item?id=7947119

It bugs me that Polymer is being marketed as "polyfills", since the term polyfill generally tends to connote something that fills in for an already agreed upon w3c standard that will appear in all user agents eventually. Whereas web components and shadow dom is still very much in the proposal/experimentation stage and has a ways to go before reaching standardization. There are still some disagreements to be resolved by all those that contribute code to the major user agents.

Calling polymer a polyfills library is misleading and an abuse of the intent of the term polyfill [0].

Also related: "Apple Removes Shadow DOM from Safari"[1][2]

[0] http://remysharp.com/2010/10/08/what-is-a-polyfill/

[1] http://trac.webkit.org/changeset/164131

[2] https://news.ycombinator.com/item?id=7243122

Re: Material design with Polymer

#37
post #21

In Polymer ajax is an element: https://github.com/PolymerLabs/polymer-ajax/blob/master/test...

What a strange strange choice. Instead of moving responsibilities to a imperfect but very flexible turing-complete language (javascript), they are trying to shoehorn everything into a markup language originally designed as an abstraction for documents (html). I liked a lot of what I saw in the project, but this "ajax as an element" makes me want to facepalm, or at least scratch my head and wonder "why?!?" Can someone…

I'm sure I want to defend this particular implementation without looking at it more but 'declarative' is quite a nice programming style as long as you can easily override it with 'proper' code when you hit it's limits - see Django's models, forms, admin etc.

Re: Material design with Polymer

#38
post #37

Earlier quoted context omitted.

What a strange strange choice. Instead of moving responsibilities to a imperfect but very flexible turing-complete language (javascript), they are trying to shoehorn everything into a markup language originally designed as an abstraction for documents (html). I liked a lot of what I saw in the project, but this "ajax as an element" makes me want to facepalm, or at least scratch my head and wonder "why?!?" Can someone…

I'm sure I want to defend this particular implementation without looking at it more but 'declarative' is quite a nice programming style as long as you can easily override it with 'proper' code when you hit it's limits - see Django's models, forms, admin etc.

Totally agree with declarative code that can be overridden with "proper" code. However in this particular instance, the declarative API in HTML for getting a resource at a particular URI already exists in the form of the "href" property. I don't understand what AJAX here adds at all, since it's not congruous with the semantics of the term AJAX -> "Asynchronous Javascript and XML". There is no javascript there. There's no notion of "asynchronicity" in a declarative interface since async connotes flow control. And the XML (part) used to refer to the original data structure format that was retrieved, whereas most people these days use JSON and even this example uses JSON.

It's not even clear from this example, what is done with the JSON data fetched here. It's not assigned to a variable or returned by a callback. The script below the element in fact uses globals to access the code, since that is basically what `document.querySelector` does. Putting stuff in the DOM is the equivalent of saving all your variables on the window object and then accessing them with `window.myDomElement`, but in a more verbose, indirect and non-performant way.

    var ajax = document.querySelector('polymer-ajax');
    ajax.addEventListener("polymer-response", function(event) {
        assert.isTrue(event.detail.response.feed.entry.length > 0);
        done();
    });
Furthermore, I noticed in some of the markup elements, the addition of a "url" property. How does "url" differ from "href", especially, when all the examples I saw had URIs pointing to *.html hypertext documents. Is "url" a new property that exists in a standard somewhere? If not, I was under the impression that non-standard HTML properties are supposed to be prefixed.

Re: Material design with Polymer

#39

Earlier quoted context omitted.

Clearly you need a more modern phone.

Clearly software should be written more efficiently so that his phone is still capable. The LG G2 is a two year old smartphone. It's pretty unacceptable that something doesn't run well on it, so long as the underlying software (operating system and browsers) are up to date.

I suppose the comment before yours is sarcastic, but yeah you are talking about the real issue here.

Re: Material design with Polymer

#40
It's very strange that when you click or touch down on a button, the shadow spreads out more, as though the button got further away from the underlying surface. It seems like any "press down" sort of action should, well, make it appear to move down, not up.
Post reply on HN