Skip to content

Commit 5f700d3

Browse files
committed
Merge remote-tracking branch 'upstream/main' into topic/node-server-tweaks
2 parents ea9f6cd + 28617f6 commit 5f700d3

File tree

83 files changed

+3495
-2251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3495
-2251
lines changed

.github/workflows/ci.yml

+26-25
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@ on:
1515
tags: [v*]
1616

1717
env:
18-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
2018
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
19+
JABBA_INDEX: 'https://github.com/typelevel/jdk-index/raw/main/index.json'
20+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
2121
PGP_SECRET: ${{ secrets.PGP_SECRET }}
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2223

2324
jobs:
2425
build:
2526
name: Build and Test
2627
strategy:
2728
matrix:
2829
os: [ubuntu-latest]
29-
scala: [3.0.1, 2.12.14, 2.13.6]
30-
30+
scala: [3.1.0, 2.12.15, 2.13.6]
31+
java: [adoptium@17]
3132
runs-on: ${{ matrix.os }}
3233
steps:
3334
- name: Checkout current branch (full)
@@ -36,7 +37,7 @@ jobs:
3637
fetch-depth: 0
3738

3839
- name: Setup Java and Scala
39-
uses: olafurpg/setup-scala@v10
40+
uses: olafurpg/setup-scala@v13
4041
with:
4142
java-version: ${{ matrix.java }}
4243

@@ -53,9 +54,9 @@ jobs:
5354
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
5455

5556
- name: Check that workflows are up to date
56-
run: sbt --client '++${{ matrix.scala }}; githubWorkflowCheck'
57+
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
5758

58-
- run: sbt --client '++${{ matrix.scala }}; fmtCheck; test; mimaReportBinaryIssues'
59+
- run: sbt ++${{ matrix.scala }} fmtCheck test mimaReportBinaryIssues
5960

6061
- name: Scalafix tests
6162
if: matrix.scala == '2.13.6'
@@ -64,7 +65,7 @@ jobs:
6465
sbt testCI
6566
6667
- if: matrix.scala == '2.13.6'
67-
run: sbt --client '++${{ matrix.scala }}; microsite/mdoc'
68+
run: sbt ++${{ matrix.scala }} microsite/mdoc
6869

6970
- name: Compress target directories
7071
run: tar cf targets.tar target node/js/target core/js/target core/jvm/target io/js/target reactive-streams/target io/jvm/target benchmark/target project/target
@@ -83,7 +84,7 @@ jobs:
8384
matrix:
8485
os: [ubuntu-latest]
8586
scala: [2.13.6]
86-
87+
java: [adoptium@17]
8788
runs-on: ${{ matrix.os }}
8889
steps:
8990
- name: Checkout current branch (full)
@@ -92,7 +93,7 @@ jobs:
9293
fetch-depth: 0
9394

9495
- name: Setup Java and Scala
95-
uses: olafurpg/setup-scala@v10
96+
uses: olafurpg/setup-scala@v13
9697
with:
9798
java-version: ${{ matrix.java }}
9899

@@ -108,22 +109,22 @@ jobs:
108109
~/Library/Caches/Coursier/v1
109110
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
110111

111-
- name: Download target directories (3.0.1)
112+
- name: Download target directories (3.1.0)
112113
uses: actions/download-artifact@v2
113114
with:
114-
name: target-${{ matrix.os }}-3.0.1-${{ matrix.java }}
115+
name: target-${{ matrix.os }}-3.1.0-${{ matrix.java }}
115116

116-
- name: Inflate target directories (3.0.1)
117+
- name: Inflate target directories (3.1.0)
117118
run: |
118119
tar xf targets.tar
119120
rm targets.tar
120121
121-
- name: Download target directories (2.12.14)
122+
- name: Download target directories (2.12.15)
122123
uses: actions/download-artifact@v2
123124
with:
124-
name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }}
125+
name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }}
125126

126-
- name: Inflate target directories (2.12.14)
127+
- name: Inflate target directories (2.12.15)
127128
run: |
128129
tar xf targets.tar
129130
rm targets.tar
@@ -141,7 +142,7 @@ jobs:
141142
- name: Import signing key
142143
run: echo $PGP_SECRET | base64 -d | gpg --import
143144

144-
- run: sbt --client '++${{ matrix.scala }}; release'
145+
- run: sbt ++${{ matrix.scala }} release
145146

146147
site:
147148
name: Deploy site
@@ -151,25 +152,25 @@ jobs:
151152
matrix:
152153
os: [ubuntu-latest]
153154
scala: [2.13.6]
154-
155+
java: [adoptium@17]
155156
runs-on: ${{ matrix.os }}
156157
steps:
157-
- name: Download target directories (3.0.1)
158+
- name: Download target directories (3.1.0)
158159
uses: actions/download-artifact@v2
159160
with:
160-
name: target-${{ matrix.os }}-3.0.1-${{ matrix.java }}
161+
name: target-${{ matrix.os }}-3.1.0-${{ matrix.java }}
161162

