On Wednesday, September 11, 2013 3:10:56 AM UTC+2, Goktug Gokdogan wrote: > > I recently noticed that developers are forking c.g.gwt.useragent in order > to be able to add new browser permutations to existing ones. This is > suboptimal and causes code duplication and possibly trying keep it in sync > with the original during updates. > The root cause of this is the determination of user.agent during runtime > is statically defined in this package. I created a patch so that code > snippets to extract user agent can be defined and injected from outside so > that new permutations can be added externally without forking the original > package. > > If you hit this issue before, please take a look at > https://gwt-review.googlesource.com/4500 and see if would make your life > easier. >
Not opposed to it in principle, but adding a new user.agent is not an easy task, and more often than not people actually want to add a new property to be used in conjunction to user.agent in deferred-binding rules (e.g. https://code.google.com/p/google-web-toolkit/wiki/ConditionalProperties#Example_2:_Avoiding_permutation_explosion); so I'm not sure this is the right move, as it makes it easier to do things the wrong way. As a side note, I think we should add a way to "alias" property values so we can progressively rename "gecko1_8" to "gecko" and possibly "safari" to "webkit" [1] without breaking anyone. I think this can be "faked" today using fallback-value and excluding the fallback value from the possible values (i.e. <extend-property name="user.agent" value="gecko" fallback-value="gecko1_8"/><set-property name="user.agent" value="ie6,ie8,ie9,gecko,safari,opera"/> notice the absence of "gecko1_8" here but thanks to the fallback-value, <if-property-is name="user.agent" value="gecko1_8"/> should continue to work and match the "gecko" permutation) but we cannot <set-property> the user.agent property in GWT proper as it would break those who new values and expect the set of "possible values" to automatically grow with their new value. [1] Daniel thinks we should add a "chromium" permutation –he said "blink", but I believe "chromium" would be a better name: it's not only about the rendering engine, but also the JS engine–, I know "webkit" can be used with other JS engines than JavaScriptCore but I'm unsure anyone would do it nowadays, and "webkit" probably still better matches reality than "safari". -- http://groups.google.com/group/Google-Web-Toolkit-Contributors --- You received this message because you are subscribed to the Google Groups "GWT Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
