Skip to content

Commit 208bb5f

Browse files
committed
Remove most code deprecated ≤ v1.0.0
1 parent 80bc842 commit 208bb5f

File tree

12 files changed

+4
-93
lines changed

12 files changed

+4
-93
lines changed

core/src/main/scala/japgolly/scalajs/react/Callback.scala

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ object Callback {
7575
case Failure(t) => throw t
7676
})
7777

78-
/**
79-
* Convenience for applying a condition to a callback, and returning `Callback.empty` when the condition isn't
80-
* satisfied.
81-
*/
82-
@deprecated("Use when() or unless().", "0.11.0")
83-
def ifTrue(pred: Boolean, c: => Callback): Callback =
84-
when(pred)(c)
85-
8678
/**
8779
* Convenience for applying a condition to a callback, and returning `Callback.empty` when the condition isn't
8880
* satisfied.
@@ -113,12 +105,6 @@ object Callback {
113105
def sequence[T[X] <: TraversableOnce[X]](tca: => T[Callback]): Callback =
114106
traverse(tca)(identityFn)
115107

116-
@deprecated("Use .traverseOption", "1.0.0")
117-
def traverseO[A](oa: => Option[A])(f: A => Callback): Callback = traverseOption(oa)(f)
118-
119-
@deprecated("Use .sequenceOption", "1.0.0")
120-
def sequenceO[A](oca: => Option[Callback]): Callback = sequenceOption(oca)
121-
122108
def traverseOption[A](oa: => Option[A])(f: A => Callback): Callback =
123109
Callback(
124110
oa.foreach(a =>
@@ -256,12 +242,6 @@ object CallbackTo {
256242
def sequence[T[X] <: TraversableOnce[X], A](tca: => T[CallbackTo[A]])(implicit cbf: CanBuildFrom[T[CallbackTo[A]], A, T[A]]): CallbackTo[T[A]] =
257243
traverse(tca)(identityFn)(cbf)
258244

259-
@deprecated("Use .traverseOption", "1.0.0")
260-
def traverseO[A, B](oa: => Option[A])(f: A => CallbackTo[B]): CallbackTo[Option[B]] = traverseOption(oa)(f)
261-
262-
@deprecated("Use .sequenceOption", "1.0.0")
263-
def sequenceO[A](oca: => Option[CallbackTo[A]]): CallbackTo[Option[A]] = sequenceOption(oca)
264-
265245
def traverseOption[A, B](oa: => Option[A])(f: A => CallbackTo[B]): CallbackTo[Option[B]] =
266246
liftTraverse(f).option.map(_(oa))
267247

@@ -461,10 +441,6 @@ final class CallbackTo[A] private[react] (private[CallbackTo] val f: () => A) ex
461441
@inline def voidExplicit[B](implicit ev: A <:< B): Callback =
462442
void
463443

464-
@deprecated("Use when() or unless().", "0.11.0")
465-
def conditionally(cond: => Boolean): CallbackTo[Option[A]] =
466-
when(cond)
467-
468444
/**
469445
* Conditional execution of this callback.
470446
*

core/src/main/scala/japgolly/scalajs/react/CallbackOption.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ object CallbackOption {
9393
(implicit cbf: CanBuildFrom[T[CallbackOption[A]], A, T[A]]): CallbackOption[T[A]] =
9494
traverse(tca)(identityFn)
9595

96-
@deprecated("Use .traverseOption", "1.0.0")
97-
def traverseO[A, B](oa: => Option[A])(f: A => CallbackOption[B]): CallbackOption[B] = traverseOption(oa)(f)
98-
99-
@deprecated("Use .sequenceOption", "1.0.0")
100-
def sequenceO[A](oca: => Option[CallbackOption[A]]): CallbackOption[A] = sequenceOption(oca)
101-
10296
/**
10397
* NOTE: Technically a proper, lawful traversal should return `CallbackOption[Option[B]]`.
10498
*/