162-
- name: Inflate target directories (3.0.1)
163+
- name: Inflate target directories (3.1.0)
163164
run: |
164165
tar xf targets.tar
165166
rm targets.tar
166167
167-
- name: Download target directories (2.12.14)
168+
- name: Download target directories (2.12.15)
168169
uses: actions/download-artifact@v2
169170
with:
170-
name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }}
171+
name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }}
171172

172-
- name: Inflate target directories (2.12.14)
173+
- name: Inflate target directories (2.12.15)
173174
run: |
174175
tar xf targets.tar
175176
rm targets.tar
@@ -188,4 +189,4 @@ jobs:
188189
uses: peaceiris/actions-gh-pages@v3
189190
with:
190191
publish_dir: ./target/website
191-
github_token: ${{ secrets.GITHUB_TOKEN }}
192+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/clean.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ jobs:
5656
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
5757
ghapi -X DELETE $REPO/actions/artifacts/$id
5858
done
59-
done
59+
done

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FS2: Functional Streams for Scala
33

44
[![Continuous Integration](https://github.com/functional-streams-for-scala/fs2/workflows/Continuous%20Integration/badge.svg)](https://github.com/functional-streams-for-scala/fs2/actions?query=workflow%3A%22Continuous+Integration%22)
55
[![Discord](https://img.shields.io/discord/632277896739946517.svg?label=&logo=discord&logoColor=ffffff&color=404244&labelColor=6A7EC2)](https://discord.gg/9V8FZTVZ9R)
6-
[![Maven Central](https://img.shields.io/maven-central/v/co.fs2/fs2-core_2.12)](https://maven-badges.herokuapp.com/maven-central/co.fs2/fs2-core_2.12)
6+
[![Maven Central](https://img.shields.io/maven-central/v/co.fs2/fs2-core_2.13)](https://maven-badges.herokuapp.com/maven-central/co.fs2/fs2-core_2.13)
77

88
### Overview
99

@@ -29,9 +29,9 @@ Quick links:
2929
* [Docs and getting help](#docs)
3030

3131
[microsite]: http://fs2.io
32-
[core-api]: https://oss.sonatype.org/service/local/repositories/releases/archive/co/fs2/fs2-core_2.12/3.0.4/fs2-core_2.12-3.0.4-javadoc.jar/!/fs2/index.html
33-
[io-api]: https://oss.sonatype.org/service/local/repositories/releases/archive/co/fs2/fs2-io_2.12/3.0.4/fs2-io_2.12-3.0.4-javadoc.jar/!/fs2/io/index.html
34-
[rx-api]: https://oss.sonatype.org/service/local/repositories/releases/archive/co/fs2/fs2-reactive-streams_2.12/3.0.4/fs2-reactive-streams_2.12-3.0.4-javadoc.jar/!/fs2/interop/reactivestreams/index.html
32+
[core-api]: https://oss.sonatype.org/service/local/repositories/releases/archive/co/fs2/fs2-core_2.13/3.1.0/fs2-core_2.13-3.1.0-javadoc.jar/!/fs2/index.html
33+
[io-api]: https://oss.sonatype.org/service/local/repositories/releases/archive/co/fs2/fs2-io_2.13/3.1.0/fs2-io_2.13-3.1.0-javadoc.jar/!/fs2/io/index.html
34+
[rx-api]: https://oss.sonatype.org/service/local/repositories/releases/archive/co/fs2/fs2-reactive-streams_2.13/3.1.0/fs2-reactive-streams_2.13-3.1.0-javadoc.jar/!/fs2/interop/reactivestreams/index.html
3535

3636
### <a id="docs"></a>Documentation and getting help ###
3737

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright (c) 2013 Functional Streams for Scala
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
5+
* this software and associated documentation files (the "Software"), to deal in
6+
* the Software without restriction, including without limitation the rights to
7+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8+
* the Software, and to permit persons to whom the Software is furnished to do so,
9+
* subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
*/
21+
22+
package fs2
23+
package benchmark
24+
25+
import cats.effect.IO
26+
import cats.effect.unsafe.implicits.global
27+
import org.openjdk.jmh.annotations.{Benchmark, Param, Scope, State}
28+
29+
@State(Scope.Thread)
30+
class ParEvalMapBenchmark {
31+
@Param(Array("100", "10000"))
32+
var size: Int = _
33+
34+
@Param(Array("10", "100"))
35+
var chunkSize: Int = _
36+
37+
private def dummyLoad = IO.delay(())
38+
39+
@Benchmark
40+
def evalMap(): Unit =
41+
execute(getStream.evalMap(_ => dummyLoad))
42+
43+
@Benchmark
44+
def parEvalMapUnordered10(): Unit =
45+
execute(getStream.parEvalMapUnordered(10)(_ => dummyLoad))
46+
47+
private def getStream: Stream[IO, Unit] =
48+
Stream.constant((), chunkSize).take(size.toLong).covary[IO]
49+
private def execute(s: Stream[IO, Unit]): Unit = s.compile.drain.unsafeRunSync()
50+
}

build.sbt

+36-15
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ addCommandAlias("testJS", "rootJS/test")
1212
Global / onChangedBuildSource := ReloadOnSourceChanges
1313
Global / stQuiet := true
1414

15-
ThisBuild / baseVersion := "3.0"
15+
ThisBuild / baseVersion := "3.1"
1616

1717
ThisBuild / organization := "co.fs2"
1818
ThisBuild / organizationName := "Functional Streams for Scala"
@@ -22,9 +22,10 @@ ThisBuild / startYear := Some(2013)
2222

2323
val NewScala = "2.13.6"
2424

25-
ThisBuild / crossScalaVersions := Seq("3.0.1", "2.12.14", NewScala)
25+
ThisBuild / crossScalaVersions := Seq("3.1.0", "2.12.15", NewScala)
2626

27-
ThisBuild / githubWorkflowJavaVersions := Seq("[email protected]")
27+
ThisBuild / githubWorkflowEnv += ("JABBA_INDEX" -> "https://github.com/typelevel/jdk-index/raw/main/index.json")
28+
ThisBuild / githubWorkflowJavaVersions := Seq("adoptium@17")
2829

2930
ThisBuild / spiewakCiReleaseSnapshots := true
3031

@@ -126,6 +127,10 @@ ThisBuild / mimaBinaryIssueFilters ++= Seq(
126127
ProblemFilters.exclude[NewMixinForwarderProblem]("fs2.io.net.Network.*"),
127128
ProblemFilters.exclude[NewMixinForwarderProblem]("fs2.io.net.tls.TLSContext.*"),
128129
ProblemFilters.exclude[InheritedNewAbstractMethodProblem]("fs2.io.net.tls.TLSContext.*"),
130+
ProblemFilters.exclude[InheritedNewAbstractMethodProblem]("fs2.Compiler#Target.*"),
131+
ProblemFilters.exclude[InheritedNewAbstractMethodProblem](
132+
"fs2.Compiler#TargetLowPriority#MonadErrorTarget.*"
133+
),
129134
// end #2453
130135
ProblemFilters.exclude[NewMixinForwarderProblem]("fs2.io.file.Files.*"),
131136
ProblemFilters.exclude[ReversedMissingMethodProblem]("fs2.io.file.Files.*"),
@@ -135,7 +140,20 @@ ThisBuild / mimaBinaryIssueFilters ++= Seq(
135140
"fs2.io.file.Files._runJavaCollectionResource"
136141
),
137142
ProblemFilters.exclude[InheritedNewAbstractMethodProblem]("fs2.io.file.Files.list"),
138-
ProblemFilters.exclude[InheritedNewAbstractMethodProblem]("fs2.io.file.Files.watch")
143+
ProblemFilters.exclude[InheritedNewAbstractMethodProblem]("fs2.io.file.Files.watch"),
144+
ProblemFilters.exclude[MissingClassProblem]("fs2.Pull$MapOutput$"),
145+
ProblemFilters.exclude[MissingClassProblem]("fs2.Pull$MapOutput"),
146+
ProblemFilters.exclude[IncompatibleMethTypeProblem]("fs2.Pull.mapOutput"),
147+
ProblemFilters.exclude[NewMixinForwarderProblem]("fs2.compression.Compression.gzip*"),
148+
ProblemFilters.exclude[NewMixinForwarderProblem]("fs2.compression.Compression.gunzip*"),
149+
ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.compression.Compression.$init$"),
150+
ProblemFilters.exclude[ReversedMissingMethodProblem]("fs2.Compiler#Target.F"),
151+
ProblemFilters.exclude[MissingTypesProblem]("fs2.Compiler$Target$ConcurrentTarget"),
152+
ProblemFilters.exclude[IncompatibleResultTypeProblem]("fs2.Compiler#Target#ConcurrentTarget.F"),
153+
ProblemFilters.exclude[MissingClassProblem]("fs2.Compiler$TargetLowPriority$MonadCancelTarget"),
154+
ProblemFilters.exclude[MissingClassProblem]("fs2.Compiler$TargetLowPriority$MonadErrorTarget"),
155+
ProblemFilters.exclude[MissingTypesProblem]("fs2.Compiler$TargetLowPriority$SyncTarget"),
156+
ProblemFilters.exclude[MissingClassProblem]("fs2.Chunk$VectorChunk")
139157
)
140158

141159
lazy val root = project
@@ -164,12 +182,12 @@ lazy val core = crossProject(JVMPlatform, JSPlatform)
164182
libraryDependencies ++= Seq(
165183
"org.typelevel" %%% "cats-core" % "2.6.1",
166184
"org.typelevel" %%% "cats-laws" % "2.6.1" % Test,
167-
"org.typelevel" %%% "cats-effect" % "3.2.2",
168-
"org.typelevel" %%% "cats-effect-laws" % "3.2.2" % Test,
169-
"org.typelevel" %%% "cats-effect-testkit" % "3.2.2" % Test,
170-
"org.scodec" %%% "scodec-bits" % "1.1.27",
171-
"org.typelevel" %%% "scalacheck-effect-munit" % "1.0.2" % Test,
172-
"org.typelevel" %%% "munit-cats-effect-3" % "1.0.5" % Test,
185+
"org.typelevel" %%% "cats-effect" % "3.2.9",
186+
"org.typelevel" %%% "cats-effect-laws" % "3.2.9" % Test,
187+
"org.typelevel" %%% "cats-effect-testkit" % "3.2.9" % Test,
188+
"org.scodec" %%% "scodec-bits" % "1.1.29",
189+
"org.typelevel" %%% "scalacheck-effect-munit" % "1.0.3" % Test,
190+
"org.typelevel" %%% "munit-cats-effect-3" % "1.0.6" % Test,
173191
"org.typelevel" %%% "discipline-munit" % "1.0.9" % Test
174192
),
175193
Compile / unmanagedSourceDirectories ++= {
@@ -223,11 +241,14 @@ lazy val node = crossProject(JSPlatform)
223241
scalacOptions += "-nowarn",
224242
Compile / doc / sources := Nil,
225243
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)),
226-
Compile / npmDependencies += "@types/node" -> "16.0.0",
244+
Compile / npmDevDependencies += "@types/node" -> "16.7.13",
227245
useYarn := true,
228246
yarnExtraArgs += "--frozen-lockfile",
229247
stOutputPackage := "fs2.internal.jsdeps",
230-
stStdlib := List("es2020")
248+
stPrivateWithin := Some("fs2"),
249+
stStdlib := List("es2020"),
250+
stUseScalaJsDom := false,
251+
stIncludeDev := true
231252
)
232253

233254
lazy val io = crossProject(JVMPlatform, JSPlatform)
@@ -236,7 +257,7 @@ lazy val io = crossProject(JVMPlatform, JSPlatform)
236257
.jsConfigure(_.enablePlugins(ScalaJSBundlerPlugin))
237258
.settings(
238259
name := "fs2-io",
239-
libraryDependencies += "com.comcast" %%% "ip4s-core" % "3.0.3",
260+
libraryDependencies += "com.comcast" %%% "ip4s-core" % "3.0-27-0b113c0",
240261
OsgiKeys.exportPackage := Seq("fs2.io.*"),
241262
OsgiKeys.privatePackage := Seq(),
242263
OsgiKeys.importPackage := {
@@ -253,7 +274,7 @@ lazy val io = crossProject(JVMPlatform, JSPlatform)
253274
.jvmSettings(
254275
Test / fork := true,
255276
libraryDependencies ++= Seq(
256-
"com.github.jnr" % "jnr-unixsocket" % "0.38.8" % Optional,
277+
"com.github.jnr" % "jnr-unixsocket" % "0.38.11" % Optional,
257278
"com.google.jimfs" % "jimfs" % "1.2" % Test
258279
)
259280
)
@@ -275,7 +296,7 @@ lazy val reactiveStreams = project
275296
libraryDependencies ++= Seq(
276297
"org.reactivestreams" % "reactive-streams" % "1.0.3",
277298
"org.reactivestreams" % "reactive-streams-tck" % "1.0.3" % "test",
278-
("org.scalatestplus" %% "testng-6-7" % "3.2.9.0" % "test").cross(CrossVersion.for3Use2_13)
299+
("org.scalatestplus" %% "testng-6-7" % "3.2.10.0" % "test").cross(CrossVersion.for3Use2_13)
279300
),
280301
OsgiKeys.exportPackage := Seq("fs2.interop.reactivestreams.*"),
281302
OsgiKeys.privatePackage := Seq(),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2013 Functional Streams for Scala
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
5+
* this software and associated documentation files (the "Software"), to deal in
6+
* the Software without restriction, including without limitation the rights to
7+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8+
* the Software, and to permit persons to whom the Software is furnished to do so,
9+
* subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
*/
21+
22+
package fs2
23+
package compression
24+
25+
private[compression] trait CompressionPlatform[F[_]]
26+
27+
private[compression] trait CompressionCompanionPlatform

0 commit comments

Comments
 (0)