Hi Pierre,

Response from Ray Cromwell on our internal mailing list:

Could this be a result of the new PersistentUnitCache / generator caching
stuff?

Typically in GWT, people have two different Generator implementations,
so there would be a MyGeneratorFirefoxImpl and a
MyGeneratorDefaultImpl. Each would write out a differently named file
(e.g. GeneratedFileFirefox.java and GeneratedFileDefault.java).  I'm
wondering if somehow by having only a single generator and "branching"
inside of it by looking at selection variables, it's messing up some
assumptions.

Also, Soft Permutations would cause this, so make sure those are not on.

Does that help?

/dmc

On Tue, Sep 27, 2011 at 4:51 PM, Pierre Coirier <[email protected]> wrote:

> I added logs to my generator and it seems the generator is called when
> it is supposed to (aka only once for each permutation with the right
> value for myProperty):
> Computing all possible rebind results for
> 'com.mvp4g.client.Mvp4gModule'
>         Rebinding com.mvp4g.client.Mvp4gModule
>            Invoking generator com.mvp4g.util.Mvp4gGenerator
>               User.agent: 'gecko1_8, ginModule=com$mvp4g$example
> $client$FirefoxGinModule
>               2409 classes scanned in 22 ms.
>               Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_79617565
>               Generating source for
> com.mvp4g.client.Mvp4gModuleImpl_79617565
>               Mvp4g Compilation: 232ms.
>         Rebinding com.mvp4g.client.Mvp4gModule
>            Invoking generator com.mvp4g.util.Mvp4gGenerator
>               User.agent: 'ie6, ginModule=com$mvp4g$client
> $DefaultMvp4gGinModule
>               2409 classes scanned in 18 ms.
>               Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>               Generating source for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>               Mvp4g Compilation: 77ms.
>         Rebinding com.mvp4g.client.Mvp4gModule
>            Invoking generator com.mvp4g.util.Mvp4gGenerator
>               User.agent: 'ie8, ginModule=com$mvp4g$client
> $DefaultMvp4gGinModule
>               2409 classes scanned in 11 ms.
>               Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>               Mvp4g Compilation: 23ms.
>         Rebinding com.mvp4g.client.Mvp4gModule
>            Invoking generator com.mvp4g.util.Mvp4gGenerator
>               User.agent: 'ie9, ginModule=com$mvp4g$client
> $DefaultMvp4gGinModule
>               2409 classes scanned in 8 ms.
>               Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>               Mvp4g Compilation: 121ms.
>         Rebinding com.mvp4g.client.Mvp4gModule
>            Invoking generator com.mvp4g.util.Mvp4gGenerator
>               User.agent: 'opera, ginModule=com$mvp4g$client
> $DefaultMvp4gGinModule
>               2409 classes scanned in 7 ms.
>               Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>               Mvp4g Compilation: 73ms.
>         Rebinding com.mvp4g.client.Mvp4gModule
>            Invoking generator com.mvp4g.util.Mvp4gGenerator
>               User.agent: 'safari, ginModule=com$mvp4g$client
> $DefaultMvp4gGinModule
>               2409 classes scanned in 18 ms.
>               Generating writer for
> com.mvp4g.client.Mvp4gModuleImpl_A1473246115
>               Mvp4g Compilation: 32ms.
>
> but when I look at the soyc report, I can tell that both
> implementations are used for each permutation to calculate the
> fragments for code splitting. Any idea why?
>
> Thanks,
> Pierre
>
>
> On Sep 27, 8:35 am, Pierre Coirier <[email protected]> wrote:
> > Thanks for pointing that out. It was a typo error, in my code I do
> > have myProperty = value2.
> >
> > If it helps, you can find the code that I'm using to reproduce the
> > error:http://mvp4g.googlecode.com/svn/temp/gwt-example.zipand the
> > soyc report:http://mvp4g.googlecode.com/svn/temp/compile-report.zip
> >
> > When you look at the report, you do see the expected deferred property
> > set:
> > Permutation 0 ('myProperty' : 'value1' , 'user.agent' : 'gecko1_8')
> >
> > but clicking on the Slip Point Report, you see the 2 implementations
> > generated are here whereas only one is expected.
> >
> > Pierre
> >
> > On Sep 27, 8:00 am, Paul Robinson <[email protected]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > I don't know the answer to your question, but there is a mistake in the
> gwt.xml fragment you posted. You assign myProperty=value1 when user.agent
> equals FF and also when user.agent is not FF. You never assign myProperty =
> value2.
> >
> > > HTH
> > > Paul
> >
> > > On 27/09/11 05:37, Pierre Coirier wrote:
> >
> > > > Hi,
> >
> > > > I got an issue with deferred property and code splitting.
> >
> > > > In my GWT configuration file, I have defined the following property:
> > > > <define-property name="myProperty" values="value1,value2" />
> > > > <set-property name="myProperty" value="value1">
> > > >    <when-property-is name="user.agent" value="gecko1_8" />
> > > > </set-property>
> > > > <set-property name="myProperty" value="value1">
> > > >    <none>
> > > >      <when-property-is name="user.agent" value="gecko1_8" />
> > > >    </none>
> > > > </set-property>
> >
> > > > and I have a generator with the following code that generates one
> > > > implementation depending on this deferred property value:
> >
> > > > public String generate( TreeLogger logger, GeneratorContext context,
> > > > String typeName ) throws UnableToCompleteException {
> > > >      String value = propertyOracle.getSelectionProperty( logger,
> > > > "myProperty" );
> > > >      if("value1".equals(value)){
> > > >          return generateImpl1();
> > > >      } else {
> > > >          return generateImpl2();
> > > >      }
> > > > }
> >
> > > > According to my settings for each browser, you can have only one
> > > > value, ie for each permutation my generator should generate either
> > > > Impl1 or Impl2 but not both. However in my soyc report, I noticed
> that
> > > > for each browser/permutation, both implementations are generated.
> >
> > > > The issue I have is that my generator generates the same GWT.runAsync
> > > > call for both implementation and since the 2 implementations are
> > > > generated for each permutation (even if only one can be used for each
> > > > permutation), GWT believes there are 2 split points and since it's
> the
> > > > same code inside the 2 split points, all the code is added to the
> left
> > > > fragment code.
> >
> > > > My question is how come my generator is called twice for each
> > > > permutation? Since only one value is possible for each permutation
> > > > shouldn't it be called only once? Am I doing something wrong in my
> > > > configuration which could explain why my generator is called twice?
> >
> > > > Thanks for your help,
> > > > Pierre
>
> --
> 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.
>
>


-- 
David Chandler
Developer Programs Engineer, GWT+GAE
w: http://code.google.com/
b: http://turbomanage.wordpress.com/
b: http://googlewebtoolkit.blogspot.com/
t: @googledevtools

-- 
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.

Reply via email to