PeteGashek / puzzlebazar

Automatically exported from code.google.com/p/puzzlebazar
0 stars 0 forks source link

Use the standard gin.jar #87

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It looks like the AsyncProvider<> patch will soon be making it into gin.jar. 
We should migrate back to using and drop the external folder.

Information on:
http://code.google.com/p/google-gin/issues/detail?id=61

Original issue reported on code.google.com by philippe.beaudoin on 23 Mar 2010 at 5:39

GoogleCodeExporter commented 8 years ago
Talking about gin, there's something that will come in the future that will 
make our 
life a lot easier... again !

Tey're talking about something like your bundle provider, but out of the box ! 
So, a 
presenter that already been called once by asyncprovider will be called 
normally by 
another view without any trouble.

I'll be looking forward to this since for now, I didn't needed a bundle 
provider like 
yours, but I think I'll have to do something like this in a near future. I 
really hope 
they'll not wait a year before doing this.

http://codereview.appspot.com/646042/show

Original comment by goudreau...@gmail.com on 24 Mar 2010 at 1:46

GoogleCodeExporter commented 8 years ago
Re: "So, a presenter that already been called once by asyncprovider will be 
called normally by another view 
without any trouble."

I believe this is already the case. What ProviderBundle tries to solve is a 
different problem. I go into more 
details here:
http://code.google.com/p/puzzlebazar/wiki/MvpArchitecture#Too_many_split_points?

But let me try to explain it differently. The problem is that if some piece of 
code sits behind two different 
split points, then it is thrown in the "left over": a collect-all piece of 
javascript that can grow quite 
big, increasing the loading time of the first split point that needs it, 
usually near the initial fragment. 
(Read the "dependencies" section there for more details: 
http://code.google.com/webtoolkit/doc/latest/DevGuideCompileReport.html ) 

Now, AsyncProvider makes it easy to introduce so many split points that large 
pieces of the code will be 
thrown in the left over. Sometimes this can be solved by using AsyncProvider<> 
on the common resource. For 
example, if two code-splat presenters use the same PresenterWidget, you might 
want to give them an 
AsyncProvider<> to that PresenterWidget.

At other times, though, this solution is not convenient. For example, when both 
presenters rely on a complex 
data structure from java.util in which you cannot add code splitting (you could 
build your own code-splat 
wrapper around it, though). Another example would be two presenters using a 
heavy custom widget that you 
create with UiBinder, making it impossible to code split the widget itself. In 
these situations, it might be 
better to use a ProviderBundle<> to _reduce_ the number of split points by 
making the two culprit presenters 
sit behind the same split point.

This problem could probably be solved in GWT itself, if it were more 
"intelligent" about how it introduces 
split points. For example, it could automatically detect that a piece of code 
is used in a small fraction of 
the split points and provide an extra "custom left over" just for this. This 
would make ProviderBundle 
relatively obsolete. I haven't followed the discussions on the GWT board so I'm 
not sure if this is planned 
or not...

I've read the linked code review and I'm not sure where you think GIN is 
planning something like this. In all 
cases, I believe this is too "high level" for GIN and should be left to the 
user. (As opposed to 
AsyncProvider which just cannot be done in user code.) 

You might not need ProviderBundle now, but when you start analyzing your 
compile report, it may become a 
useful tool.

Original comment by philippe.beaudoin on 24 Mar 2010 at 4:36

GoogleCodeExporter commented 8 years ago
I maybe have misunderstood what they where saying and I also think that your 
bundle 
provider is perfect for the job too.

But thanks for the deeper explanation, it helps a lot !

Original comment by goudreau...@gmail.com on 24 Mar 2010 at 5:14

GoogleCodeExporter commented 8 years ago
Moved to GWTP:
http://code.google.com/p/gwt-platform/issues/detail?id=10

Original comment by philippe.beaudoin on 27 Mar 2010 at 6:03

GoogleCodeExporter commented 8 years ago
Done. The new gin-r137.jar is now used in puzzlebazar. I will make it available 
also 
on GWTP.

Original comment by philippe.beaudoin on 30 Mar 2010 at 11:07