GWT development with Eclipse

↘锁芯ラ 提交于 2020-01-05 04:49:18

问题


I am developing a GWT app using eclipse and I was wondering if there is a way to hot swap client code changes I make without having to do a full Google Compile each time. Currently when I modify my code, I do a Google compile and then click the Reload server button, then I refresh my browser to pick up the changes. This is starting to get a bit painful as it takes 10 - 20 sec to do a full compile when I may have only modified a UI string so was wondered is there a quicker way.


回答1:


If you want to see your changes in client code, hit the refresh button in your browser.

If you need debug functions, use Debug As => Web Application. It may be a little (or a lot) slower to start depending on a browser.

If you don't need debug functionality, use Run As => Web Application. It starts faster. You will still see all errors in Development Mode and Console tabs.

If you make changes to server-side code, you have to reload the web server, using the dedicated button of the dedicated Development Mode view in Eclipse.

You never need to recompile unless the plugin tells you to do it.

See https://developers.google.com/web-toolkit/doc/latest/DevGuideCompilingAndDebugging#DevGuideDevMode




回答2:


To add to Andrei's answer Assuming we are changing functionality invoked on button click.

1) We usually change lines of code in the function invoked and click the button again in the UI. No need of reloaing the entire application using refresh button.

2) If the change involves code that cannot be hotswapped - example class changes like adding new a class variable, then you need to refresh browser. You can sometimes ignore the eclipse warning complaining that it cannot hot-swap.

3) If you run out of memory then you need to close and relaunch dev mode.

4) If your server side is hogging memory then it might be better idea to use external server rather than jetty to avoid time consumed on server restart for every dev mode launch.



来源:https://stackoverflow.com/questions/14802621/gwt-development-with-eclipse

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!