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

scala.js support #452

Merged
merged 1 commit into from
Jul 17, 2016
Merged

scala.js support #452

merged 1 commit into from
Jul 17, 2016

Conversation

fwbrasil
Copy link
Collaborator

@fwbrasil fwbrasil commented Jul 16, 2016

Fixes #18

Problem

Quill's core and its sql extension are basically "pure" Scala code. They could be used by Scala.js applications. See slick/slick#1313 for some examples of use cases.

Solution

Cross-compile quill-core and quill-sql to Scala.js.

Notes

  • We'd need to create a new module to integrate database access from Scala.js. The Slick issue suggests using Node.js. I'd like to try and find someone familiar with Scala.js to work on this new module as a separate pull request.
  • This increases the build time from ~13m to ~26m. We might have to look into parallel module builds in the future, but for now I think it's manageable.

Checklist

  • Unit test all changes
  • Update README.md if applicable
  • Add [WIP] to the pull request title if it's work in progress
  • Squash commits that aren't meaningful changes
  • Run sbt scalariformFormat test:scalariformFormat to make sure that the source files are formatted

@getquill/maintainers

.settings(libraryDependencies ++= Seq(
"com.typesafe" % "config" % "1.3.0",
"com.typesafe.scala-logging" %% "scala-logging" % "3.4.0",
"org.scala-lang" % "scala-reflect" % scalaVersion.value
))
.jsSettings(
coverageExcludedPackages := ".*"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scala.js builds don't support coverage.

@gustavoamigo
Copy link
Contributor

will this make the build slower when using sbt locally? is it possible to easily disable cross-compiling for development purpose?

@fwbrasil
Copy link
Collaborator Author

will this make the build slower when using sbt locally? is it possible to easily disable cross-compiling for development purpose?

I've changed the sbt build to exclude the js compilation by default. The ci build will set project quill-with-js to force the compilation of the js versions.

Please, install and run [docker-machine-nfs](https://github.com/adlogix/docker-machine-nfs).
It will change the default file sharing of your [docker-machine](https://docs.docker.com/machine/)
from Virtual Box Shared Folders to NFS, which is a lot faster.
Use [docker for mac](https://docs.docker.com/engine/installation/mac/#/docker-for-mac).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 a lot better

Copy link
Contributor

@gustavoamigo gustavoamigo Jul 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The part with docker-machine and address 192.168.99.100 can be omitted as well. The new native docker for Mac uses localhost address, just like Linux.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's still necessary, I have to run those commands if I'm running the build "outside" the container.

@gustavoamigo
Copy link
Contributor

gustavoamigo commented Jul 17, 2016

👍

Approved with PullApprove

@fwbrasil
Copy link
Collaborator Author

Suggestion from a reddit comment: https://www.w3.org/TR/webdatabase/ instead of Node

@gustavoamigo
Copy link
Contributor

@fwbrasil that specification was stopped a long time ago. The W3C did not want to be tight to the SQlite implementation.

@fwbrasil
Copy link
Collaborator Author

fwbrasil commented Jul 17, 2016

👍

Approved with PullApprove

@fwbrasil fwbrasil merged commit e7b04c6 into master Jul 17, 2016
@fwbrasil fwbrasil deleted the scalajs branch July 17, 2016 16:37
@fwbrasil fwbrasil mentioned this pull request Jul 17, 2016
@guizmaii guizmaii mentioned this pull request Sep 18, 2023
jilen pushed a commit that referenced this pull request Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants