-
Notifications
You must be signed in to change notification settings - Fork 10
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
Cross-publish core module #157
Conversation
468b0f1
to
2c690dc
Compare
21c88fc
to
7c9c94d
Compare
dependencies with %%% can't be stored in top-level declarations, so they instead need all to live inside settings macros. this moves everything and isolates the jvm deps
4df5c47
to
f2bcad4
Compare
better scala.js support seems low priority: cb372/sbt-explicit-dependencies#27
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.
Project works and this is a nice change towards JS support 🎉
My main concerns are only about the code duplication. Is it possible to avoid it as much as it is possible? Theoretically we could only try to substitude Geometry
and that can solve all JS compilation issues, rather than creating lots of classes duplicates. It is also possible to move specific to platform methods into syntax extensions.
@jisantuc have you considered that? do you know is it possible?
Overview
This PR cross-publishes
core
for Scala.js. Or, you know, it will eventually.Checklist
Notes
All TODOs done! 🎉
I'm pretty sure that the local publication proves that sonatype publication should Just Work ™️, but if there's other evidence to gather about that, I'm happy to gather it.
Right now I'm working on getting types lined up to have a js module that works. The main focus so far has been on adding a
Geometry
type that doesn't depend on GT. I'm only bothering for now with 2d points, polygons without holes, and multipolygons. To get tests running I'm also going to add some optics, because it turns out monocle publishes for Scala.js and some prisms will make my tests nicer to write. Once I have a SerDeSpec for the geometry types I'll work on actually publishing, which I don't uh technically know how to do yet (though maybe the nice sbt plugins will take care of that bit).Next TODOs:
export some types to see if they end up in the fastoptjs file as i expectadd an extent type to make geom generation less haphazardUpdate 2020/11/11: I'm working now on porting everything that depends on
java.time
into the JS side. This library makes it look like I can add a dep and then just use the samejava.time
API, but I'm getting a lot of complaints in test runs aboutReferring to non-existent class java.time.format.DateTimeFormatter
and other classes, so I'm suspicious. I think the JS side is just going to need to be more ad hoc about time types for now. You can see failures in this build output.Next TODO:
choose a time library, like https://github.com/zoepepper/scalajs-jsjoda maybescala-java-time
works fine as long as it's declared as a dep not only in bothcore
andcoreTest
🎉Testing
test
from root and see that you get all the tests from JVM and JS sidespublishLocal
from root and see that you publish both JVM and JS sides to local cacheCloses jisantuc/fp-http-azavea-rd#3