-
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
Update to sjs-dom 2.0.0 #23
Changes from 2 commits
fc73eae
527db79
738cca2
0cf709c
4027794
c7ec46b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
scala: [2.12.15, 2.13.6] | ||
scala: [2.12.15, 3.0.2, 2.13.6] | ||
java: [[email protected]] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
@@ -109,6 +109,16 @@ jobs: | |
tar xf targets.tar | ||
rm targets.tar | ||
|
||
- name: Download target directories (3.0.2) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: target-${{ matrix.os }}-3.0.2-${{ matrix.java }} | ||
|
||
- name: Inflate target directories (3.0.2) | ||
run: | | ||
tar xf targets.tar | ||
rm targets.tar | ||
|
||
- name: Download target directories (2.13.6) | ||
uses: actions/download-artifact@v2 | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,13 +28,12 @@ import cats.effect.unsafe.IORuntime | |
import cats.syntax.all._ | ||
import fs2.Chunk | ||
import fs2.Stream | ||
import org.scalajs.dom.crypto._ | ||
import org.scalajs.dom.experimental.Body | ||
import org.scalajs.dom.experimental.Fetch | ||
import org.scalajs.dom.experimental.ResponseInit | ||
import org.scalajs.dom.experimental.serviceworkers.FetchEvent | ||
import org.scalajs.dom.experimental.serviceworkers.ServiceWorkerGlobalScope | ||
import org.scalajs.dom.experimental.{Response => DomResponse} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why were they renamed upstream? Were they There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They were experimental in DOM. But in general, in SJS-dom we decided to "de-namespace": almost everything is inside the |
||
import org.scalajs.dom.Body | ||
import org.scalajs.dom.Fetch | ||
import org.scalajs.dom.ResponseInit | ||
import org.scalajs.dom.FetchEvent | ||
import org.scalajs.dom.ServiceWorkerGlobalScope | ||
import org.scalajs.dom.{Response => DomResponse} | ||
import org.typelevel.vault.Key | ||
|
||
object ServiceWorker { | ||
|
@@ -91,15 +90,15 @@ object ServiceWorker { | |
response <- routes(request) | ||
body <- OptionT.liftF( | ||
OptionT(response.body.chunkAll.filter(_.nonEmpty).compile.last).map { chunk => | ||
arrayBuffer2BufferSource(chunk.toJSArrayBuffer) | ||
chunk.toJSArrayBuffer | ||
}.value) | ||
} yield new DomResponse( | ||
body.getOrElse(null), | ||
ResponseInit( | ||
response.status.code, | ||
response.status.reason, | ||
toDomHeaders(response.headers) | ||
) | ||
new ResponseInit { | ||
var status = response.status.code | ||
var statusText = response.status.reason | ||
var headers = toDomHeaders(response.headers) | ||
} | ||
) | ||
} | ||
|
||
|
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.
Workaround pending typelevel/fs2#2681.