Skip to content

Commit

Permalink
Merge pull request #3958 from typelevel/release/3.5.3-major
Browse files Browse the repository at this point in the history
Merge changes from 3.5.3 into series/3.x
  • Loading branch information
armanbilge authored Jan 16, 2024
2 parents 0f34a2d + a608390 commit 75791a7
Show file tree
Hide file tree
Showing 23 changed files with 360 additions and 159 deletions.
9 changes: 5 additions & 4 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
changelog:
categories:
- title: Features
- title: Enhancements
labels:
- ':mushroom: enhancement'
- title: Bug Fixes
labels:
- ':beetle: bug'
- title: Documentation
labels:
- ':books: docs'
- title: Behind the Scenes
labels:
- ':gear: infrastructure'
- ':robot:'
- title: Documentation
labels:
- ':books: docs'
- ':art: backstage'
# Not for published notes, just to make sure we don't forget any accidentally unlabeled PRs
- title: Uncategorized
labels:
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

## Getting Started

- Wired: **3.5.2**
- Wired: **3.5.3**
- Tired: **2.5.5** (end of life)

```scala
libraryDependencies += "org.typelevel" %% "cats-effect" % "3.5.2"
libraryDependencies += "org.typelevel" %% "cats-effect" % "3.5.3"
```

The above represents the core, stable dependency which brings in the entirety of Cats Effect. This is *most likely* what you want. All current Cats Effect releases are published for Scala 2.12, 2.13, 3.0, and Scala.js 1.7.
Expand All @@ -30,22 +30,22 @@ Depending on your use-case, you may want to consider one of the several other mo

```scala
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-effect-kernel" % "3.5.2",
"org.typelevel" %% "cats-effect-laws" % "3.5.2" % Test)
"org.typelevel" %% "cats-effect-kernel" % "3.5.3",
"org.typelevel" %% "cats-effect-laws" % "3.5.3" % Test)
```

If you're a middleware framework (like [Fs2](https://fs2.io/)), you probably want to depend on **std**, which gives you access to `Queue`, `Semaphore`, and much more without introducing a hard-dependency on `IO` outside of your tests:

```scala
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-effect-std" % "3.5.2",
"org.typelevel" %% "cats-effect" % "3.5.2" % Test)
"org.typelevel" %% "cats-effect-std" % "3.5.3",
"org.typelevel" %% "cats-effect" % "3.5.3" % Test)
```

You may also find some utility in the **testkit** and **kernel-testkit** projects, which contain `TestContext`, generators for `IO`, and a few other things:

```scala
libraryDependencies += "org.typelevel" %% "cats-effect-testkit" % "3.5.2" % Test
libraryDependencies += "org.typelevel" %% "cats-effect-testkit" % "3.5.3" % Test
```

Cats Effect provides backward binary compatibility within the 2.x and 3.x version lines, and both forward and backward compatibility within any major/minor line. This is analogous to the versioning scheme used by Cats itself, as well as other major projects such as Scala.js. Thus, any project depending upon Cats Effect 2.2.1 can be used with libraries compiled against Cats Effect 2.0.0 or 2.2.3, but *not* with libraries compiled against 2.3.0 or higher.
Expand Down
27 changes: 27 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Release procedure

1. Draft a new release.
1. Create a new tag with the appropriate name (e.g. v3.5.1); also name the release accordingly.
1. Make sure you're targeting the appropriate branch! (probably the minor branch)
1. "Generate new release notes"
1. edit edit edit
- Increment and transliterate the release counter
- Cargo-cult the old release notes header from the last minor release (including any warnings)
- Add any special notes to the release header (any major changes or fixes that need calling out)
- Fix up any formatting or PRs that got sorted to the wrong category
- Double-check PR attributions (collaborations, hand-offs, etc.)
- Just make it look nice :)
1. Publish the release.
1. Wait for all the CI madness to happen, for the release to announced to Discord, and for the artifacts to sync to Maven Central.
1. Make sure you're locally updated and on the right major/minor branch (this is the same branch as step 3).
1. Open a PR to merge the minor branch into the major branch. This is only necessary for patch releases.

`scripts/make-release-prs.sh <old-version> <new-version>`

e.g. `scripts/make-release-prs.sh v3.5.1 v3.5.2`

1. Open a PR to update the version in the README and documentation site. This is only necessary for stable releases (i.e., not Milestones or Release Candidates)

