-
1. Re: Guava dependency - to drop or not to drop?
It would be nice to remove one more dependency.
Guava is now built into huge number of project classes,
so it won't be trivial task. Some analysis of how much classes are
involved.. anyone?
On Tue, Feb 11, 2014 at 7:07 PM, Cody Lerum
<richfaces-dev@lists.jboss.org>wrote:
This does become a pain point for users as the guava library moves quite
rapidly. and deprecates/removes quickly.
That is fine for user code as I can easily refactor, but if I want to use
a new guava version to get a new features I must occasionally wait for
Guava to to be upgraded in a Richfaces release.
Maybe RF shouldn't depend on Guava or at a minimum shouldn't depend on
anything annotated @Beta as Closables was (
http://docs.guava-libraries.googlecode.com/git-history/v13.0.1/javadoc/index.html
)
Posted by forums
Original post: https://community.jboss.org/message/857179#857179
_______________________________________________
richfaces-dev mailing list
https://lists.jboss.org/mailman/listinfo/richfaces-dev
-
2. Re: Guava dependency - to drop or not to drop?
bleathem Feb 13, 2014 1:34 PM (in response to Lukáš Fryč )On Wed 12 Feb 2014 12:39:46 PM PST, Lukáš Fryč wrote:
It would be nice to remove one more dependency.
+1. I don't like the idea of dropping it altogether though. Many of
the abstractions it introduces are quite useful and lead to cleaner code.
On Tue, Feb 11, 2014 at 7:07 PM, Cody Lerum
<richfaces-dev@lists.jboss.org <mailto:richfaces-dev@lists.jboss.org>>
wrote:
Maybe RF shouldn't depend on Guava or at a minimum shouldn't
depend on anything annotated @Beta as Closables was
(http://docs.guava-libraries.googlecode.com/git-history/v13.0.1/javadoc/index.html)
+1 for sticking to the stable API.
We could re-explore the idea of shading guava into the richfaces jar
under a different package name. The downside here is it would be easy
to forget about upgrading the library, however this would no longer
effect user applications nor interact with leaky containers.
Brian
_______________________________________________
richfaces-dev mailing list
https://lists.jboss.org/mailman/listinfo/richfaces-dev
-
3. Re: Guava dependency - to drop or not to drop?
Agree, until Java 8 arrives to masses, Guava is very useful.
-
Shading is certainly an option.
-
I was wondering how much of Guava code we could strip by limiting to just
the classes we use directly/transitively.
With a minimal compilation (minimizeJar ) results are not convincing:
1437 classes (original guava) -> 919 (minimized guava - limited to only
what we use / use transitively)
Here is a configuration: https://gist.github.com/lfryc/b86d64c2a20843db0ec2
But no one says we do even need to use it minimizeJar.
http://maven.apache.org/plugins/maven-shade-plugin/shade-mojo.html#minimizeJar
On Wed, Feb 12, 2014 at 9:55 PM, Brian Leathem <bleathem@gmail.com> wrote:
On Wed 12 Feb 2014 12:39:46 PM PST, Lukáš Fryč wrote:
It would be nice to remove one more dependency.
+1. I don't like the idea of dropping it altogether though. Many of
the abstractions it introduces are quite useful and lead to cleaner code.
On Tue, Feb 11, 2014 at 7:07 PM, Cody Lerum
<richfaces-dev@lists.jboss.org <mailto:richfaces-dev@lists.jboss.org>>
wrote:
Maybe RF shouldn't depend on Guava or at a minimum shouldn't
depend on anything annotated @Beta as Closables was
(
http://docs.guava-libraries.googlecode.com/git-history/v13.0.1/javadoc/index.html
)
+1 for sticking to the stable API.
We could re-explore the idea of shading guava into the richfaces jar
under a different package name. The downside here is it would be easy
to forget about upgrading the library, however this would no longer
effect user applications nor interact with leaky containers.
Brian
-
4. Re: Guava dependency - to drop or not to drop?
jhuska Feb 13, 2014 1:34 PM (in response to Lukáš Fryč )I have created [RF-13548] Clean using of guava dependency across framework - JBoss Issue Tracker to track cleaning of Guava dependency.
-
5. Re: Guava dependency - to drop or not to drop?
There are currently three issues addressing Guava problem:
https://issues.jboss.org/browse/RF-13247
https://issues.jboss.org/browse/RF-13538
https://issues.jboss.org/browse/RF-13548
On Thu, Feb 13, 2014 at 9:56 AM, Juraj Húska <jhuska@redhat.com> wrote:
I have created Clean using of guava dependency across framework
- JBoss Issue Tracker (https://issues.jboss.org/browse/RF-13548) to track
cleaning of Guava dependency.
Posted by forums
Original post: https://community.jboss.org/message/857439#857439
_______________________________________________
richfaces-dev mailing list
https://lists.jboss.org/mailman/listinfo/richfaces-dev
-
6. Re: Re: Guava dependency - to drop or not to drop?
lfryc Feb 13, 2014 1:46 PM (in response to Lukáš Fryč )Just for information, there is a list of APIs we use:
richfaces5]$ find -name "*.java" -exec grep "import com.google.common" {} \; | sort | uniq -c
14 import com.google.common.base.Function; 4 import com.google.common.base.Joiner; 4 import com.google.common.base.Objects; 3 import com.google.common.base.Objects.ToStringHelper; 12 import com.google.common.base.Predicate; 5 import com.google.common.base.Predicates; 5 import com.google.common.base.Splitter; 36 import com.google.common.base.Strings; 4 import com.google.common.cache.CacheBuilder; 4 import com.google.common.cache.CacheLoader; 4 import com.google.common.cache.LoadingCache; 6 import com.google.common.collect.AbstractIterator; 1 import com.google.common.collect.ArrayListMultimap; 1 import com.google.common.collect.ClassToInstanceMap; 1 import com.google.common.collect.ForwardingIterator; 1 import com.google.common.collect.HashMultimap; 1 import com.google.common.collect.ImmutableClassToInstanceMap; 7 import com.google.common.collect.ImmutableList; 4 import com.google.common.collect.ImmutableMap; 3 import com.google.common.collect.ImmutableMap.Builder; 7 import com.google.common.collect.ImmutableSet; 1 import com.google.common.collect.ImmutableSet.Builder; 17 import com.google.common.collect.Iterables; 23 import com.google.common.collect.Iterators; 1 import com.google.common.collect.LinkedListMultimap; 1 import com.google.common.collect.ListMultimap; 22 import com.google.common.collect.Lists; 1 import com.google.common.collect.MapMaker; 13 import com.google.common.collect.Maps; 3 import com.google.common.collect.Multimap; 1 import com.google.common.collect.MutableClassToInstanceMap; 2 import com.google.common.collect.ObjectArrays; 1 import com.google.common.collect.SetMultimap; 10 import com.google.common.collect.Sets; 3 import com.google.common.collect.UnmodifiableIterator; 1 import com.google.common.io.ByteStreams; 4 import com.google.common.io.Closeables; 1 import com.google.common.io.Files; 1 import com.google.common.io.InputSupplier; 1 import com.google.common.primitives.Primitives; 1 import com.google.common.util.concurrent.ThreadFactoryBuilder;
That just from Framework code, no tests or helper modules, complete enumeration is here: all over the code base
-
7. Re: Re: Guava dependency - to drop or not to drop?
lfryc Feb 13, 2014 1:46 PM (in response to lfryc)Since Pavel asked in JIRA whether we could drop Guava in favor of Java 7, there is an answer:
Code base make use of following APIs:
- functional (Java 8)
- joiners/splitters (none)
- cache builders/loaders (none)
- collections
- multimaps (none)
- auto-closeables (Java 7)
- stream / file manipulation (none)
- ...
-
8. Re: Guava dependency - to drop or not to drop?
lfryc Feb 14, 2014 3:12 AM (in response to lfryc)I agree with Cody that Guava is something what final application developer should decide about.
---
As I said, a re-factoring is not simply addressable at this point,
but I believe we can shade Guava library (even in minimized form) into RichFaces.
It will avoid collisions and ensure stability of API for us.
I'm not afraid we will forget about upgrading - when there is a critical issue in Guava (such as a bug we track down or security issue), we will be forced to upgrade.
In major (and sometimes minor) revisions we upgrade from time to time.
Additionally it would be good to take the list of interfaces I listed above and make sure we don't depend on @Beta interfaces.
---
What do you think?
-
9. Re: Re: Guava dependency - to drop or not to drop?
clerum Feb 15, 2014 3:32 PM (in response to lfryc)Eliminating the @Beta uses will only reduce the issues that users have with regard to richfaces versions and guava. Shading seems to be most foolproof fix.
As far as version upgrades it would make sense to simply track along with major Wildlfy release to ensure that you haven't fallen too far behind.
-
10. Re: Guava dependency - to drop or not to drop?
bleathem Feb 17, 2014 5:39 PM (in response to clerum)Let's go ahead and try shading. We should probably create some high-level package into which we place our shaded classes. Something like org.richfaces.shaded.guava. We'll use RF-13548 to track this effort.
Note: IIRC the Apache shade plugin caused an issue with productisation. Let's continue despite this potential problem and deal with it when/if it comes up.
Brian
-
11. Re: Guava dependency - to drop or not to drop?
ppitonak Feb 18, 2014 6:11 AM (in response to bleathem)Brian, do you want to implement shading in all versions of RichFaces, i.e. 5.0, 4.5 and 4.3?
-
12. Re: Guava dependency - to drop or not to drop?
@Pavel, Marek: do you have any concerns about using maven-shade-plugin to
integrate Guava library into richfaces.jar?
I think the problem we faced in RF 4.3 in WFK was about usage of Shade
Transformers (that we do not use in RF5), but I don't recall the problem
specifically.
-
@Pavol: Shading of Guava in 5.0 applies to 4.5 as well.
I don't think we should back-port it to 4.3, at least not at this point.
-
13. Re: Guava dependency - to drop or not to drop?
findepi Aug 20, 2014 6:20 AM (in response to Lukáš Fryč )Hi,
Sorry for reviving this old topic.
I see (but I don't understand)
- RF 4.5 seems to be using Guava 17 ([RF-13773] Upgrade Guava Dependency to 17.0 - JBoss Issue Tracker)
- RF 5.0 seems to be using Guava 16 ([RF-13247] Upgrade the Guava dependency to the 16.0.1 - JBoss Issue Tracker)
However, what I'm most interested about is this concept of shading Guava within RF jar. It seems the idea was generally agreed about. In what versions is it going to be introduced?
I'm interested since I'm application developer and RF apparently prevents me from upgrading Guava.
Best regards,
Piotr
-
14. Re: Guava dependency - to drop or not to drop?
bleathem Dec 4, 2014 1:08 PM (in response to findepi)RF 5 development stopped last June. We will not be continuing with RF 5 development as per: http://www.bleathem.ca/blog/2014/07/richfaces-will-pursue-stability-over-innovation.html
Neither will we pursue shading guava in RichFaces. Instead, we re-factored our usage of guava to use only the stable portions of the API. This should enable you to upgrade guava in your applications.