How exactly to use ProxyCodeSplitBundle

53 views
Skip to first unread message

Sandeep Khode

unread,
Sep 12, 2015, 1:36:29 AM9/12/15
to GWTP
We are having too much code split points in our code. Now we want to bundle the code split points. 
  1. We converting @ProxyCodeSplit to @ProxyCodeSplitBundle for the proxy presenter.
  2. We are using ProviderBundle to extend our Bundle class which contains array of all the providers.
Are these steps sufficient to get this working? What are the steps missing?

Maxime Mériouma-Caron

unread,
Sep 13, 2015, 5:07:32 PM9/13/15
to GWTP
Are you using your own Ginjector, or you let GWTP generate the Ginjector with the ApplicationController? If you are not using your own Ginjector, GWTP generates all the ProviderBundles for you. You simply need to add the @ProxyCodeSplitBundle("TheNameOfTheBundle") annotations on your proxies. The String parameter is the name of the bundle. Each proxy annotated with the same String value will be bundled together.
Message has been deleted

Sandeep Khode

unread,
Sep 14, 2015, 1:18:05 AM9/14/15
to GWTP
We have our own Ginjector. Following is my code snippet:
public class MyProviderBundle
    extends ProviderBundle
{
    /**
     */
    public final static int ID_Object1 = 0;

    /**
     */
    public final static int BUNDLE_SIZE = 1;

    /**
     * Constructor
     */
    @Inject
    public MyProviderBundle( final Provider<MyApplicationPresenter> object1Provider )
    {
        super( MyProviderBundle.BUNDLE_SIZE );
        providers[MyProviderBundle.ID_Object1] = object1Provider;
    }
}

--------------------------------------------
MyApplicationPresenter 
    /**
     * Proxy interface
     */
     //@ProxyCodeSplit
    @ProxyCodeSplitBundle( bundleClass = MyProviderBundle.class, id = MyProviderBundle.ID_Object1 )
    @NameToken( NameTokens.MYAPP )
    public interface MyProxy
        extends Proxy<MyApplicationPresenter>
    {
        //

Maxime Mériouma-Caron

unread,
Sep 19, 2015, 12:19:26 PM9/19/15
to GWTP
First of all, are you having issues with the code you posted? You can confirm the split points and bundles by passing the following parameters to the GWT compiler : -compileReport and -XsoycDetailed. Those will generate a report in extras/[moduleName]/soycReport/compile-report/. You can take a look at http://www.gwtproject.org/doc/latest/DevGuideCompileReport.html for more details on the compilation report.

Please post back the result of the report.
Reply all
Reply to author
Forward
0 new messages