Java – how do i disable code splitting in GWT?
We have a very large GWT project, resulting in a 2 Mb monolithic application The obvious way to break it is to use split points For example, our application is menu driven, so the logic of each menu operation may be a split point In addition, the code calling GWT RPC can also be a split point In this way, a 2MB application may be decomposed into a 300K startup application, and the rest will be loaded and used for the first time
GWT will be responsible for GWT The call to runasync () is considered to decompose JS into smaller pieces loaded asynchronously at run time For example, to set the split point for calling dosomething (), we write:
GWT.runAsync(new RunAsyncCallback() { public void onFailure(Throwable caught) { Window.alert("Oh dear Could not load app"); } public void onSuccess() { doSomething(); } });
The GWT compiler will see this code and mark it as a candidate to split the code into smaller fragments that will be loaded on first use
The problem we encounter is that if we put the split point into the code, the construction will literally take 10-50 times longer to execute I think this code is not efficient when dealing with projects with many classes Therefore, it is unacceptable for a 2 - minute build to become a 20 - 100 - minute build
So the question is, how do I put the split point into the code, but prevent the compiler from splitting unless I explicitly ask for it? I imagine that day after day development will ignore the split point, but at night or production and construction will split
Any ideas?
Solution
Take - draftcompile as the compiler parameter