RosHTTP icon indicating copy to clipboard operation
RosHTTP copied to clipboard

Scala.js 1.0.0

Open zy4 opened this issue 7 years ago • 12 comments

Hi, I am currently migrating my stuff to ScalaJS 1.0.0-M3 Some libraries, such as utest already provide support for the upcoming major version: https://github.com/lihaoyi/utest/commit/9ccccc391fdad24e0b3d653aa48199bac629cd69

Unfortunately I need to switch to some other library in order to get 1.x support. Are you possibly planning on enabling 1.x support any time soon?

Thanks for your work so far!

zy4 avatar Jan 02 '18 17:01 zy4

Hi, This should not be a problem unless some dependency isn't compatible. Have you tried building RösHTTP with the proper ScalaJS version? You could submit a PR and we'll see if anything breaks.

Thanks

hmil avatar Jan 03 '18 13:01 hmil

Dear devs,

any release of a version supporting scalajs 1.0 on sight?

Cheers, Romain

romainreuillon avatar Apr 16 '20 07:04 romainreuillon

Hi,

I am not actively working on this project currently. Happy to help if you submit a PR though.

hmil avatar Apr 16 '20 14:04 hmil

Hi, I submitted a the #90 PR to move to scala 2.13 and scalajs 1.0. Scala 2.10 and 2.11 have been dropped. Mathieu

mathieuleclaire avatar May 07 '20 14:05 mathieuleclaire

Thanks @mathieuleclaire . I really mean to spend the time to fix the CI setup, but this is a huge pain in the ass, and I am not working on anything Scala at this time.

Feel free to give it a shot, otherwise it's going to be whenever I can finally deal with it.

hmil avatar May 07 '20 17:05 hmil

OK, I will try. But first, the tests themselves failed in sbt. I would need some information to debug:

  • for the JS part, "http" is not found. It seems that the "http" js module is not found for some reason.
  • for the JVM tests for instance, it fails because the connection is refused with the server (http://localhost:3000). Am I supposed to run any server before executing tests ?

mathieuleclaire avatar May 07 '20 21:05 mathieuleclaire

Yes, there is a companion server to run alongside the tests on localhost. It's all explained in contributing.md.

hmil avatar May 07 '20 21:05 hmil

Yes, thanks. I found it. 51 passed. 1 Failure for the JVM.

[info] X fr.hmil.roshttp.HttpRequestSpec.Request headers.Overwrite previous value when set 1ms 
[info]   java.lang.AssertionError: assertion failed: ==> assertion failed: accept: application/json
[info]   custom: barbar
[info]   cache-control: max-age=128 != Map(cache-control -> max-age=128, Custom -> barbar, Accept -> application/json)
[info]     scala.Predef$.assert(Predef.scala:282)
[info]     utest.asserts.Asserts$ArrowAssert.$eq$eq$greater(Asserts.scala:90)
[info]     fr.hmil.roshttp.HttpRequestSpec$.$anonfun$tests$95(HttpRequestSpec.scala:439)

mathieuleclaire avatar May 07 '20 21:05 mathieuleclaire

Update: in the PR #90,

  • all libs are updated across scala 2.13 (2.10 and 2.11 are droped) and scala.js 1.0
  • travis is updated
  • all the scalastyle tests passed
  • all the JVM tests passed.

But I still have the same error for the JS tests: ReferenceError: http is not defined I think it is just a scala-js trick but I don't know how to achieve this. Is a js dependency missing ? Peharp's @hmil or @sjrd, you would have an idea ?

mathieuleclaire avatar May 12 '20 15:05 mathieuleclaire

Probably the changes about the global scope in Scala.js 1.x. See the release notes at https://www.scala-js.org/news/2020/02/25/announcing-scalajs-1.0.0/

sjrd avatar May 12 '20 15:05 sjrd

It seems the node.js dependency is missing. Only the scalajs compilation js is provided in tests and not node.js that the js.native functions are suppose to call.

mathieuleclaire avatar May 13 '20 12:05 mathieuleclaire

Version 3.0.0 should work with Scala.js 1.x. Let me know if there's a problem.

hmil avatar May 13 '20 21:05 hmil