Giter Club home page Giter Club logo

Comments (16)

cquiroz avatar cquiroz commented on June 6, 2024

I could try to do this, I've done a bunch of scala.js projects and we may need coulomb

from coulomb.

erikerlandson avatar erikerlandson commented on June 6, 2024

@cquiroz if you want to take a stab at it, please feel free! I'm hoping it's mostly additional targets in sbt, and corresponding in travis ci

from coulomb.

cquiroz avatar cquiroz commented on June 6, 2024

It is blocked on spire that hasn't been released yet for scala.js 1.0

from coulomb.

erikerlandson avatar erikerlandson commented on June 6, 2024

crossref: typelevel/spire#888

from coulomb.

erikerlandson avatar erikerlandson commented on June 6, 2024

Looks like the "real" problem is the archival of machinist
typelevel/spire#888 (comment)

from coulomb.

erikerlandson avatar erikerlandson commented on June 6, 2024

@cquiroz I believe spire 0.17.0-RC1 is building with scalaJS 1.x

from coulomb.

cquiroz avatar cquiroz commented on June 6, 2024

Yes, I'm waiting for a release

from coulomb.

erikerlandson avatar erikerlandson commented on June 6, 2024

https://github.com/typelevel/spire/releases/tag/v0.17.0-RC1

from coulomb.

erikerlandson avatar erikerlandson commented on June 6, 2024

scala-steward updated to spire 0.17.0-RC1, which I merged, so if you rebase from develop ScalaJS 1.x should in theory work now

from coulomb.

cquiroz avatar cquiroz commented on June 6, 2024

Yes I'm updating the build, will send a PR soon

from coulomb.

cquiroz avatar cquiroz commented on June 6, 2024

Actually I found a show stopper. coulomb uses WeakTypeTags which aren't available on scala.js. I'm not very familiar with them, I dont know if coulomb could use something else

from coulomb.

erikerlandson avatar erikerlandson commented on June 6, 2024

I can try ClassTag
scala-js/scala-js#50 (comment)

Mostly I'm using them to provide default names based on the name of a type.

Another possible approach would be to not support defaults that require WeakTypeTag or TypeTag, or not support them in scala.js - the code would need some refactoring to support that kind of dual functionality.

Or possibly punt to macros. those are supported IIUC

Maybe a dedicated implicit GetTypeName, that could punt to a macro or just invoke WeakTypeTag. I was excited about getting rid of the scala-2.x macros and I'm not eager to bring them back, but maybe if they were only invoked for scala.js ... ?

Scala's support for "conditional compilation" is pretty awkward, but I see people do it.

If we are ultimately forced to use macros, this is nice and compact.
https://stackoverflow.com/a/15649874/3669757

from coulomb.

cquiroz avatar cquiroz commented on June 6, 2024

@tpolecat sugested to use shapeless Typeable to get the names. Some uses are in libs that are jvm only like pureconfig thus we wouldn't need to change them

from coulomb.

cquiroz avatar cquiroz commented on June 6, 2024

I can try todo it and make sure they'd run in scala.js

from coulomb.

erikerlandson avatar erikerlandson commented on June 6, 2024

@tpolecat sugested to use shapeless Typeable to get the names.

Sounds like a good approach, shapeless is already a dependency. If it works, I'm happy to use it everywhere. I recently migrated everything to WeakTypeTag for consistency.

It might be worth using a shim GetTypeName in case this needs to be changed yet again in the future. GetTypeName could call Typeable for now.

from coulomb.

erikerlandson avatar erikerlandson commented on June 6, 2024

closing with #97
QuantityParser and its deps are not supported in scalaJS in their current form, that will require a future redesign

from coulomb.

Related Issues (20)

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.