Git Product home page Git Product logo

tuplez's People

Contributors

raquo avatar scala-steward avatar yurique avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tuplez's Issues

Point source maps to generated sources

As described in raquo/Laminar#91, Scala.js sjsir files contain the path & name of the original .scala file. My understanding is that these file names are then used to display the content of .scala files when debugging with source maps.

The problem for libraries is, by default the file paths in sjsir files are local to the machine on which the compilation happens, which is not the user machine where source maps are actually needed. The way to fix that is to use github URLs for raw files for file paths. I'd like to do that for Laminar and all of its dependencies, but the problem with tuplez is that it doesn't commit the generated .scala files to git, so there is nowhere we could point the source maps to.

To solve this, I propose that tuplez commits all of its generated files to git similar to how Airstream does it. I think it will be beneficial to users exploring the source code too. I'm not 100% sure about all the things you're generating but this approach seems like it should work. After you have the files, you need something like this in build.sbt:

scalacOptions ++= {
    val sourcesUrl = s"https://raw.githubusercontent.com/raquo/scala-dom-types/${git.gitHeadCommit.value.get}"
    val sourcesOptionName = if (scalaVersion.value.startsWith("2.")) "-P:scalajs:mapSourceURI" else "-scalajs-mapSourceURI"
    Seq(
      s"${sourcesOptionName}:${file("js").toURI}->$sourcesUrl/js/",
      s"${sourcesOptionName}:${file("shared").toURI}->$sourcesUrl/shared/"
    )
  }

and this in turn requires

addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")

Note: the js and shared paths are copy-pasta from scala dom types, you'll need something else depending on where you put the generated files. You can easily check that your .sjsir files link to the correct github URL.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.