0

I have a gwt app that requires GWT Recaptcha for one of its part. However I don't need it for some parts of my application, and especially on the home "page". Is there a way for it not to load ahead unless the "page" that requires it is the one being opened?

And by "page" I mean a view (as in MVC), in my case I useRecaptchaWidget which is essentially the widget that calls on the RPC for api.recaptcha.net which I can see in the browser when I refresh my application. Clearly its causing some delay in the loading process of views that does not need it.

Is there any way to "lazy" load a widget such that only when the view that instantiates it is called that the widget will be called or even call RPC. Any ideas?

2 Answers 2

2

If your issue is that the widget makes an RPC call as soon as you instantiate it, then, well, don't instantiate it until you need it.

Sign up to request clarification or add additional context in comments.

Comments

2

You should use the Code Splitting It will download part of your code when you need it. Also will improve the starting size of your application, as the user doesn't need to download the whole application at once.

1 Comment

Yes, I've been thinking on how to apply the pattern found in the sample for my case. Which in my case is the View which has the widget is inserted into a HashMap during onModuleLoad.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.