`scripts/make-site-pr.sh <old-version> <new-version>`

e.g. `scripts/make-site-pr.sh v3.5.1 v3.5.2`
6 changes: 6 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,10 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
// #3787, internal utility that was no longer needed
ProblemFilters.exclude[MissingClassProblem]("cats.effect.Thunk"),
ProblemFilters.exclude[MissingClassProblem]("cats.effect.Thunk$"),
// #3943, refactored internal private CallbackStack data structure
ProblemFilters.exclude[IncompatibleResultTypeProblem]("cats.effect.CallbackStack.push"),
ProblemFilters.exclude[DirectMissingMethodProblem](
"cats.effect.CallbackStack.currentHandle"),
// introduced by #3332, polling system
ProblemFilters.exclude[DirectMissingMethodProblem](
"cats.effect.unsafe.IORuntimeBuilder.this"),
Expand Down Expand Up @@ -836,6 +840,8 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
// introduced by #3642, which optimized the BatchingMacrotaskExecutor
ProblemFilters.exclude[MissingClassProblem](
"cats.effect.unsafe.BatchingMacrotaskExecutor$executeBatchTaskRunnable$"),
// #3943, refactored internal private CallbackStack data structure
ProblemFilters.exclude[Problem]("cats.effect.CallbackStackOps.*"),
// introduced by #3695, which ported fiber monitoring to Native
// internal API change
ProblemFilters.exclude[MissingClassProblem]("cats.effect.unsafe.ES2021FiberMonitor")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ private[effect] sealed abstract class WorkStealingThreadPool[P] private ()
task: Runnable,
fallback: Scheduler): Runnable
private[effect] def canExecuteBlockingCode(): Boolean
private[effect] def prepareForBlocking(): Unit
private[unsafe] def liveTraces(): (
Map[Runnable, Trace],
Map[WorkerThread[P], (Thread.State, Option[(Runnable, Trace)], Map[Runnable, Trace])],
Expand Down
24 changes: 14 additions & 10 deletions core/js/src/main/scala/cats/effect/CallbackStack.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ package cats.effect

import scala.scalajs.js

import CallbackStack.Handle

private trait CallbackStack[A] extends js.Object

private final class CallbackStackOps[A](private val callbacks: js.Array[A => Unit])
extends AnyVal {

@inline def push(next: A => Unit): CallbackStack[A] = {
@inline def push(next: A => Unit): Handle[A] = {
callbacks.push(next)
callbacks.asInstanceOf[CallbackStack[A]]
callbacks.length - 1
}

@inline def unsafeSetCallback(cb: A => Unit): Unit = {
Expand All @@ -36,29 +38,31 @@ private final class CallbackStackOps[A](private val callbacks: js.Array[A => Uni
* Invokes *all* non-null callbacks in the queue, starting with the current one. Returns true
* iff *any* callbacks were invoked.
*/
@inline def apply(oc: A, invoked: Boolean): Boolean =
@inline def apply(oc: A): Boolean =
callbacks
.asInstanceOf[js.Dynamic]
.reduceRight( // skips deleted indices, but there can still be nulls
(acc: Boolean, cb: A => Unit) =>
if (cb ne null) { cb(oc); true }
else acc,
invoked)
false)
.asInstanceOf[Boolean]

/**
* Removes the current callback from the queue.
* Removes the callback referenced by a handle. Returns `true` if the data structure was
* cleaned up immediately, `false` if a subsequent call to [[pack]] is required.
*/
@inline def clearCurrent(handle: Int): Unit =
@inline def clearHandle(handle: Handle[A]): Boolean = {
// deleting an index from a js.Array makes it sparse (aka "holey"), so no memory leak
js.special.delete(callbacks, handle)

@inline def currentHandle(): CallbackStack.Handle = callbacks.length - 1
true
}

@inline def clear(): Unit =
callbacks.length = 0 // javascript is crazy!

@inline def pack(bound: Int): Int = bound
@inline def pack(bound: Int): Int =
bound - bound // aka 0, but so bound is not unused ...
}

private object CallbackStack {
Expand All @@ -68,5 +72,5 @@ private object CallbackStack {
@inline implicit def ops[A](stack: CallbackStack[A]): CallbackStackOps[A] =
new CallbackStackOps(stack.asInstanceOf[js.Array[A => Unit]])

type Handle = Int
type Handle[A] = Int
}
Loading

0 comments on commit 75791a7

Please sign in to comment.