-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 0.10.0 - Static Language Support #304
Version 0.10.0 - Static Language Support #304
Conversation
…age's native function support * Only hooked up to rxjava-groovy in this commit
* Adds an Object overload to Observable methods via code generation
…to version_0.10.0_multi-static Conflicts: rxjava-core/src/main/java/rx/Observable.java
I couldn't get these to work once we removed the Object overloads that was apparently being invoked instead of the staticly typed method so removing them. If someone else can get these generics working then please submit a new pull request.
These methods will need different names as they have the same argument count so break with dynamic overloads once we do static handling of dynamic languages.
- needed for Scala build to succeed
RxJava-pull-requests #174 SUCCESS |
|
Looks good, all in all. I'll try this out with my Scala sample as soon as possible. Thanks for the awesome work! |
Thanks @jmhofer for stepping in to test out these changes. @mattrjacobs Answers to your questions ...
If we leave the The other option is we change that to be
I think the simplest solution is just not have any "compile" dependencies, only "provided". I believe your Gradle scripts just need to adjust to include provided dependencies, not just compile runtime dependencies and then it will work. I would not try messing with POM files directly. If something is specified as "provided" then it is used for compilation but not included in the POM when pushed to Maven Central. |
RxJava-pull-requests #175 SUCCESS |
RxJava-pull-requests #176 FAILURE |
RxJava-pull-requests #177 SUCCESS |
Currently, if you publish RxJava to your local Maven repo, you'll find that the rxjava-scala and rxjava-swing POMs include a dependency on "rxjava-core", which doesn't exist anymore as a module, as it was renamed to "rxjava". Unfortunately, I don't know enough about Gradle to be able to fix this. My guess would be that it's not enough to set the |
Here's another problem: Excluding "*$UnitTest" from JARs that might be included by Scala will cause the Scala compiler to crash with a Typer error because it expects defined inner classes to exist. This means that at least in |
I've created a mini-PR against the unit test problem here: benjchristensen#1 |
I got my little sample (https://github.com/jmhofer/rxjava-samples) working with this PR. The code itself was very easy to adapt. The implicits seem to be working fine. One small thing I noticed: The very long names of the implicits are a bit distracting, imho. Should I want to use one of these functions explicitly, I'd prefer shorter names like simply |
Responses to @jmhofer:
|
@mattrjacobs: All your suggestions seem sensible to me. Concerning implicit naming: It may be relatively rare, however using the implicits often leads to your having to specify the parameter types of the closures being implicitely converted, which can be more verbose and confusing than making the conversion explicit and then being able to shorten the closure syntax. Names like |
RxJava-pull-requests #181 SUCCESS |
RxJava-pull-requests #182 SUCCESS |
RxJava-pull-requests #183 SUCCESS |
RxJava-pull-requests #188 FAILURE |
Replaced by #319 |
Manual merge of pull #300 from @mattrjacobs
This will make RxJava completely static by removing all Object overloads (see #208 and #204).
I'm submitting this before it being 100% ready so people can review and provide feedback.
Open items to append to this pull request before merging:
1) subscribe with map is not handled yet
The following signature needs to be made static. Right now the lack of this combined with removal of Functions.from dynamic language functionality has broken this.
2) Core artifact naming convention
Should rxjava-core-x.y.x.jar become rxjava-x.y.z.jar since the concept of core+language no longer applies?
I think I'd prefer this:
Only one of those jars is needed hence the reason why I think the 'core' term is no longer needed as it communicated the fact it was always needed.
Any contrib modules would be: rxjava-contrib-module-name-x.y.x.jar
3) Dependencies from languages to core still exist
The build still will result in Maven Central POM files requires rxjava-core from the language version despite that not being the case. Need to eliminate this dependency in the artifact.
Implementation notes originally posted at #204 (comment):
After implementing and throwing away a few different approaches we have landed on a solution we feel will balance the various competing priorities.
Our goals are:
rx.Observable
class so that we don't divide libraries with helpers such asGroovyObservable
,ClojureObservable
etc that then need to be converted back and forth when doing interopThe solution we have arrived at will work as follows:
For example:
The default Java version:
A Groovy version:
A project will include just the jar that meets their language needs, there will no longer be a "core" jar plus the language adaptor.
The drawback of this is that mixing two of these in a classpath will result in non-deterministic loading (whichever is loaded last wins) and that is the version that will be used. This means if a library depends on rxjava.jar but is using Groovy and needs rxjava-groovy.jar it is up to the developer of that project to make sure they have only the rxjava-groovy.jar version. This is not ideal but is a one-time pain setting up a build and is better than the constant pain of missing static typing or converting to/from different Observable implementations for different languages.
This should not break any code but will require a slight change to the build dependencies in your project when we release this.
We hope that this enables the RxJava project to better achieve its goal of being polyglot and targeting the JVM in general and not any specific languages without sacrificing interop or idiomatic usage in each of the languages.