On Tuesday, July 10, 2012 4:45:43 PM UTC+2, Derek wrote: > > > On Tuesday, July 10, 2012 9:47:56 AM UTC-4, Thomas Broyer wrote: >> >> >> Not having permutations "per UA" is not only a compile-time thing, it >> also means you don't have to "sniff" the UA at runtime, so there's no risk >> of false-positives or false-negatives ( >> http://code.google.com/p/google-web-toolkit/issues/detail?id=2938, >> http://code.google.com/p/google-web-toolkit/issues/detail?id=5278, >> http://code.google.com/p/google-web-toolkit/issues/detail?id=6665) and >> supporting a new browser ( >> https://groups.google.com/d/topic/es-operating-system/8oWtRZnDK_w/discussion) >> >> comes for free. >> > > The goal is to only have a single permutation? I thought the multiple > permutation system of GWT was only good (though admittedly I have been > burned by IE9 and 10). Isn't it preferable to not send > -moz-linear-gradient(...) to Chrome and -webkit-linear-gradient(...) to > Firefox? (Same with mozIndexedDB vs webkitIndexedDB.) I thought this made > the code smaller and better tailored than the "this or this or this" style > of coding. >
I think it depends the use cases ;-) Browser sniffing has bad press, and for good reasons. That obviously doesn't mean feature detection has no cost. The thing is: with modern browsers slowly reaching feature parity, the future is in the feature-detection side; differences between browsers are becoming marginal enough than putting them all in the same script with runtime checks doesn't cost that much (BTW, this is the approach used for com.google.gwt.geolocation, com.google.gwt.media, com.google.gwt.storage, etc. with deferred-binding mostly helping in saying "no" in browsers we're sure the feature isn't there) > Also, assuming I go this route, how do I tell GWT to just do one > permutation without UA concerns? I've been working on an app that I was > originally only targeting webkit for (thus <set-property name="user.agent" > value="safari"/>), but nothing in it should necessarily have broken in > Firefox (besides the WebSQL stuff). So I decided to point Firefox to it, > and immediately got an alert saying Firefox wasn't supported, despite the > app working well enough. Obviously it was easy to fix by adding gecko1_8 to > set-property, but how do I create the one permutation to rule them all that > doesn't complain? > To have only one true permutation, you'd have to get rid of everything doing deferred-binding on the user.agent property. You can produce a single script using soft permutations http://code.google.com/p/google-web-toolkit/wiki/SoftPermutations but it only "hides" permutations, it doesn't remove them (browser-sniffing is still there, just moved out of the selection-script down to the permutation scripts). -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/YSbfkr-rZMcJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.