Google GWT 跨浏览器支持:是 BS 吗? [英] Google GWT cross-browser support: is it BS?

查看:17
本文介绍了Google GWT 跨浏览器支持:是 BS 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 FlashBuilder 中开发了一个浏览器部署的全文搜索应用程序,它与远程网络服务器以 REST 方式进行通信.该软件适用于一个很小的利基市场——它用于古代语言而不是现代语言,我不可能通过它赚钱,但我确实花了很多时间在它上面.

既然 Apple 不允许在 iPad 上使用 Flash,我正在寻找 100% javascript 解决方案,并因此考虑使用 GWT.它看起来很有希望,但作为 GWT 可以做什么的一个典型例子展示"的应用程序之一在他们的网站上有这个免责声明(名称{removed}以保护可能无辜的人):

<前>您当前的网络浏览器 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)AppleWebKit/532.5(KHTML,像 Gecko)Chrome/4.1.249.1045 Safari/532.5) 不受官方支持{公司和产品名称在这里}.如果您在使用本网站时遇到任何问题请安装 Microsoft Internet Explorer 6+ 或 Mozilla Firefox 3.5+在联系 {product name was here} 支持之前.

当 Chrome 不正式"支持 GWT 应用程序时,会出现什么情况?对于跨浏览器支持,您会给 GWT 什么等级(A、B、C、D、F)?对于没有得到这种字母等级的人来说,A是优秀",F"是不及格,C"是一般.

感谢您的意见.

解决方案

所有基本的 GWT 小部件都是跨浏览器兼容的 - 这是通过名为 延迟绑定(并非总是如此,但适用于最大的罪犯;)).基本上,它允许根据客户端使用的浏览器无缝替换"一个类(此交换在编译期间完成).这允许为所有符合标准的浏览器编写一个 Widget,然后为你知道的人提供一个专门的版本(延迟绑定也用于 i18n 和其他很酷的东西,比如 依赖注入).延迟绑定的另一个很酷的事情是客户端只将 Web 应用程序的特定版本下载到他/她的浏览器.因此,Firefox/Opera/Chrome/WebKit 用户不必下载所有使网络应用程序在 IE 上运行的额外技巧.

长话短说:GWT 为开发人员提供了创建跨浏览器 Web 应用程序的工具/方法(并且它试图通过提供跨浏览器的基本小部件来使该过程尽可能简单开箱即用的浏览器)- 是否使用这些工具取决于开发人员;)

PS:同样的问题可能会被问到关于 jQuery/mootools/etc 的问题——为什么这些框架声称可以在所有浏览器上运行,但有许多站点/网络应用程序使用它们并且不支持所有这些浏览器?因为开发人员选择了这样做.为了使其在垂死的(希望如此)浏览器上运行而削弱网络应用程序/网站可能并不值得.

I developed a browser-deployed full-text search app in FlashBuilder which communicates RESTfully with a remote web-server. The software fits into a tiny niche--it is for use with ancient languages not modern ones, and there's no way I'm going to make any money on it but I did spend a lot of time on it.

Now that Apple won't allow Flash on the iPad, I'm looking for a 100% javascript solution and was led to consider GWT. It looked promising, but one of the apps being "showcased" as a stellar example of what can be done with GWT has this disclaimer on their website (names {removed} to protect the possibly innocent) :

Your current web browser (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)
 AppleWebKit/532.5 (KHTML, like Gecko) 
Chrome/4.1.249.1045 Safari/532.5) is not officially supported by 
{company and product name were here}. If you experience any problems using this site
 please install either Microsoft Internet Explorer 6+ or Mozilla Firefox 3.5+ 
before contacting {product name was here} Support.

What gives when GWT apps aren't "officially" supported on Chrome? What grade (A, B, C, D, F) would you give to GWT for cross-browser support? For folks who don't get these kinds of letter grades, A is "excellent" and "F" is failure, and "C" is average.

Thanks for your opinions.

解决方案

All of the base GWT Widgets are cross-browser compatible - this has been achieved by something called Deferred Binding (not always, but for the biggest offenders ;)). Basically, it allows a seamless "replacement" of one class with another, based on the browser that the client is using (this swap is done during the compilation). This allows to write a Widget for all the standard-compliant browsers and then provide a specialized version for you-know-who (deferred binding is also used for i18n and other cool things, like dependency injection). Another cool thing about Deferred Binding is that the client only downloads the version of the web app specific to his/her browser. So a Firefox/Opera/Chrome/WebKit user doesn't have to download all those additional hacks that make the web app work on IE.

Long story short: GWT provides tools/means for the developer to create a cross-browser web application (and it tries to make that process as easy as possible by providing basic Widgets that are cross-browser out of the box) - it's up to the developer to use those tools - or not ;)

PS: The same question could be asked about jQuery/mootools/etc - why is it that these frameworks claim to work on all browsers and yet there are many sites/web apps that use them and do not support all those browsers? Because the developers chose so. It might not have been worth it to cripple the web application/site just so that it works on a dying (hopefully) browser.

这篇关于Google GWT 跨浏览器支持:是 BS 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