Skip to content
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

Add support for Scala 2.13 #298

Closed
jpsacha opened this issue Feb 23, 2019 · 9 comments
Closed

Add support for Scala 2.13 #298

jpsacha opened this issue Feb 23, 2019 · 9 comments
Labels
Milestone

Comments

@jpsacha
Copy link
Member

@jpsacha jpsacha commented Feb 23, 2019

  • JavaFX collection wrappers using new Scala 2.13 collections API
  • Correct use of Scala 2.13 collections API
  • Some of the test are broken (e.g. AxisSpecs), due to change in ScalaTest API (?)
  • Setup Travis CI to test with Scala 2.13
@jpsacha jpsacha added the help wanted label Feb 23, 2019
@jpsacha jpsacha added this to the 12-R18 milestone Apr 28, 2019
@jpsacha

This comment has been minimized.

Copy link
Member Author

@jpsacha jpsacha commented Apr 28, 2019

scala-collection-compat should help with converting custom collections to new 2.13 collections API. The ReadMe for the project describes migration tool that may help in converting current ScalaFX code.

@sarahgerweck

This comment has been minimized.

Copy link

@sarahgerweck sarahgerweck commented Aug 7, 2019

Would you release a new build of ScalaFX 8 with Scala 2.13 support? I might help with this, but I'm reluctant to add a Java 12 requirement for my most important use case. I'm more likely to proceed with a private fork if ScalaFX 8 + Scala 2.13 is not coming.

@jpsacha

This comment has been minimized.

Copy link
Member Author

@jpsacha jpsacha commented Aug 11, 2019

@sarahgerweck ScalaFX 8 and Scala 2.12 are two separate issues.

ScalaFX 8 (Scala 2.12, 2.11) build is relatively easy, it just needs help with preparing and testing the build with some possible backporting of recent changes from the master branch. If you can do it, I will publish the build.

Support for Scala 2.13 is more difficult. There are very significant changes to the collections library. Significant amount of work is needed to rewrite custom ScalaFX collection to work with Scala 2.13. Help is definitely needed here. After looking at this for a while, I think that the best is to do full clean rewrite of ScalaFX collections implementation using the new Scala 2.13 collections. Suggestions and help with doing this are very welcomed.

@sarahgerweck

This comment has been minimized.

Copy link

@sarahgerweck sarahgerweck commented Aug 12, 2019

@jpsacha I get that they're separate issues, but it appeared from the release history that you may not be issuing more JavaFX 8 builds. I'd probably need a JavaFX 8 build to be released for it to be useful for my use case. (We're getting closer, but we still have a few internal things that don't run correctly on JDK 9 and above.)

I can't make any promises right now, but I may be able to help with the Scala 2.13 port. (I've ported another library and have done some prototyping at what a 2.13 ScalaFX fork might look like, so I have a decent picture of what's required.)

If I were to go down the road of a Scala 2.13 port, how confident are you that the existing collections test suites cover the existing functionality well? I'm sure some tweaks would be required, but if there's already a pretty good test suite, that makes this a smaller project than if tests need to be developed from scratch. (It looks like there are reasonably good tests, but I haven't gone through them in detail.)

@sarahgerweck

This comment has been minimized.

Copy link

@sarahgerweck sarahgerweck commented Aug 12, 2019

Oops, sorry I missed your last sentence about the JavaFX 8 backport. Ignore the first paragraph above.

@jpsacha

This comment has been minimized.

Copy link
Member Author

@jpsacha jpsacha commented Aug 22, 2019

There is a good number of tests for the collections. There are also demo projects, like ProScalaFX, that can be used to test.

The bulk of the current collections code would be the same. The inheritance and traits in implementation will need to be changed to match the new design of Scala 2.13 collections. There will need to be some deprecations or removal in the API to match Scala 2.13. By "clean rewrite" above I ment sticking to the new Scala 2.13 philosophy of collections, removing things that do not much.

jpsacha added a commit that referenced this issue Aug 27, 2019
Project does not compile yet.
jpsacha added a commit that referenced this issue Aug 27, 2019
All test in ObservableBufferSpec pass with Scala 2.13.
No support for building Scala 2.12.
Many other files using collections do not compile due to changes in Scala 2.13 and have to be manually excluded from compilation.
jpsacha added a commit that referenced this issue Aug 28, 2019
No support for building Scala 2.12.
Many other files using collections do not compile yet due to changes in Scala 2.13 and have to be manually excluded from compilation.
jpsacha added a commit that referenced this issue Aug 29, 2019
No support for building Scala 2.12.
Many other files using collections do not compile yet due to changes in Scala 2.13 and have to be manually excluded from compilation.
jpsacha added a commit that referenced this issue Aug 31, 2019
No support for building Scala 2.12.
Many other files using collections do not compile yet due to changes in Scala 2.13 and have to be manually excluded from compilation.
jpsacha added a commit that referenced this issue Aug 31, 2019
No support for building Scala 2.12.
Many other files using collections do not compile yet due to changes in Scala 2.13 and have to be manually excluded from compilation.
jpsacha added a commit that referenced this issue Aug 31, 2019
scala.Seq is now immutable requiring wrapping results in immutable.Seq
Main code should now compile. Compilation of some tests fails due to issues with ScalaTest. What compiles is passing tests.
jpsacha added a commit that referenced this issue Aug 31, 2019
Main code should now compile. Compilation of some tests fails due to issues with ScalaTest. What compiles is passing tests.
jpsacha added a commit that referenced this issue Sep 2, 2019
scala.Seq is now immutable requiring wrapping results in immutable.Seq

Also some style corrections.

Main code should now compile. Compilation of some tests fails due to issues with ScalaTest. What compiles is passing tests.
jpsacha added a commit that referenced this issue Sep 2, 2019
This should fix errors like:

      Error:(39, 7) illegal trait super target found for method withFixture required by trait RunOnApplicationThread;
        found   : protected def withFixture: ((test: _1.NoArgTest)org.scalatest.Outcome) forSome { val _1: [T]scalafx.scene.chart.AxisSpec[T] } in trait TestSuite;
        expected: protected def withFixture: ((test: _1.NoArgTest)org.scalatest.Outcome) forSome { val _1: [T]scalafx.scene.chart.AxisSpec[T] } in trait TestSuiteMixin
      class AxisSpec[T]
jpsacha added a commit that referenced this issue Sep 2, 2019
@rom1dep

This comment has been minimized.

Copy link
Contributor

@rom1dep rom1dep commented Sep 2, 2019

@jpsacha mill scalafx[2.13.0].test comes all green, what an impressive feat :)

@jpsacha

This comment has been minimized.

Copy link
Member Author

@jpsacha jpsacha commented Sep 2, 2019

All things compile and tests are now passing, including Travis CI.

Snapshot release is published as 12.0.2-R18-SNAPSHOT:
https://oss.sonatype.org/content/repositories/snapshots/org/scalafx/scalafx_2.13/12.0.2-R18-SNAPSHOT/

jpsacha added a commit that referenced this issue Sep 4, 2019
jpsacha added a commit that referenced this issue Sep 6, 2019
@jpsacha

This comment has been minimized.

Copy link
Member Author

@jpsacha jpsacha commented Sep 6, 2019

Scala 2.13 support is working.

@jpsacha jpsacha closed this Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.