Hello,
yes there's a way to do it, I guess.
Let's say you have block of code launched asynchronously:
GWT.runAsync(new RunAsyncCallback() {
public void onFailure(Throwable caught) {
Window.alert("Code download failed");
}
public void onSuccess() {
ToRemoveComponent.stupidMethodDoingSthMeaningless("DEFERRED_SCRIPT_TO_REMOVE");
Window.alert("Hello, AJAX");
}
});
When you compile the code above it will be easy to find in one of js
files if you search for string DEFERRED_SCRIPT_TO_REMOVE (it should be
unique). I am not sure but I think that used method cannot be empty
because gwt compiler can make some optimization by removing empty
method. Maybe marking it as native one is the way to go.
I can't check it right now so please let me know when you try this
approach.
Good luck,
Janusz Prokulewicz
On 15 Lis, 22:59, Burly Jez <[email protected]> wrote:
> Hi GWT peeps,
>
> I have a debug-only panel which I want to remove from my production
> deployment.
>
> I've used code splitting and sure enough, I can remove the deferred-js
> from the final war and everything is rosy.
>
> But what if I want to split other things, like deferring the main UI
> code until after login? Is there a way to decorate splitting-points in
> some way so I can delete the right code?
>
> Thanks in advance for any help!
>
> Jason
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.