-
Notifications
You must be signed in to change notification settings - Fork 87
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
Backport scala.jdk.OptionConverters to 2.11 / 2.12 #533
Conversation
Hi @haukeh, I'm sorry for the delay. I think |
Hi @lrytz, thanks for the info! When I first tried adding it to the default source root, some JS tests failed with errors like:
Which made me - having literally no idea about scala-js - just assume So I guess a way to solve this would be creating a "lightweight" version of |
Ok, so I just found out that So for now I opted to create a slim variant of OptionConverters for JS only. Let me know what you think. |
cc @WojciechMazur -- is that possibly changing soon? Otherwise I'm happy to go with the current solution. Thank you @haukeh! |
@lrytz There should be a new release of Scala Native introducing j.u.Optional later this week or at the beginning of the next one. I'm currently on mini-vacations and cut off from my workstation. |
Hi @lrytz, sorry for the delay. As the new version of scala-native has been released in the meantime, I went ahead and updated it and added I opted to create a "shared" source root for js and native, as the implementation is exactly the same. While this feels a little weird for one single class, It felt even worse to just plain copy the class. If anyone knows of a better or more elegant way to do this (with sbt-crossproject etc.) I'd be more than happy to improve on this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @haukeh for pushing through!
This addresses #532
I have simply copied the implementations of
OptionConverters
andOptionShape
from the standard library, including license string, scaladoc (minus references made tojavaapi
, which doesn't exist here). A quick look at the git history indicated that this has been done before. I'm not sure if this raises any issues with the license or anything else I'm not aware of, so please let me know if there would be a better way to go about this!