core/src/main/scala/japgolly/scalajs/react/StateAccess.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ trait StateAccess[F[_], S] {
2424
def setState(newState: State, callback: Callback = Callback.empty): F[Unit]
2525
def modState(mod: State => State, callback: Callback = Callback.empty): F[Unit]
2626

27-
@deprecated("Renamed to setStateFn", "1.0.0")
28-
final def _setState[I](f: I => State, callback: Callback = Callback.empty): I => F[Unit] =
29-
setStateFn(f, callback)
30-
31-
@deprecated("Renamed to modStateFn", "1.0.0")
32-
final def _modState[I](f: I => State => State, callback: Callback = Callback.empty): I => F[Unit] =
33-
modStateFn(f, callback)
34-
3527
final def setStateFn[I](f: I => State, callback: Callback = Callback.empty): I => F[Unit] =
3628
i => setState(f(i), callback)
3729

core/src/main/scala/japgolly/scalajs/react/component/builder/Builder.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,6 @@ object Builder {
324324
def shouldComponentUpdatePure(f: ShouldComponentUpdate[P, S, B] => Boolean): This =
325325
shouldComponentUpdate($ => CallbackTo(f($)))
326326

327-
@deprecated("Use componentDidMountConst", "1.0.0") def componentDidMountCB (cb: Callback ): This = componentDidMount (_ => cb)
328-
@deprecated("Use componentDidUpdateConst", "1.0.0") def componentDidUpdateCB (cb: Callback ): This = componentDidUpdate (_ => cb)
329-
@deprecated("Use componentWillMountConst", "1.0.0") def componentWillMountCB (cb: Callback ): This = componentWillMount (_ => cb)
330-
@deprecated("Use componentWillReceivePropsConst", "1.0.0") def componentWillReceivePropsCB(cb: Callback ): This = componentWillReceiveProps(_ => cb)
331-
@deprecated("Use componentWillUnmountConst", "1.0.0") def componentWillUnmountCB (cb: Callback ): This = componentWillUnmount (_ => cb)
332-
@deprecated("Use componentWillUpdateConst", "1.0.0") def componentWillUpdateCB (cb: Callback ): This = componentWillUpdate (_ => cb)
333-
@deprecated("Use shouldComponentUpdateConst", "1.0.0") def shouldComponentUpdateCB (cb: CallbackTo[Boolean]): This = shouldComponentUpdate (_ => cb)
334-
335327
def componentDidMountConst (cb: Callback ): This = componentDidMount (_ => cb)
336328
def componentDidUpdateConst (cb: Callback ): This = componentDidUpdate (_ => cb)
337329
def componentWillMountConst (cb: Callback ): This = componentWillMount (_ => cb)

core/src/main/scala/japgolly/scalajs/react/component/builder/Lifecycle.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ object Lifecycle {
3737
final def setState(newState: S, cb: Callback = Callback.empty): Callback = mountedPure.setState(newState, cb)
3838
final def modState(mod: S => S, cb: Callback = Callback.empty): Callback = mountedPure.modState(mod, cb)
3939

40-
@deprecated("Renamed to setStateFn", "1.0.0")
41-
final def _setState[I](f: I => S, callback: Callback = Callback.empty): I => Callback =
42-
setStateFn(f, callback)
43-
44-
@deprecated("Renamed to modStateFn", "1.0.0")
45-
final def _modState[I](f: I => S => S, callback: Callback = Callback.empty): I => Callback =
46-
modStateFn(f, callback)
47-
4840
final def setStateFn[I](f: I => S, callback: Callback = Callback.empty): I => Callback =
4941
i => setState(f(i), callback)
5042

core/src/main/scala/japgolly/scalajs/react/raw/Perf.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,4 @@ object Perf extends js.Object {
5555
* Prints the underlying DOM manipulations, e.g. "set innerHTML" and "remove".
5656
*/
5757
def printOperations(measurements: Measurements = js.native): Report = js.native
58-
59-
@deprecated("Renamed to printOperations() in React v15.", "0.11.0")
60-
def printDOM(measurements: Measurements = js.native): Report = js.native
6158
}

core/src/main/scala/japgolly/scalajs/react/vdom/Exports.scala

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@ object ExportsStatic {
44

55
final class VdomExtString(private val s: String) extends AnyVal {
66

7-
@deprecated("Use VdomAttr[A](\"name\") instead.", "1.0.0")
8-
def reactAttr[A]: Attr[A] =
9-
Attr[A](s)
10-
11-
@deprecated("Use VdomStyle[A](\"name\") instead.", "1.0.0")
12-
def reactStyle[A]: Attr[A] =
13-
Style[A](s)
14-
15-
@deprecated("Use HtmlTag(\"name\") or HtmlTagOf[A](\"name\") instead.", "1.0.0")
16-
def reactTag[N <: HtmlTopNode]: HtmlTagOf[N] =
17-
new HtmlTagOf[N](s)
18-
197
// May eventually make use of this
208
private[vdom] def reactTerminalTag[N <: HtmlTopNode]: HtmlTagOf[N] =
219
new HtmlTagOf[N](s)
@@ -25,7 +13,8 @@ object ExportsStatic {
2513
object Exports extends Exports
2614
abstract class Exports {
2715

28-
implicit final def VdomExtString(a: String) = new ExportsStatic.VdomExtString(a)
16+
private[vdom] implicit final def VdomExtString(a: String): ExportsStatic.VdomExtString =
17+
new ExportsStatic.VdomExtString(a)
2918

3019
final type VdomNode = japgolly.scalajs.react.vdom.VdomNode
3120
final val VdomNode = japgolly.scalajs.react.vdom.VdomNode

doc/changelog/1.1.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@
3939
noopener: Boolean = true,
4040
focus : Boolean = true): CallbackTo[Window] =
4141
```
42+
43+
* Remove code deprecated v1.0.0.

extra/src/main/scala/japgolly/scalajs/react/extra/Px.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ object Px {
124124

125125
sealed abstract class Derivative[A] extends Px[A] {
126126

127-
@deprecated("Use .withReuse", "1.0.0") final def reuse(implicit ev: Reusability[A]): Px[A] =
128-
withReuse
129-
130127
/**
131128
* In addition to updating when the underlying `Px` changes, this will also check its own result and halt updates
132129
* if reusable.

extra/src/main/scala/japgolly/scalajs/react/extra/Reusability.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ object Reusability {
4646
def apply[A](f: (A, A) => Boolean): Reusability[A] =
4747
new Reusability(f)
4848

49-
@deprecated("Use .apply. So Reusability[A](…) instead of Reusability.fn[A](…)", "1.0.0")
50-
def fn[A](f: (A, A) => Boolean): Reusability[A] =
51-
new Reusability(f)
52-
5349
def const[A](r: Boolean): Reusability[A] =
5450
new Reusability((_, _) => r)
5551

@@ -179,9 +175,6 @@ object Reusability {
179175
def unless[A](f: A => Boolean): Reusability[A] =
180176
when(!f(_))
181177

182-
@deprecated("Use Reusability.when", "1.0.0") def whenTrue [A](f: A => Boolean): Reusability[A] = when(f)
183-
@deprecated("Use Reusability.unless", "1.0.0") def whenFalse[A](f: A => Boolean): Reusability[A] = unless(f)
184-
185178
// -------------------------------------------------------------------------------------------------------------------
186179
// Implicit Instances
187180

0 commit comments

Comments
 (0)