Code splitting

9 views
Skip to first unread message

PhilBeaudoin

unread,
Mar 3, 2010, 8:30:03 PM3/3/10
to PuzzleBazar-Dev
I've added support for code splitting directly within the framework.
This makes it very easy to efficiently split large part of your code.

If you want to use this feature, you will need the AsyncProvider<>
patch for GIN, which is described in http://code.google.com/p/google-gin/issues/detail?id=61
and available in puzzlebazar source tree. You can still use
puzzlebazar MVP framework without this patch. However you will have to
do code splitting manually (or not at all).

The following wiki page gives a complete description of the code
splitting mechanism available in the framework:
http://code.google.com/p/puzzlebazar/wiki/MvpArchitecture and
available

Hope you like it!

Jotap

unread,
Mar 11, 2010, 5:15:24 AM3/11/10
to PuzzleBazar-Dev
Hi Phil,

congrads on great framework and also for sharing it. I am also trying
to merge it into a small custom project.

I have been successfully following your changes until the last major
GIN change and now am having an issue building apps client module to
build now.

Up to now i have been merging your changes into latest GIN source and
building a jar and mounting that into my project (using netbeans and
was having trouble using GIN gwt module directly in my project). All
working nicely but since the new changes i keep getting a

java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:
260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
319)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:
260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
319)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:
260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:
276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
319)
at
com.sourcelabs.ubuild.client.gin.UBuildClientModule.configure(UBuildClientModule.java:
81)
at
com.google.gwt.inject.client.AbstractGinModule.configure(AbstractGinModule.java:
31)
at
com.google.gwt.inject.rebind.adapter.GinModuleAdapter.configure(GinModuleAdapter.java:
40)
at com.google.inject.spi.Elements
$RecordingBinder.install(Elements.java:223)
at com.google.inject.spi.Elements.getElements(Elements.java:
101)
at com.google.inject.spi.Elements.getElements(Elements.java:
92)

when it tries to bind either

bind(ChangeMonitor.class).to(DefaultChangeMonitor.class).in(Singleton.class);

or

bindPresenterWidget(NewsItemPresenter.class,
NewsItemPresenter.MyDisplay.class, NewsItemView.class);

I assume it is related to not building my app with modifed GIN source
within my project like i see your doing and not using jar but just
wondering have you encountered something similar or any ideas?


On Mar 4, 1:30 am, PhilBeaudoin <philippe.beaud...@gmail.com> wrote:
> I've added support for code splitting directly within the framework.
> This makes it very easy to efficiently split large part of your code.
>
> If you want to use this feature, you will need the AsyncProvider<>

> patch for GIN, which is described inhttp://code.google.com/p/google-gin/issues/detail?id=61

Philippe Beaudoin

unread,
Mar 11, 2010, 12:36:18 PM3/11/10
to puzzleb...@googlegroups.com
I'm not sure I understand your what you do. Are you trying to put all of the puzzlebazar tree in a jar and then use this jar within your own project?

If your project link uses gin-1.0.jar, this will likely fail. The reason is that PuzzleBazar includes the GIN source directly because it relies on the patch http://code.google.com/p/google-gin/issues/detail?id=61. This double inclusion of the GIN package will likely cause trouble.

At this point, you have a number of options:
1) Get rid of your gin-1.0.jar and rely on the GIN classes included in puzzlebazar.
2) Create a jar containing only the mvp folder. This one should work with the unpatched GIN. (Let me know if it works for you, please.)
3) Wait until the patch makes it into GIN (which should be soon), at which point I'll get rid of the source code and use the jar.

I think the cleanest is (2), and this is what I plan on doing on http://code.google.com/p/gwt-platform/ as soon as the codebase stabilizes...

Please let me know of your experiments with these various options.

Cheers,

    Philippe

Jotap

unread,
Mar 12, 2010, 5:48:17 AM3/12/10
to PuzzleBazar-Dev
Philippe ,

thanks for the quick response, but you guessed correctly, the gin
version i am using is gin-1.0.jar and will try the approach suggested
for #2

cheers

Jamie

On Mar 11, 5:36 pm, Philippe Beaudoin <philippe.beaud...@gmail.com>
wrote:


> I'm not sure I understand your what you do. Are you trying to put all of the
> puzzlebazar tree in a jar and then use this jar within your own project?
>
> If your project link uses gin-1.0.jar, this will likely fail. The reason is
> that PuzzleBazar includes the GIN source directly because it relies on the

> patchhttp://code.google.com/p/google-gin/issues/detail?id=61. This double


> inclusion of the GIN package will likely cause trouble.
>
> At this point, you have a number of options:
> 1) Get rid of your gin-1.0.jar and rely on the GIN classes included in
> puzzlebazar.
> 2) Create a jar containing only the mvp folder. This one should work with
> the unpatched GIN. (Let me know if it works for you, please.)
> 3) Wait until the patch makes it into GIN (which should be soon), at which
> point I'll get rid of the source code and use the jar.
>

> I think the cleanest is (2), and this is what I plan on doing onhttp://code.google.com/p/gwt-platform/as soon as the codebase stabilizes...

PhilBeaudoin

unread,
Mar 31, 2010, 7:27:33 PM3/31/10
to PuzzleBazar-Dev, Jotap
Hi Jamie,

The AsyncProvider feature has been added to gin's trunk. You can get
the patched jar from GWTP:
http://code.google.com/p/gwt-platform/

Cheer,

Philippe


On Mar 12, 3:48 am, Jotap <jamie.plo...@gmail.com> wrote:
> Philippe ,
>
> thanks for the quick response, but you guessed correctly, the gin
> version i am using is gin-1.0.jar and will try the approach suggested
> for #2
>
> cheers
>
> Jamie
>
> On Mar 11, 5:36 pm, Philippe Beaudoin <philippe.beaud...@gmail.com>
> wrote:
>
>
>
> > I'm not sure I understand your what you do. Are you trying to put all of the
> > puzzlebazar tree in a jar and then use this jar within your own project?
>
> > If your project link uses gin-1.0.jar, this will likely fail. The reason is
> > that PuzzleBazar includes the GIN source directly because it relies on the
> > patchhttp://code.google.com/p/google-gin/issues/detail?id=61. This double
> > inclusion of the GIN package will likely cause trouble.
>
> > At this point, you have a number of options:
> > 1) Get rid of your gin-1.0.jar and rely on the GIN classes included in
> > puzzlebazar.
> > 2) Create a jar containing only the mvp folder. This one should work with
> > the unpatched GIN. (Let me know if it works for you, please.)
> > 3) Wait until the patch makes it into GIN (which should be soon), at which
> > point I'll get rid of the source code and use the jar.
>

> > I think the cleanest is (2), and this is what I plan on doing onhttp://code.google.com/p/gwt-platform/assoon as the codebase stabilizes...

Reply all
Reply to author
Forward
0 new messages