Revision: 6957 Author: br...@google.com Date: Tue Nov 17 10:56:40 2009 Log: Edited wiki page through web user interface. http://code.google.com/p/google-web-toolkit/source/detail?r=6957
Modified: /wiki/GWT_2_0_RC.wiki ======================================= --- /wiki/GWT_2_0_RC.wiki Mon Nov 16 19:48:40 2009 +++ /wiki/GWT_2_0_RC.wiki Tue Nov 17 10:56:40 2009 @@ -2,19 +2,114 @@ = Getting Started with GWT 2.0 RC1 = +<i> +Before using GWT 2.0 RC1, please understand that it is still a release candidate and will likely change before its official release. +We do not recommend using this release candidate build for production applications. +</i> + This release contains big changes to improve developer productivity, make cross-browser development easier, and produce faster web applications. -=== Things that are changing with GWT 2.0 that might otherwise be confusing without explanation === - * Terminology changes: We're going to start using the term "development mode" rather than the old term "hosted mode." - * The term "hosted mode" was sometimes confusing to people, so we'll be using the more descriptive term "development mode" from now on. For similar reasons, we'll be using the term "production mode" rather than "web mode" when referring to compiled script. - * Changes to the distribution: Note that there's only one download, and it's no longer platform-specific. You download the same zip file for every development platform. This is made possible by the new plugin approach used to implement development mode (see below). The distribution file does not include the browser plugins themselves; those are downloaded separately the first time you use development mode in a browser that doesn't have the plugin installed. - -=== Major New Features === - * In-Browser Development Mode: Prior to 2.0, GWT hosted mode provided a special-purpose "hosted browser" to debug your GWT code. In 2.0, the web page being debugged is viewed within a regular-old browser. Development mode is supported through the use of a native-code plugin called the "Google Web Toolkit Developer Plugin" for many popular browsers. In other words, you can use development mode directly from Safari, Firefox, IE, and Chrome. - * Code Splitting: Developer-guided code splitting using GWT.runAsync(), along with compile reports (also known as <a href="http://code.google.com/events/io/2009/sessions/StoryCompilerGwtCompiler.html">The Story of Your Compile</a>) allows you to chunk your GWT code into multiple fragments for faster startup. Imagine having to download a whole movie before being able to watch it. Well, that's what you have to do with most Ajax apps these days -- download the whole thing before using it. With code splitting, you can arrange to load just the minimum script needed to get the application running and the user interacting, while the rest of the app is downloaded as needed. - * Declarative User Interface: GWT's <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/uibinder/client/UiBinder.html">!UiBinder</a> now allows you to create user interfaces mostly declaratively. Previously, widgets had to be created and assembled programmatically, requiring lots of code. Now, you can use XML to declare your UI, making the code more readable, easier to maintain, and faster to develop. The Mail sample has been updated to show a practical example of using !UiBinder. - * Bundling of resources via <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/resources/client/ClientBundle.html">!ClientBundle</a>. GWT introduced <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/ui/ImageBundle.html">!ImageBundle</a> in 1.4 to provide automatic spriting of images. !ClientBundle generalizes this technique, bringing the power of combining and optimizing resources into one download to things like text files, CSS, and XML. This means fewer network round trips, which in turn can decrease application latency -- especially on mobile applications. - * Using !HtmlUnit for running test cases based on <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/junit/client/GWTTestCase.html">GWTTestCase</a>: Prior to 2.0, GWTTestCase relied on SWT and native code versions of actual browsers to run unit tests. As a result, running unit tests required starting an actual browser. As of 2.0, GWTTestCase no longer uses SWT or native code. Instead, it uses !HtmlUnit as the built-in browser. Because !HtmlUnit is written entirely in the Java language, there is no longer any native code involved in typical test-driven development. Debugging GWT Tests in development mode can be done entirely in a Java debugger. +== Downloading and Installing GWT 2.0 RC1 SDK == +No installation process is required to use the GWT SDK; simply unzip it into any convenient directory. + +<blockquote> +<a href="http://google-web-toolkit.googlecode.com/files/gwt-2.0.0-rc1.zip">Download GWT 2.0 RC1</a> +</blockquote> + +The new debugging support in GWT 2.0, called Development Mode, requires a native browser plugin that will be installed on-demand as you use GWT. +See "Getting Started with Development Mode" below for step-by-step instructions for this process. + +== Downloading and Installing the Google Plugin for Eclipse 1.2 RC1 == +Google Plugin for Eclipse 1.2 RC1 includes functionality to support the new features in GWT 2.0, so if you're an Eclipse users, we highly recommend installing it as well. + +=== Installation Instructions === +Download the Google Plugin for Eclipse 1.2.0 Release Candidate zip distributions for your version of Eclipse: + + * 3.5 (Galileo): <a href="http://dl.google.com/eclipse/plugin/3.5/zips/gpe-e35-1.2rc1.zip">http://dl.google.com/eclipse/plugin/3.5/zips/gpe-e35-1.2rc1.zip</a> + * 3.4 (Ganymede) <a href="http://dl.google.com/eclipse/plugin/3.4/zips/gpe-e34-1.2rc1.zip">http://dl.google.com/eclipse/plugin/3.4/zips/gpe-e34-1.2rc1.zip</a> + * 3.3 (Europa): <a href="http://dl.google.com/eclipse/plugin/3.3/zips/gpe-e33-1.2rc1.zip">http://dl.google.com/eclipse/plugin/3.3/zips/gpe-e33-1.2rc1.zip</a> + +*Note*: Ensure that your version of Eclipse has Eclipse's Web Standard Tools (WST) installed before installing the plugin. WST can be installed by navigating to the Software Installation section, and selecting the the appropriate WST feature from the update site for your version of Eclipse. The update sites and feature names are provided below. + + * 3.5 (Galileo): Galileo -> Web, XML, and Java EE Development -> Eclipse Web Developer Tools + * 3.4 (Ganymede): Ganymede Update Site -> Web and Java EE Development -> Web Developer Tools + * 3.3 (Europa): Europa Discovery Site -> Web and JEE Development -> Web Standard Tools Project + +It is strongly recommended that you install the release candidate on a fresh install of Eclipse and use a clean workspace. + +Finally, follow <a href="http://code.google.com/eclipse/docs/install-from-zip.html">these instructions</a> for installing the plugin from a zip distribution. + +=== Important Notes === +<dl> +<dt>Terminology changes</dt> +<dd> +We're going to start using the term "development mode" rather than the old term "hosted mode." The term "hosted mode" was sometimes confusing to people, so we'll be using the more descriptive term "development mode" from now on. For similar reasons, we'll be using the term "production mode" rather than "web mode" when referring to compiled script. +</dd> + +<dt>Changes to the distribution</dt> +<dd> +Note that there's only one download, and it's no longer platform-specific. You download the same zip file for every development platform. This is made possible by the new plugin approach used to implement development mode (see below). The distribution file does not include the browser plugins themselves; those are downloaded separately the first time you use development mode in a browser that doesn't have the plugin installed. +</dd> +</dl> + +=== Major New Features in the GWT SDK === +<dl> +<dt>In-Browser Development Mode</dt> +<dd> +Prior to 2.0, GWT hosted mode provided a special-purpose "hosted browser" to debug your GWT code. In 2.0, the web page being debugged is viewed within a regular-old browser. Development mode is supported through the use of a native-code plugin called the "Google Web Toolkit Developer Plugin" for many popular browsers. In other words, you can use development mode directly from Safari, Firefox, IE, and Chrome. +</dd> + +<dt>Developer-guided Code Splitting</dt> +<dd> +Code splitting using GWT.runAsync(), along with compile reports (also known as <a href="http://code.google.com/events/io/2009/sessions/StoryCompilerGwtCompiler.html">The Story of Your Compile</a>) allows you to chunk your GWT code into multiple fragments for faster startup. Imagine having to download a whole movie before being able to watch it. Well, that's what you have to do with most Ajax apps these days -- download the whole thing before using it. With code splitting, you can arrange to load just the minimum script needed to get the application running and the user interacting, while the rest of the app is downloaded as needed. +</dd> + +<dt>Declarative User Interfaces with !UiBinder</dt> +<dd> +GWT's <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/uibinder/client/UiBinder.html">!UiBinder</a> now allows you to create user interfaces mostly declaratively. Previously, widgets had to be created and assembled programmatically, requiring lots of code. Now, you can use XML to declare your UI, making the code more readable, easier to maintain, and faster to develop. The Mail sample has been updated to show a practical example of using !UiBinder. +</dd> + +<dt>Bundling of Resources via <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/resources/client/ClientBundle.html">!ClientBundle</a></dt> +<dd> +GWT introduced <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/ui/ImageBundle.html">!ImageBundle</a> in 1.4 to provide automatic spriting of images. !ClientBundle generalizes this technique, bringing the power of combining and optimizing resources into one download to things like text files, CSS, and XML. This means fewer network round trips, which in turn can decrease application latency -- especially on mobile applications. +</dd> + +<dt>Simplified Unit Testing with !HtmlUnit</dt> +<dd> +Using !HtmlUnit for running test cases based on <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/junit/client/GWTTestCase.html">GWTTestCase</a>: Prior to 2.0, GWTTestCase relied on SWT and native code versions of actual browsers to run unit tests. As a result, running unit tests required starting an actual browser. As of 2.0, GWTTestCase no longer uses SWT or native code. Instead, it uses !HtmlUnit as the built-in browser. Because !HtmlUnit is written entirely in the Java language, there is no longer any native code involved in typical test-driven development. Debugging GWT Tests in development mode can be done entirely in a Java debugger. +</dd> +</dl> + +=== Major New Features in the Google Plugin for Eclipse === +<dl> +<dt>Development Mode Launch View</dt> +<dd> +Integrates your Development Mode logs right into Eclipse, which means one less window to shuffle around +</dd> + +<dt>!UiBinder Support</dt> +<dd> +The !UiBinder template editor provides auto-completion and formatting for editing ui.xml files (and embedded CSS blocks)<br/> +Validation of UiBinder templates and backing Java classes<br/> +New UiBinder wizard to quickly get started +</dd> + +<dt>!ClientBundle Support</dt> +<dd> +"New !ClientBundle" wizard to bundle CSS and other resources together to minimize HTTP round-trips<br/> +As-you-type validation ensures that your app's static resources are always in the right place +</dd> + +<dt>RPC Refactoring</dt> +<dd> +Automatically updates sync/async pairs of RPC interfaces and their methods +</dd> + +<dt>JNSI Reference Auto-completion</dt> +<dd> +Auto-completion takes the pain out of referencing Java members from JSNI methods +</dd> +</dl> === Getting Started with Development Mode === ==== Step 1: Start Development Mode ==== @@ -24,9 +119,9 @@ <pre> Using a browser with the GWT Developer Plugin, please browse to the following URL: - http://localhost:8888/Hello.html?gwt.codesvr=192.168.1.42:9997 + `http://192.168.1.42:8888/Hello.html?gwt.codesvr=192.168.1.42:9997` </pre> -(the `192.168.1.42` is simply the IP address of localhost) +(where `192.168.1.42` is your own IP address) </blockquote> That's because you're now in control over which target browser launches and when. @@ -35,6 +130,10 @@ If this is the first time you've ever attempt to use development mode with that browser, you will not yet have the GWT Developer Plugin installed, so you'll see a page that instructs you to install the plugin. Once you download and install the plugin, restart the browser and navigate again to the URL from above, making sure it includes the `gwt.codesvr` query parameter. +<blockquote><i> +When installing the GWT Developer Plugin on Windows 7, certain configurations may require you to explicitly save the installer as a file and then "Run as Administrator". +</i></blockquote> + Note that the first time you access your GWT module from a browser, it may appear to hang momentarily as your module loads. This is normal. Subsequent refreshes within the browser are much faster as long as you keep the development mode session running. ==== Step 3: Follow the Edit/Save/Refresh cycle without restarting development mode ==== @@ -45,12 +144,10 @@ ==== Step 4: Open additional browsers for testing ==== You can open any number of additional browsers to ensure your application behaves properly across browsers. - === Breaking changes and known issues/bugs/problems === * Prior to 2.0, GWT tools such as the compiler were provide in a platform-specific jar (that is, with names like `gwt-dev-windows.jar`). As of 2.0, GWT tools are no longer platform specific and they reside in generically-named `gwt-dev.jar`. You are quite likely to have to update build scripts to remove the platform-specific suffix, but that's the extent of it. * The development mode entry point has changed a few times since GWT 1.0. It was originally called `GWTShell`, and in GWT 1.6 a replacement entry point called `HostedMode` was introduced. As of GWT 2.0, to reflect the new "development mode" terminology, the new entry point for development mode is `com.google.gwt.dev.DevMode`. Sorry to keep changing that on ya, but the good news is that the prior entry point still works. But, to really stay current, we recommend you switch to the new `DevMode` entry point. * Also due to the "development mode" terminology change, the name of the ant build target produced by `webAppCreator` has changed from `hosted` to `devmode`. In other words, to start development mode from the command-line, type `ant devmode`. * !HtmlUnit does not attempt to emulate authentic browser layout. Consequently, tests that are sensitive to browser layout are very likely to fail. However, since GWTTestCase supports other methods of running tests, such as Selenium, that do support accurate layout testing, it can still make sense to keep layout-sensitive tests in the same test case as non-layout-sensitive tests. If you want such tests to be ignored by !HtmlUnit, simply annotate the test methods with @!DoNotRunWith({Platform.!HtmlUnit}). Versions of Google Plugin for Eclipse prior to 1.2 will only allow you to add GWT release directories that include a file with a name like `gwt-dev-windows.jar`. You can fool it by sym linking or copying gwt-dev.jar to the appropriate name. * The way arguments are passed to the GWT testing infrastructure has been revamped. There is now a consistent syntax to support arbitrary "run styles", including user-written, with no changes to GWT itself. For example, `-selenium FF3` has become `-runStyle selenium:FF3`. This change likely does not affect typical test invocation scripts, but if you do use `-Dgwt.args` to pass arguments to GWTTestCase, be aware that you may need to make some changes. - - + * When using !ClientBundle, be aware that images using alpha transparency do not appear transparent in IE6. The Mail sample application included in the GWT distribution currently suffers from this limitation (that is, the images have opaque backgrounds when viewed on IE6). -- http://groups.google.com/group/Google-Web-Toolkit-Contributors