diff --git a/bin/ci b/bin/ci index ca5b4f98f..c0322ed46 100755 --- a/bin/ci +++ b/bin/ci @@ -13,10 +13,10 @@ fi case "${1:-}" in "") - "$0" 2 + ../bin/"$0" 2 echo echo - "$0" 3 + ../bin/"$0" 3 exit 0 ;; 2|3) @@ -40,6 +40,7 @@ echo rm -rf */target/scala-*/{,test-}classes cmd=( sbt + -DCI=1 -J-Xmx3G -J-XX:+UseG1GC ++$SCALA_VER diff --git a/bin/mima b/bin/mima new file mode 100755 index 000000000..83a26bf9e --- /dev/null +++ b/bin/mima @@ -0,0 +1,39 @@ +#!/bin/bash +set -euo pipefail +cd "$(dirname "$0")/../library" + +if [ $# -gt 1 ]; then + echo "Usage: $0 []" + echo "" + echo "Where" + echo " = 2 or 3" + echo + exit 1 +fi + +case "${1:-}" in + "") + ../bin/"$0" 2 + echo + echo + ../bin/"$0" 3 + exit 0 + ;; + 2|3) + SCALA_VER="$(../bin/get_scala_version $1)" + echo "Scala version: $SCALA_VER" + ;; + *) + echo "Unrecognised version: $1" >&2 + exit 2 + ;; +esac + +# Test upstream +# rm -rf */target/scala-*/{,test-}classes +sbt ++$SCALA_VER publishLocal + +# Test downstream +SCALA_MAJOR_VER="${SCALA_VER:0:1}" +cd ../downstream-tests +sbt ++$SCALA_VER mima200/clean mima200/fastOptJS diff --git a/downstream-tests/build.sbt b/downstream-tests/build.sbt index 134a30894..8b6763176 100644 --- a/downstream-tests/build.sbt +++ b/downstream-tests/build.sbt @@ -14,11 +14,12 @@ def scalacCommonFlags: Seq[String] = Seq( "-language:higherKinds", "-language:existentials", "-unchecked", + "-Wconf:msg=may.not.be.exhaustive:e", // Make non-exhaustive matches errors instead of warnings + "-Wconf:msg=Reference.to.uninitialized.value:e", // Make uninitialised value calls errors instead of warnings + "-Wconf:msg=macrotask:s", // stfu about macrotasks ) def scalac2Flags = Seq( - "-Wconf:msg=may.not.be.exhaustive:e", // Make non-exhaustive matches errors instead of warnings - "-Wconf:msg=Reference.to.uninitialized.value:e", // Make uninitialised value calls errors instead of warnings "-Wunused:explicits", // Warn if an explicit parameter is unused. "-Wunused:implicits", // Warn if an implicit parameter is unused. "-Wunused:imports", // Warn if an import selector is not referenced. diff --git a/downstream-tests/mima-2.0.0/src/main/scala/downstream/mima200/HookUseReducer.scala b/downstream-tests/mima-2.0.0/src/main/scala/downstream/mima200/HookUseReducer.scala new file mode 100644 index 000000000..0bddb7324 --- /dev/null +++ b/downstream-tests/mima-2.0.0/src/main/scala/downstream/mima200/HookUseReducer.scala @@ -0,0 +1,29 @@ +package downstream.mima200 + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +// Because in `object Hooks.UseReducer`, I changed `private def _unsafeCreate` to `def fromJs` +object HookUseReducer { + + final case class PI(pi: Int) { + def unary_- : PI = PI(-pi) + def *(n: Int): PI = PI(pi * n) + def +(n: Int): PI = PI(pi + n) + def +(n: PI): PI = PI(pi + n.pi) + } + + private def add(n: Int): (Int, Int) => Int = _ + _ + n + + val comp = ScalaFnComponent.withHooks[PI] + .useReducer(add(0), 100) + .useReducerBy((_, s1) => add(s1.value), (p, s1) => p.pi + s1.value) + .useReducerBy($ => add($.hook1.value), $ => $.props.pi + $.hook1.value + $.hook2.value) + .render((p, s1, s2, s3) => + <.div( + <.div(s"P=$p, s1=${s1.value}, s2=${s2.value}, s3=${s3.value}"), + <.button(^.onClick --> s1.dispatch(1)), + <.button(^.onClick --> s2.dispatch(10)), + <.button(^.onClick --> s3.dispatch(100)), + )) +} diff --git a/downstream-tests/mima-2.0.0/src/main/scala/downstream/mima200/HookUseRefToJsComponent.scala b/downstream-tests/mima-2.0.0/src/main/scala/downstream/mima200/HookUseRefToJsComponent.scala new file mode 100644 index 000000000..749c7c524 --- /dev/null +++ b/downstream-tests/mima-2.0.0/src/main/scala/downstream/mima200/HookUseRefToJsComponent.scala @@ -0,0 +1,16 @@ +package downstream.mima200 + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +// Because `useRefToJsComponent` didn't need the `CT0` arg so I removed it. +object HookUseRefToJsComponent { + + val jsComp = JsComponent.force[Null, Children.None, Null](null) + + val comp = ScalaFnComponent.withHooks[Unit] + .useRefToJsComponent(jsComp) + .render { (_, ref) => + jsComp.withRef(ref)() + } +} diff --git a/downstream-tests/version.sbt b/downstream-tests/version.sbt new file mode 120000 index 000000000..a0eac248e --- /dev/null +++ b/downstream-tests/version.sbt @@ -0,0 +1 @@ +../library/version.sbt \ No newline at end of file diff --git a/library/aliases.sbt b/library/aliases.sbt index 6e4638d8c..4ce9e9310 100644 --- a/library/aliases.sbt +++ b/library/aliases.sbt @@ -1,11 +1,20 @@ -addCommandAlias("CB", "project coreBundleCallback") -addCommandAlias("CE", "project coreBundleCatsEffect") -addCommandAlias("CG", "project coreGeneric") -addCommandAlias("E", "project extra") -addCommandAlias("FM", "project facadeMain") -addCommandAlias("FT", "project facadeTest") -addCommandAlias("GH", "project ghpages") -addCommandAlias("M2", "project extraExtMonocle2") -addCommandAlias("M3", "project extraExtMonocle3") -addCommandAlias("TS", "project tests") -addCommandAlias("TU", "project testUtil") +addCommandAlias("CB", "project coreBundleCallback") +addCommandAlias("CE", "project coreBundleCatsEffect") +addCommandAlias("CG", "project coreGeneric") +addCommandAlias("E", "project extra") +addCommandAlias("FM", "project facadeMain") +addCommandAlias("FT", "project facadeTest") +addCommandAlias("GH", "project ghpages") +addCommandAlias("M2", "project extraExtMonocle2") +addCommandAlias("M3", "project extraExtMonocle3") +addCommandAlias("TE", "project testEmissions") +addCommandAlias("TEJ", "project testEmissionsJS") +addCommandAlias("TT", "project tests") +addCommandAlias("TU", "project testUtil") + +addCommandAlias("tcc", "compile; Test/clean; Test/compile") +addCommandAlias("tt", "tests/test") +addCommandAlias("th", "coreGeneric/compile; tests/testOnly *Hook*") +addCommandAlias("thc", "coreGeneric/compile; tests/Test/clean; tests/testOnly *Hook*") +addCommandAlias("te", "testEmissions/test") +addCommandAlias("tec", "testEmissionsJS/clean;testEmissions/test") diff --git a/library/bin/remove_test_emissions b/library/bin/remove_test_emissions new file mode 100755 index 000000000..7eeac002e --- /dev/null +++ b/library/bin/remove_test_emissions @@ -0,0 +1,8 @@ +#!/bin/bash + +cd "$(dirname "$0")/.." || exit 1 +[ $# -ne 1 ] && echo "Usage: $0 " && exit 1 + +set -euo pipefail + +rm -fv ./testEmissions/jvm/src/test/resources/rr-sjr/*-out"$1".js diff --git a/library/build.sbt b/library/build.sbt index 51f48fd7f..414a15115 100644 --- a/library/build.sbt +++ b/library/build.sbt @@ -23,9 +23,11 @@ val ghpages = ScalaJsReact.ghpages val ghpagesMacros = ScalaJsReact.ghpagesMacros val root = ScalaJsReact.root val scalafixRules = ScalaJsReact.scalafixRules +val testEmissions = ScalaJsReact.testEmissions +val testEmissionsJS = ScalaJsReact.testEmissionsJS val tests = ScalaJsReact.tests -val testUtilMacros = ScalaJsReact.testUtilMacros val testUtil = ScalaJsReact.testUtil +val testUtilMacros = ScalaJsReact.testUtilMacros val util = ScalaJsReact.util val utilCatsEffect = ScalaJsReact.utilCatsEffect val utilDummyDefaults = ScalaJsReact.utilDummyDefaults diff --git a/library/coreGeneric/src/main/scala-2/japgolly/scalajs/react/hooks/HookMacros.scala b/library/coreGeneric/src/main/scala-2/japgolly/scalajs/react/hooks/HookMacros.scala new file mode 100644 index 000000000..c84bdf4b8 --- /dev/null +++ b/library/coreGeneric/src/main/scala-2/japgolly/scalajs/react/hooks/HookMacros.scala @@ -0,0 +1,542 @@ +package japgolly.scalajs.react.hooks + +import japgolly.microlibs.compiletime.MacroUtils +import japgolly.scalajs.react.component.{Js => JsComponent, Scala => ScalaComponent} +import japgolly.scalajs.react.hooks.Api._ +import japgolly.scalajs.react.hooks.CustomHook.ReusableDepState +import japgolly.scalajs.react.hooks.HookCtx.PC0 +import japgolly.scalajs.react.internal.{Box, MacroLogger} +import japgolly.scalajs.react.vdom.{TopNode, VdomNode} +import japgolly.scalajs.react.{Children, CtorType, Reusable} +import scala.reflect.macros.blackbox.Context +import scala.scalajs.js + +object HookMacros { + type With[A, B] = A with B +} + +class HookMacros(val c: Context) extends MacroUtils { + import c.universe.{WeakTypeTag => WT, _} + + private def typeTreeOf[A](implicit a: WT[A]): TypeTree = + TypeTree(a.tpe) + + // =================================================================================================================== + // render + + def render1[P: WT, C <: Children: WT, Ctx: WT](f: c.Tree)(s: c.Tree): c.Tree = + _render1[P, C, Ctx](f, s, false) + + def renderDebug1[P: WT, C <: Children: WT, Ctx: WT](f: c.Tree)(s: c.Tree): c.Tree = + _render1[P, C, Ctx](f, s, true) + + private def _render1[P: WT, C <: Children: WT, Ctx: WT](f: c.Tree, s: c.Tree, debug: Boolean): c.Tree = + apply[P, C](s, typeTreeOf[Ctx], debug) { + q"$self.render($f)($s)" + } + + // ------------------------------------------------------------------------------------------------------------------- + + def renderC1[P: WT](f: c.Tree)(s: c.Tree): c.Tree = + _renderC1[P](f, s, false) + + def renderDebugC1[P: WT](f: c.Tree)(s: c.Tree): c.Tree = + _renderC1[P](f, s, true) + + private def _renderC1[P: WT](f: c.Tree, s: c.Tree, debug: Boolean): c.Tree = + apply[P, Children.Varargs](s, typeTreeOf[PC0[P]], debug) { + q"$self.render($f)($s)" + } + + // ------------------------------------------------------------------------------------------------------------------- + + def render2[P: WT, C <: Children: WT, Ctx: WT, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn]](f: c.Tree)(step: c.Tree, s: c.Tree): c.Tree = + _render2[P, C, Ctx](f, step, s, false) + + def renderDebug2[P: WT, C <: Children: WT, Ctx: WT, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn]](f: c.Tree)(step: c.Tree, s: c.Tree): c.Tree = + _render2[P, C, Ctx](f, step, s, true) + + private def _render2[P: WT, C <: Children: WT, Ctx: WT](f: c.Tree, step: c.Tree, s: c.Tree, debug: Boolean): c.Tree = + apply[P, C](s, typeTreeOf[Ctx], debug) { + q""" + val f = $step.squash($f) + $self.render(f)($s) + """ + } + + // =================================================================================================================== + // renderReusable + + def renderWithReuse1[P: WT, C <: Children: WT, Ctx: WT](f: c.Tree)(s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuse1[P, C, Ctx](f, s, r, false) + + def renderWithReuseDebug1[P: WT, C <: Children: WT, Ctx: WT](f: c.Tree)(s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuse1[P, C, Ctx](f, s, r, true) + + private def _renderWithReuse1[P: WT, C <: Children: WT, Ctx: WT](f: c.Tree, s: c.Tree, r: c.Tree, debug: Boolean): c.Tree = + apply[P, C](s, typeTreeOf[Ctx], debug) { + q"$self.renderWithReuse($f)($s, $r)" + } + + // ------------------------------------------------------------------------------------------------------------------- + + def renderWithReuse1C[P: WT](f: c.Tree)(s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuse1C[P, Children.Varargs](f, s, r, false) + + def renderWithReuseDebug1C[P: WT](f: c.Tree)(s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuse1C[P, Children.Varargs](f, s, r, true) + + private def _renderWithReuse1C[P: WT, C <: Children: WT](f: c.Tree, s: c.Tree, r: c.Tree, debug: Boolean): c.Tree = + apply[P, C](s, typeTreeOf[PC0[P]], debug) { + q"$self.renderWithReuse($f)($s, $r)" + } + + // ------------------------------------------------------------------------------------------------------------------- + + def renderWithReuse2[P: WT, C <: Children: WT, Ctx: WT](f: c.Tree)(step: c.Tree, s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuse2[P, C, Ctx](f, step, s, r, false) + + def renderWithReuseDebug2[P: WT, C <: Children: WT, Ctx: WT](f: c.Tree)(step: c.Tree, s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuse2[P, C, Ctx](f, step, s, r, true) + + private def _renderWithReuse2[P: WT, C <: Children: WT, Ctx: WT](f: c.Tree, step: c.Tree, s: c.Tree, r: c.Tree, debug: Boolean): c.Tree = + apply[P, C](s, typeTreeOf[Ctx], debug) { + q""" + val f = $step.squash($f) + $self.renderWithReuse(f)($s, $r) + """ + } + + // =================================================================================================================== + // renderWithReuse + + def renderReusable1[P: WT, C <: Children: WT, A: WT, Ctx: WT](f: c.Tree)(s: c.Tree, v: c.Tree): c.Tree = + _renderReusable1[P, C, A, Ctx](f, s, v, false) + + def renderReusableDebug1[P: WT, C <: Children: WT, A: WT, Ctx: WT](f: c.Tree)(s: c.Tree, v: c.Tree): c.Tree = + _renderReusable1[P, C, A, Ctx](f, s, v, true) + + private def _renderReusable1[P: WT, C <: Children: WT, A: WT, Ctx: WT](f: c.Tree, s: c.Tree, v: c.Tree, debug: Boolean): c.Tree = + apply[P, C](s, typeTreeOf[Ctx], debug) { + q"$self.renderReusable($f)($s, $v)" + } + + // ------------------------------------------------------------------------------------------------------------------- + + def renderReusable1C[P: WT, A: WT](f: c.Tree)(s: c.Tree, v: c.Tree): c.Tree = + _renderReusable1C[P, Children.Varargs, A](f, s, v, false) + + def renderReusableDebug1C[P: WT, A: WT](f: c.Tree)(s: c.Tree, v: c.Tree): c.Tree = + _renderReusable1C[P, Children.Varargs, A](f, s, v, true) + + private def _renderReusable1C[P: WT, C <: Children: WT, A: WT](f: c.Tree, s: c.Tree, v: c.Tree, debug: Boolean): c.Tree = + apply[P, C](s, typeTreeOf[PC0[P]], debug) { + q"$self.renderReusable($f)($s, $v)" + } + + // ------------------------------------------------------------------------------------------------------------------- + + def renderReusable2[P: WT, C <: Children: WT, A: WT, Ctx: WT](f: c.Tree)(step: c.Tree, s: c.Tree, v: c.Tree): c.Tree = + _renderReusable2[P, C, A, Ctx](f, step, s, v, false) + + def renderReusableDebug2[P: WT, C <: Children: WT, A: WT, Ctx: WT](f: c.Tree)(step: c.Tree, s: c.Tree, v: c.Tree): c.Tree = + _renderReusable2[P, C, A, Ctx](f, step, s, v, true) + + private def _renderReusable2[P: WT, C <: Children: WT, A: WT, Ctx: WT](f: c.Tree, step: c.Tree, s: c.Tree, v: c.Tree, debug: Boolean): c.Tree = + apply[P, C](s, typeTreeOf[Ctx], debug) { + q""" + val f = $step.squash($f) + $self.renderReusable(f)($s, $v) + """ + } + + // =================================================================================================================== + // renderWithReuseBy + + def renderWithReuseBy1[P: WT, C <: Children: WT, A: WT, Ctx: WT](reusableInputs: c.Tree)(f: c.Tree)(s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuseBy1[P, C, A, Ctx](reusableInputs, f, s, r, false) + + def renderWithReuseByDebug1[P: WT, C <: Children: WT, A: WT, Ctx: WT](reusableInputs: c.Tree)(f: c.Tree)(s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuseBy1[P, C, A, Ctx](reusableInputs, f, s, r, true) + + private def _renderWithReuseBy1[P: WT, C <: Children: WT, A: WT, Ctx: WT](i: c.Tree, f: c.Tree, s: c.Tree, r: c.Tree, debug: Boolean): c.Tree = + apply[P, C](s, typeTreeOf[Ctx], debug) { + q"$self.renderWithReuseBy($i)($f)($s, $r)" + } + + // ------------------------------------------------------------------------------------------------------------------- + + def renderWithReuseBy1C[P: WT, A: WT](reusableInputs: c.Tree)(f: c.Tree)(s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuseBy1C[P, Children.Varargs, A](reusableInputs, f, s, r, false) + + def renderWithReuseByDebug1C[P: WT, A: WT](reusableInputs: c.Tree)(f: c.Tree)(s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuseBy1C[P, Children.Varargs, A](reusableInputs, f, s, r, true) + + private def _renderWithReuseBy1C[P: WT, C <: Children: WT, A: WT](i: c.Tree, f: c.Tree, s: c.Tree, r: c.Tree, debug: Boolean): c.Tree = + apply[P, C](s, typeTreeOf[PC0[P]], debug) { + q"$self.renderWithReuseBy($i)($f)($s, $r)" + } + + // ------------------------------------------------------------------------------------------------------------------- + + def renderWithReuseBy2[P: WT, C <: Children: WT, A: WT, Ctx: WT](reusableInputs: c.Tree)(f: c.Tree)(step: c.Tree, s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuseBy2[P, C, A, Ctx](reusableInputs, f, step, s, r, false) + + def renderWithReuseByDebug2[P: WT, C <: Children: WT, A: WT, Ctx: WT](reusableInputs: c.Tree)(f: c.Tree)(step: c.Tree, s: c.Tree, r: c.Tree): c.Tree = + _renderWithReuseBy2[P, C, A, Ctx](reusableInputs, f, step, s, r, true) + + private def _renderWithReuseBy2[P: WT, C <: Children: WT, A: WT, Ctx: WT](i: c.Tree, f: c.Tree, step: c.Tree, s: c.Tree, r: c.Tree, debug: Boolean): c.Tree = + apply[P, C](s, typeTreeOf[Ctx], debug) { + q""" + val f = $step.squash($f) + $self.renderWithReuseBy($i)(f)($s, $r) + """ + } + + // =================================================================================================================== + + private implicit def autoTagToType[A](t: c.WeakTypeTag[A]): Type = t.tpe + + private def AHM : Tree = q"_root_.japgolly.scalajs.react.hooks.AbstractHookMacros" + private def Box : Tree = q"_root_.japgolly.scalajs.react.internal.Box" + private def Box(t: Type) : Type = appliedType(c.typeOf[Box[_]], t) + private def CustomHook : Tree = q"_root_.japgolly.scalajs.react.hooks.CustomHook" + private def HookCtx : Tree = q"_root_.japgolly.scalajs.react.hooks.HookCtx" + private def Hooks : Tree = q"_root_.japgolly.scalajs.react.hooks.Hooks" + private def JsComp : Tree = q"_root_.japgolly.scalajs.react.component.Js" + private def JsFn : Tree = q"_root_.japgolly.scalajs.react.component.JsFn" + private def PropsChildren : Tree = q"_root_.japgolly.scalajs.react.PropsChildren" + private def React : Tree = q"_root_.japgolly.scalajs.react.facade.React" + private def Reusable : Tree = q"_root_.japgolly.scalajs.react.Reusable" + private def ScalaFn : Tree = q"_root_.japgolly.scalajs.react.component.ScalaFn" + private def ScalaRef : Tree = q"_root_.japgolly.scalajs.react.Ref" + private def ShouldCompUpdate: Tree = q"_root_.japgolly.scalajs.react.internal.ShouldComponentUpdateComponent" + private def SJS : Tree = q"_root_.scala.scalajs.js" + + private final class HookMacrosImpl extends AbstractHookMacros { + import AbstractHookMacros._ + + override type Expr[+A] = Term + override type Ref = TermName + override type Stmt = c.universe.Tree + override type Term = c.universe.Tree + override type Type[A] = c.universe.Type + override type TypeTree = c.universe.TypeTree + + override protected def asTerm [A] = identity + override protected def Expr [A] = identity + override protected def isUnit = _.tpe == unitType + override protected def refToTerm = Ident(_) + override def showCode = c.universe.showCode(_).replace("_root_.", "").replace(".`package`.", ".") + override protected def showRaw = c.universe.showRaw(_) + override protected def Type [A] = _.tpe + override protected def typeOfTerm = t => c.universe.TypeTree(t.tpe) + override protected def uninline = identity + override protected def unitTerm = q"()" + override protected def unitType = c.universe.definitions.UnitTpe + override protected def wrap = (s, b) => Block(s.toList, b) + + override protected def call = (function, args, betaReduce) => { + import internal._ + function match { + case Function(params, body) if betaReduce => + + // From scala/test/files/run/macro-range/Common_1.scala + class TreeSubstituter(from: List[Symbol], to: List[Tree]) extends Transformer { + override def transform(tree: Tree): Tree = tree match { + case Ident(_) => + def subst(from: List[Symbol], to: List[Tree]): Tree = + if (from.isEmpty) tree + else if (tree.symbol == from.head) to.head.duplicate + else subst(from.tail, to.tail); + subst(from, to) + case _ => + val tree1 = super.transform(tree) + if (tree1 ne tree) setType(tree1, null) + tree1 + } + } + val t = new TreeSubstituter(params.map(_.symbol), args) + t.transform(body) + + case _ => + Apply(Select(function, TermName("apply")), args) + } + } + + override protected val rewriterBridge: RewriterBridge = + HookRewriter.Bridge[Stmt, Term, Ref]( + apply = Apply(_, _), + hookCtx = (c, as) => Apply(if (c) q"$HookCtx.withChildren" else HookCtx, as), + refToTerm = r => Ident(r), + scalaVer = 2, + valDef = (n, t, l) => { + val r = TermName(n) + val stmt = if (l) q"lazy val $r = $t" else q"val $r = $t" + (stmt, r) + }, + ) + + override val ApplyLike = new ApplyExtractor { + override def unapply(a: Term) = a match { + case Apply(x, y) => Some((x, y)) + case _ => None + } + } + + override val TypeApplyLike = new TypeApplyExtractor { + override def unapply(a: Term) = a match { + case TypeApply(x, y) => Some((x, y.map(t => TypeTree(t.tpe)))) + case _ => None + } + } + + override val SelectLike = new SelectExtractor { + override def unapply(a: Term) = a match { + case Select(x, y) => Some((x, y.toString)) + case _ => None + } + } + + override val FunctionLike = new FunctionExtractor { + override def unapply(a: Term) = a match { + + case Function(params, _) => + Some(params.size) + + case Apply(ta@ TypeApply(_, targs), _) if ta.tpe.resultType.typeSymbol.name.toString.startsWith("Function") => + Some(targs.size - 1) + + case s: Select => + s.tpe match { + case TypeRef(_, f, args) if f.name.toString.startsWith("Function") => Some(args.size - 1) + case _ => None + } + + case _ => + None + } + } + + protected lazy val debugLog = MacroLogger(true) + + override protected def custom[I, O] = (_, _, hook, i) => + q"$hook.unsafeInit($i)" + + override protected def customArg[Ctx, Arg] = (_, _, hookArg, ctx) => + q"$hookArg.convert($ctx)" + + override protected def hookDepsEmptyArray = + q"$SJS.Array[Any]()" + + override protected def hookDepsIntArray1 = i => + q"$SJS.Array[Int]($i)" + + override protected def hooksVar[A] = (_, body) => + q"$Hooks.Var($body)" + + override protected def jsComponentRawMountedType[P <: js.Object, S <: js.Object] = (tpeP, tpeS) => + appliedType(c.typeOf[JsComponent.RawMounted[_, _]], tpeP, tpeS) + + override protected def jsComponentRawMountedTypeWithFacade[P <: js.Object, S <: js.Object, F] = (tpeP, tpeS, tpeF) => + appliedType(c.typeOf[HookMacros.With[_, _]], + appliedType(c.typeOf[JsComponent.RawMounted[_, _]], tpeP, tpeS), + tpeF) + + override protected def none[A] = _ => + q"None" + + override protected def optionType[A] = a => + appliedType(c.typeOf[Option[_]], a) + + override protected def refFromJs[A] = (ref, _) => + q"$ScalaRef.fromJs($ref)" + + override protected def refMapJsMounted[P <: js.Object, S <: js.Object] = (ref, _, _) => + q"$ref.map($JsComp.mounted(_))" + + override protected def refMapJsMountedWithFacade[P <: js.Object, S <: js.Object, F <: js.Object] = (ref, tpeP, tpeS, tpeF) => + q"$ref.map(JsComponent.mounted[$tpeP, $tpeS](_).addFacade[$tpeF])" + + override protected def refMapMountedImpure[P, S, B] = (ref, _, _, _) => + q"$ref.map(_.mountedImpure)" + + override protected def refWithJsComponentArgHelper[F[_], A[_], P1, S1, CT1[-p, +u] <: CtorType[p, u], R <: JsComponent.RawMounted[P0, S0], P0 <: js.Object, S0 <: js.Object, CT0[-p, +u] <: CtorType[p, u]] = + (r, a, _, _, _, _, _, _, _, _) => + q"$AHM.helperRefToJsComponent($r, $a)" + + override protected def refNarrowOption[A, B <: A] = (ref, ct, _, tpeB) => + q"$ref.narrowOption[$tpeB]($ct)" + + override protected def refToComponentInject[P, S, B, CT[-p, +u] <: CtorType[p, u]] = (c, r, _, _, _, _) => + q"$AHM.helperRefToComponentInject($c, $r)" + + override protected def reusableDepsLogic[D] = (d, s, r, tpeD) => + q"$CustomHook.reusableDepsLogic[$tpeD]($d)($s)($r)" + + override protected def reusableDepStateRev = rds => + q"$rds.rev" + + override protected def reusableDepStateType[D] = d => + appliedType(c.typeOf[ReusableDepState[_]], d) + + override protected def reusableDepStateValue[D] = (rds, _) => + q"$rds.value" + + override protected def reusableValueByInt[A] = (i, a, _) => + q"$Reusable.implicitly($i).withValue($a)" + + override protected def topNodeType = + c.typeOf[TopNode] + + override protected def scalaComponentRawMountedType[P, S, B] = (tpeS, tpeP, tpeB) => + appliedType(c.typeOf[ScalaComponent.RawMounted[_, _, _]], tpeS, tpeP, tpeB) + + override protected def scalaFn0[A] = (_, body) => + q"() => $body" + + override protected def useCallback[F <: js.Function] = (f, deps, _) => + q"$React.useCallback($f, $deps)" + + override protected def useCallbackArgFromJs[A, J <: js.Function] = (x, j, _, _) => + q"$x.fromJs($j)" + + override protected def useCallbackArgToJs[A, J <: js.Function] = (x, a, _, _) => + q"$x.toJs($a)" + + override protected def useCallbackArgTypeJs[A, J <: js.Function] = _ => + null // Not used in Scala 2 (i.e. in useCallbackArg{From,To}Js) + + override protected def useContext[A] = (ctx, _) => + q"$React.useContext($ctx.raw)" + + override protected def useDebugValue = desc => + q"$React.useDebugValue[Null](null, _ => $desc)" + + override protected def useEffect = (a, d) => + q"$React.useEffect($a, $d)" + + override protected def useEffectArgToJs[A] = (arg, a, _) => + q"$arg.toJs($a)" + + override protected def useForceUpdate1 = + q"$React.useStateValue(0)" + + override protected def useForceUpdate2 = s => + q"$CustomHook.useForceUpdateRaw($s)" + + override protected def useLayoutEffect = (a, d) => + q"$React.useLayoutEffect($a, $d)" + + override protected def useMemo[A] = (a, d, _) => + q"$React.useMemo(() => $a, $d)" + + override protected def useReducer[S, A] = (r, s, tpeS, tpeA) => + q"$React.useReducer[Null, $tpeS, $tpeA]($r, null, _ => $s)" + + override protected def useReducerFromJs[S, A] = (raw, _, _) => + q"$Hooks.UseReducer.fromJs($raw)" + + override protected def useRef[A] = (a, _) => + q"$React.useRef($a)" + + override protected def useRefOrNull[A] = (tpe) => { + val t = appliedType(c.typeOf[js.|[_, _]], tpe, definitions.NullTpe) + q"$React.useRef[$t](null)" + } + + override protected def useRefFromJs[A] = (ref, _) => + q"$Hooks.UseRef.fromJs($ref)" + + override protected def useStateFn[S] = (tpe, body) => + q"$React.useStateFn(() => $Box[$tpe]($body))" + + override protected def useStateValue[S] = (tpe, body) => + q"$React.useStateValue($Box[$tpe]($body))" + + override protected def useStateFromJsBoxed[S] = (tpe, raw) => + q"$Hooks.UseState.fromJsBoxed[$tpe]($raw)" + + override protected def useStateWithReuseFromJsBoxed[S] = (tpe, raw, reuse, ct) => + q"$Hooks.UseStateWithReuse.fromJsBoxed[$tpe]($raw)($reuse, $ct)" + + override protected def vdomRawNode = vdom => + q"$vdom.rawNode" + + override protected def reusabilityReusable[A] = tpe => + q"$Reusable.reusableReusability[$tpe]" + + override protected def reusableMap[A, B] = (r, f, _, _) => + q"$r.map($f)" + + override protected def reusableType[A] = tpe => + appliedType(c.typeOf[Reusable[_]], tpe) + + override protected def reusableValue[A] = (r, _) => + q"$r.value" + + override protected def shouldComponentUpdateComponent = (rev, render) => + q"$ShouldCompUpdate($rev, () => $render)" + + override protected def vdomNodeType = + c.typeOf[VdomNode] + } + + // =================================================================================================================== + + private def self = c.prefix + + private def apply[P, C <: Children](summoner: c.Tree, ctxType: TypeTree, debug: Boolean)(giveUp: Tree) + (implicit P: WT[P], C: WT[C]): c.Tree = { + + val hookMacros = new HookMacrosImpl + + import hookMacros.log + log.enabled = debug + log.header() + + def onFailure(msg: String): Tree = { + import Console._ + log(RED_B + WHITE + "Giving up. " + msg + RESET) + c.warning(c.enclosingPosition, msg) + giveUp + } + + val result: Tree = + try { + + val rewriteAttempt = + for { + hookDefn <- hookMacros.parse(c.macroApplication) + rewriter <- hookMacros.rewriteComponent(hookDefn) + } yield rewriter + + rewriteAttempt match { + + case Right(rewriter) => + val ctx = hookMacros.rewriterCtx( + props = q"props.unbox", + initChildren = q"val children = $PropsChildren.fromRawProps(props)", + children = q"children", + ctxType = ctxType, + ) + val newBody = rewriter(ctx) + c.untypecheck(q""" + val rawComponent: $JsFn.RawComponent[${Box(P)}] = props => $newBody + $ScalaFn.fromBoxed($JsFn.fromJsFn[${Box(P)}, $C](rawComponent)($summoner)) + """) + + case Left(err) => + onFailure(err()) + } + + } catch { + case err: Throwable => + err.printStackTrace() + onFailure(err.getMessage()) + } + + log.footer(hookMacros.showCode(result)) + result + } +} diff --git a/library/coreGeneric/src/main/scala-2/japgolly/scalajs/react/hooks/HookMacrosTraits.scala b/library/coreGeneric/src/main/scala-2/japgolly/scalajs/react/hooks/HookMacrosTraits.scala new file mode 100644 index 000000000..55047cf19 --- /dev/null +++ b/library/coreGeneric/src/main/scala-2/japgolly/scalajs/react/hooks/HookMacrosTraits.scala @@ -0,0 +1,95 @@ +package japgolly.scalajs.react.hooks + +import japgolly.scalajs.react.component.ScalaFn.Component +import japgolly.scalajs.react.hooks.Api._ +import japgolly.scalajs.react.internal.Box +import japgolly.scalajs.react.vdom.VdomNode +import japgolly.scalajs.react.{Children, CtorType, PropsChildren, Reusable, Reusability} + +trait ApiPrimaryWithRenderMacros[P, C <: Children, Ctx, Step <: AbstractStep] { + self: PrimaryWithRender[P, C, Ctx, Step] => + + final def renderRR(f: Ctx => VdomNode)(implicit s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] = + macro HookMacros.render1[P, C, Ctx] + + final def renderRRDebug(f: Ctx => VdomNode)(implicit s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] = + macro HookMacros.renderDebug1[P, C, Ctx] + + final def renderRRReusable[A](f: Ctx => Reusable[A])(implicit s: CtorType.Summoner[Box[P], C], v: A => VdomNode): Component[P, s.CT] = + macro HookMacros.renderReusable1[P, C, A, Ctx] + + final def renderRRReusableDebug[A](f: Ctx => Reusable[A])(implicit s: CtorType.Summoner[Box[P], C], v: A => VdomNode): Component[P, s.CT] = + macro HookMacros.renderReusableDebug1[P, C, A, Ctx] + + final def renderRRWithReuse(f: Ctx => VdomNode)(implicit s: CtorType.Summoner[Box[P], C], r: Reusability[Ctx]): Component[P, s.CT] = + macro HookMacros.renderWithReuse1[P, C, Ctx] + + final def renderRRWithReuseDebug(f: Ctx => VdomNode)(implicit s: CtorType.Summoner[Box[P], C], r: Reusability[Ctx]): Component[P, s.CT] = + macro HookMacros.renderWithReuseDebug1[P, C, Ctx] + + final def renderRRWithReuseBy[A](reusableInputs: Ctx => A)(f: A => VdomNode)(implicit s: CtorType.Summoner[Box[P], C], r: Reusability[A]): Component[P, s.CT] = + macro HookMacros.renderWithReuseBy1[P, C, A, Ctx] + + final def renderRRWithReuseByDebug[A](reusableInputs: Ctx => A)(f: A => VdomNode)(implicit s: CtorType.Summoner[Box[P], C], r: Reusability[A]): Component[P, s.CT] = + macro HookMacros.renderWithReuseByDebug1[P, C, A, Ctx] +} + +// ===================================================================================================================== + +trait ComponentPCMacros[P] { + self: HookComponentBuilder.ComponentPC.First[P] => + + final def renderRR(f: (P, PropsChildren) => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs]): Component[P, s.CT] = + macro HookMacros.renderC1[P] + + final def renderRRDebug(f: (P, PropsChildren) => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs]): Component[P, s.CT] = + macro HookMacros.renderDebugC1[P] + + final def renderRRReusable[A](f: (P, PropsChildren) => Reusable[A])(implicit s: CtorType.Summoner[Box[P], Children.Varargs], v: A => VdomNode): Component[P, s.CT] = + macro HookMacros.renderReusable1C[P, A] + + final def renderRRReusableDebug[A](f: (P, PropsChildren) => Reusable[A])(implicit s: CtorType.Summoner[Box[P], Children.Varargs], v: A => VdomNode): Component[P, s.CT] = + macro HookMacros.renderReusableDebug1C[P, A] + + final def renderRRWithReuse(f: (P, PropsChildren) => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs], r: Reusability[Ctx]): Component[P, s.CT] = + macro HookMacros.renderWithReuse1C[P] + + final def renderRRWithReuseDebug(f: (P, PropsChildren) => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs], r: Reusability[Ctx]): Component[P, s.CT] = + macro HookMacros.renderWithReuseDebug1C[P] + + final def renderRRWithReuseBy[A](reusableInputs: (P, PropsChildren) => A)(f: A => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs], r: Reusability[A]): Component[P, s.CT] = + macro HookMacros.renderWithReuseBy1C[P, A] + + final def renderRRWithReuseByDebug[A](reusableInputs: (P, PropsChildren) => A)(f: A => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs], r: Reusability[A]): Component[P, s.CT] = + macro HookMacros.renderWithReuseByDebug1C[P, A] +} + +// ===================================================================================================================== + +trait ApiSecondaryWithRenderMacros[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn]] { + self: PrimaryWithRender[P, C, Ctx, Step] with Secondary[Ctx, CtxFn, Step] => + + final def renderRR(f: CtxFn[VdomNode])(implicit step: Step, s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] = + macro HookMacros.render2[P, C, Ctx, CtxFn, Step] + + final def renderRRDebug(f: CtxFn[VdomNode])(implicit step: Step, s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] = + macro HookMacros.renderDebug2[P, C, Ctx, CtxFn, Step] + + final def renderRRReusable[A](f: CtxFn[Reusable[A]])(implicit step: Step, s: CtorType.Summoner[Box[P], C], v: A => VdomNode): Component[P, s.CT] = + macro HookMacros.renderReusable2[P, C, A, Ctx] + + final def renderRRReusableDebug[A](f: CtxFn[Reusable[A]])(implicit step: Step, s: CtorType.Summoner[Box[P], C], v: A => VdomNode): Component[P, s.CT] = + macro HookMacros.renderReusableDebug2[P, C, A, Ctx] + + final def renderRRWithReuse(f: CtxFn[VdomNode])(implicit step: Step, s: CtorType.Summoner[Box[P], C], r: Reusability[Ctx]): Component[P, s.CT] = + macro HookMacros.renderWithReuse2[P, C, Ctx] + + final def renderRRWithReuseDebug(f: CtxFn[VdomNode])(implicit step: Step, s: CtorType.Summoner[Box[P], C], r: Reusability[Ctx]): Component[P, s.CT] = + macro HookMacros.renderWithReuseDebug2[P, C, Ctx] + + final def renderRRWithReuseBy[A](reusableInputs: CtxFn[A])(f: A => VdomNode)(implicit step: Step, s: CtorType.Summoner[Box[P], C], r: Reusability[A]): Component[P, s.CT] = + macro HookMacros.renderWithReuseBy2[P, C, A, Ctx] + + final def renderRRWithReuseByDebug[A](reusableInputs: CtxFn[A])(f: A => VdomNode)(implicit step: Step, s: CtorType.Summoner[Box[P], C], r: Reusability[A]): Component[P, s.CT] = + macro HookMacros.renderWithReuseByDebug2[P, C, A, Ctx] +} diff --git a/library/coreGeneric/src/main/scala-3/japgolly/scalajs/react/hooks/HookMacros.scala b/library/coreGeneric/src/main/scala-3/japgolly/scalajs/react/hooks/HookMacros.scala new file mode 100644 index 000000000..bb91ec4f4 --- /dev/null +++ b/library/coreGeneric/src/main/scala-3/japgolly/scalajs/react/hooks/HookMacros.scala @@ -0,0 +1,1069 @@ +package japgolly.scalajs.react.hooks + +import japgolly.microlibs.compiletime.MacroEnv.* +import japgolly.scalajs.react.{Children, CtorType, PropsChildren, Ref => ScalaRef, Reusable, Reusability} +import japgolly.scalajs.react.component.{Js => JsComponent, JsFn, Scala => ScalaComponent, ScalaFn} +import japgolly.scalajs.react.component.ScalaFn.Component +import japgolly.scalajs.react.facade +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.hooks.Api.* +import japgolly.scalajs.react.hooks.CustomHook +import japgolly.scalajs.react.hooks.CustomHook.ReusableDepState +import japgolly.scalajs.react.hooks.HookCtx +import japgolly.scalajs.react.internal.{Box, MacroLogger, ShouldComponentUpdateComponent} +import japgolly.scalajs.react.util.DefaultEffects +import japgolly.scalajs.react.vdom.{TopNode, VdomNode} +import scala.annotation._ +import scala.language.`3.1` +import scala.quoted.* +import scala.reflect.ClassTag +import scala.scalajs.js + +object HookMacros { + import AbstractHookMacros.HookStep + + type PrimaryProxy[P, C <: Children, Ctx, Step <: AbstractStep] = + ApiPrimaryWithRenderMacros[P, C, Ctx, Step] + + type PrimaryApi[P, C <: Children, Ctx, Step <: AbstractStep] = + PrimaryWithRender[P, C, Ctx, Step] + + type SecondaryProxy[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn]] = + ApiSecondaryWithRenderMacros[P, C, Ctx, CtxFn, Step] + + type SecondaryApi[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn]] = + PrimaryWithRender[P, C, Ctx, Step] with Secondary[Ctx, CtxFn, Step] + + // Note: *Workaround methods exist due to https://github.com/lampepfl/dotty/issues/15357 + + // =================================================================================================================== + // render + + inline def render1[P, C <: Children, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: PrimaryProxy[P, C, Ctx, Step], + inline f : Ctx => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], C, CT]): Component[P, CT] = + ${ render1Workaround[P, C, Ctx, Step, CT]('proxy, 'f, 's) } + + inline def renderDebug1[P, C <: Children, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: PrimaryProxy[P, C, Ctx, Step], + inline f : Ctx => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], C, CT]): Component[P, CT] = + ${ renderDebug1Workaround[P, C, Ctx, Step, CT]('proxy, 'f, 's) } + + def render1Workaround[P, C <: Children, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[PrimaryProxy[P, C, Ctx, Step]], + f : Expr[Ctx => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]]) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = + _render1(proxy, f, s, false) + + def renderDebug1Workaround[P, C <: Children, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[PrimaryProxy[P, C, Ctx, Step]], + f : Expr[Ctx => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]]) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = + _render1(proxy, f, s, true) + + def _render1[P, C <: Children, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[PrimaryProxy[P, C, Ctx, Step]], + renderFn: Expr[Ctx => VdomNode], + summoner: Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + debug : Boolean) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[PrimaryApi[P, C, Ctx, Step]]] + apply[P, C, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[Ctx], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRR", Nil, List(List(renderFn.asTerm), List(summoner.asTerm))), + giveUp = () => '{ $self.render($renderFn)($summoner) }, + ) + } + + // ------------------------------------------------------------------------------------------------------------------- + + inline def render1C[P, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: ComponentPCMacros[P], + inline f : (P, PropsChildren) => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]): Component[P, CT] = + ${ render1CWorkaround[P, CT]('proxy, 'f, 's) } + + inline def renderDebug1C[P, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: ComponentPCMacros[P], + inline f : (P, PropsChildren) => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]): Component[P, CT] = + ${ renderDebug1CWorkaround[P, CT]('proxy, 'f, 's) } + + def render1CWorkaround[P, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[ComponentPCMacros[P]], + f : Expr[(P, PropsChildren) => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]]) + (using q: Quotes, P: Type[P], CT: Type[CT]): Expr[Component[P, CT]] = + _render1C(proxy, f, s, false) + + def renderDebug1CWorkaround[P, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[ComponentPCMacros[P]], + f : Expr[(P, PropsChildren) => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]]) + (using q: Quotes, P: Type[P], CT: Type[CT]): Expr[Component[P, CT]] = + _render1C(proxy, f, s, true) + + def _render1C[P, CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[ComponentPCMacros[P]], + renderFn: Expr[(P, PropsChildren) => VdomNode], + summoner: Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]], + debug : Boolean) + (using q: Quotes, P: Type[P], CT: Type[CT]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[HookComponentBuilder.ComponentPC.First[P]]] + apply[P, Children.Varargs, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[HookCtx.PC0[P]], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRR", Nil, List(List(renderFn.asTerm), List(summoner.asTerm))), + giveUp = () => '{ $self.render($renderFn)($summoner) }, + ) + } + + // ------------------------------------------------------------------------------------------------------------------- + + inline def render2[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + inline proxy: SecondaryProxy[P, C, Ctx, CtxFn, Step], + inline f : CtxFn[VdomNode], + inline step : Step, + inline s : CtorType.Summoner.Aux[Box[P], C, CT]): Component[P, CT] = + ${ render2Workaround[P, C, Ctx, CtxFn, Step, CT]('proxy, 'f, 'step, 's) } + + inline def renderDebug2[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + inline proxy: SecondaryProxy[P, C, Ctx, CtxFn, Step], + inline f : CtxFn[VdomNode], + inline step : Step, + inline s : CtorType.Summoner.Aux[Box[P], C, CT]): Component[P, CT] = + ${ renderDebug2Workaround[P, C, Ctx, CtxFn, Step, CT]('proxy, 'f, 'step, 's) } + + def render2Workaround[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + f : Expr[CtxFn[VdomNode]], + step : Expr[Step], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]]) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = + _render2(proxy, f, step, s, false) + + def renderDebug2Workaround[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + f : Expr[CtxFn[VdomNode]], + step : Expr[Step], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]]) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = + _render2(proxy, f, step, s, true) + + def _render2[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + renderFn: Expr[CtxFn[VdomNode]], + step : Expr[Step], + summoner: Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + debug : Boolean) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[SecondaryApi[P, C, Ctx, CtxFn, Step]]] + apply[P, C, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[Ctx], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRR", Nil, List(List(renderFn.asTerm), List(step.asTerm, summoner.asTerm))), + giveUp = () => '{ $self.render($step.squash($renderFn)(_))($summoner) }, + ) + } + + // =================================================================================================================== + // renderReusable + + inline def renderReusable1[P, C <: Children, A, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: PrimaryProxy[P, C, Ctx, Step], + inline f : Ctx => Reusable[A], + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline v : A => VdomNode): Component[P, CT] = + ${ renderReusable1Workaround[P, C, A, Ctx, Step, CT]('proxy, 'f, 's, 'v) } + + inline def renderReusableDebug1[P, C <: Children, A, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: PrimaryProxy[P, C, Ctx, Step], + inline f : Ctx => Reusable[A], + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline v : A => VdomNode): Component[P, CT] = + ${ renderReusableDebug1Workaround[P, C, A, Ctx, Step, CT]('proxy, 'f, 's, 'v) } + + def renderReusable1Workaround[P, C <: Children, A, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[PrimaryProxy[P, C, Ctx, Step]], + f : Expr[Ctx => Reusable[A]], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + v : Expr[A => VdomNode]) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = + _renderReusable1(proxy, f, s, v, false) + + def renderReusableDebug1Workaround[P, C <: Children, A, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[PrimaryProxy[P, C, Ctx, Step]], + f : Expr[Ctx => Reusable[A]], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + v : Expr[A => VdomNode]) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = + _renderReusable1(proxy, f, s, v, true) + + def _renderReusable1[P, C <: Children, A, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[PrimaryProxy[P, C, Ctx, Step]], + f : Expr[Ctx => Reusable[A]], + summoner: Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + v : Expr[A => VdomNode], + debug : Boolean) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[PrimaryApi[P, C, Ctx, Step]]] + apply[P, C, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[Ctx], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRRReusable", List(TypeTree.of[A]), List(List(f.asTerm), List(summoner.asTerm, v.asTerm))), + giveUp = () => '{ $self.renderReusable($f)($summoner, $v) }, + ) + } + + // ------------------------------------------------------------------------------------------------------------------- + + inline def renderReusable1C[P, A, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: ComponentPCMacros[P], + inline f : (P, PropsChildren) => Reusable[A], + inline s : CtorType.Summoner.Aux[Box[P], Children.Varargs, CT], + inline v : A => VdomNode): Component[P, CT] = + ${ renderReusable1CWorkaround[P, A, CT]('proxy, 'f, 's, 'v) } + + inline def renderReusableDebug1C[P, A, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: ComponentPCMacros[P], + inline f : (P, PropsChildren) => Reusable[A], + inline s : CtorType.Summoner.Aux[Box[P], Children.Varargs, CT], + inline v : A => VdomNode): Component[P, CT] = + ${ renderReusableDebug1CWorkaround[P, A, CT]('proxy, 'f, 's, 'v) } + + def renderReusable1CWorkaround[P, A, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[ComponentPCMacros[P]], + f : Expr[(P, PropsChildren) => Reusable[A]], + s : Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]], + v : Expr[A => VdomNode]) + (using q: Quotes, P: Type[P], A: Type[A], CT: Type[CT]): Expr[Component[P, CT]] = + _renderReusable1C(proxy, f, s, v, false) + + def renderReusableDebug1CWorkaround[P, A, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[ComponentPCMacros[P]], + f : Expr[(P, PropsChildren) => Reusable[A]], + s : Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]], + v : Expr[A => VdomNode]) + (using q: Quotes, P: Type[P], A: Type[A], CT: Type[CT]): Expr[Component[P, CT]] = + _renderReusable1C(proxy, f, s, v, true) + + def _renderReusable1C[P, A, CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[ComponentPCMacros[P]], + f : Expr[(P, PropsChildren) => Reusable[A]], + summoner: Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]], + v : Expr[A => VdomNode], + debug : Boolean) + (using q: Quotes, P: Type[P], A: Type[A], CT: Type[CT]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[HookComponentBuilder.ComponentPC.First[P]]] + apply[P, Children.Varargs, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[HookCtx.PC0[P]], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRRReusable", List(TypeTree.of[A]), List(List(f.asTerm), List(summoner.asTerm, v.asTerm))), + giveUp = () => '{ $self.renderReusable($f)($summoner, $v) }, + ) + } + + // ------------------------------------------------------------------------------------------------------------------- + + inline def renderReusable2[P, C <: Children, A, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + inline proxy: SecondaryProxy[P, C, Ctx, CtxFn, Step], + inline f : CtxFn[Reusable[A]], + inline step : Step, + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline v : A => VdomNode): Component[P, CT] = + ${ renderReusable2Workaround[P, C, A, Ctx, CtxFn, Step, CT]('proxy, 'f, 'step, 's, 'v) } + + inline def renderReusableDebug2[P, C <: Children, A, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + inline proxy: SecondaryProxy[P, C, Ctx, CtxFn, Step], + inline f : CtxFn[Reusable[A]], + inline step : Step, + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline v : A => VdomNode): Component[P, CT] = + ${ renderReusableDebug2Workaround[P, C, A, Ctx, CtxFn, Step, CT]('proxy, 'f, 'step, 's, 'v) } + + def renderReusable2Workaround[P, C <: Children, A, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + f : Expr[CtxFn[Reusable[A]]], + step : Expr[Step], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + v : Expr[A => VdomNode]) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = + _renderReusable2(proxy, f, step, s, v, false) + + def renderReusableDebug2Workaround[P, C <: Children, A, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + f : Expr[CtxFn[Reusable[A]]], + step : Expr[Step], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + v : Expr[A => VdomNode]) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = + _renderReusable2(proxy, f, step, s, v, true) + + def _renderReusable2[P, C <: Children, A, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + f : Expr[CtxFn[Reusable[A]]], + step : Expr[Step], + summoner: Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + v : Expr[A => VdomNode], + debug : Boolean) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[SecondaryApi[P, C, Ctx, CtxFn, Step]]] + apply[P, C, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[Ctx], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRRReusable", List(TypeTree.of[A]), List(List(f.asTerm), List(step.asTerm, summoner.asTerm, v.asTerm))), + giveUp = () => '{ $self.renderReusable($step.squash($f)(_))($summoner, $v) }, + ) + } + + // =================================================================================================================== + // renderWithReuse + + inline def renderWithReuse1[P, C <: Children, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: PrimaryProxy[P, C, Ctx, Step], + inline f : Ctx => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline r : Reusability[Ctx]): Component[P, CT] = + ${ renderWithReuse1Workaround[P, C, Ctx, Step, CT]('proxy, 'f, 's, 'r) } + + inline def renderWithReuseDebug1[P, C <: Children, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: PrimaryProxy[P, C, Ctx, Step], + inline f : Ctx => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline r : Reusability[Ctx]): Component[P, CT] = + ${ renderWithReuseDebug1Workaround[P, C, Ctx, Step, CT]('proxy, 'f, 's, 'r) } + + def renderWithReuse1Workaround[P, C <: Children, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[PrimaryProxy[P, C, Ctx, Step]], + f : Expr[Ctx => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[Ctx]]) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = + _renderWithReuse1(proxy, f, s, r, false) + + def renderWithReuseDebug1Workaround[P, C <: Children, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[PrimaryProxy[P, C, Ctx, Step]], + f : Expr[Ctx => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[Ctx]]) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = + _renderWithReuse1(proxy, f, s, r, true) + + def _renderWithReuse1[P, C <: Children, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[PrimaryProxy[P, C, Ctx, Step]], + renderFn: Expr[Ctx => VdomNode], + summoner: Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[Ctx]], + debug : Boolean) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[PrimaryApi[P, C, Ctx, Step]]] + apply[P, C, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[Ctx], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRRWithReuse", Nil, List(List(renderFn.asTerm), List(summoner.asTerm, r.asTerm))), + giveUp = () => '{ $self.renderWithReuse($renderFn)($summoner, $r) }, + ) + } + + // ------------------------------------------------------------------------------------------------------------------- + + inline def renderWithReuse1C[P, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: ComponentPCMacros[P], + inline f : (P, PropsChildren) => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], Children.Varargs, CT], + inline r : Reusability[HookCtx.PC0[P]]): Component[P, CT] = + ${ renderWithReuse1CWorkaround[P, CT]('proxy, 'f, 's, 'r) } + + inline def renderWithReuseDebug1C[P, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: ComponentPCMacros[P], + inline f : (P, PropsChildren) => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], Children.Varargs, CT], + inline r : Reusability[HookCtx.PC0[P]]): Component[P, CT] = + ${ renderWithReuseDebug1CWorkaround[P, CT]('proxy, 'f, 's, 'r) } + + def renderWithReuse1CWorkaround[P, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[ComponentPCMacros[P]], + f : Expr[(P, PropsChildren) => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]], + r : Expr[Reusability[HookCtx.PC0[P]]]) + (using q: Quotes, P: Type[P], CT: Type[CT]): Expr[Component[P, CT]] = + _renderWithReuse1C(proxy, f, s, r, false) + + def renderWithReuseDebug1CWorkaround[P, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[ComponentPCMacros[P]], + f : Expr[(P, PropsChildren) => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]], + r : Expr[Reusability[HookCtx.PC0[P]]]) + (using q: Quotes, P: Type[P], CT: Type[CT]): Expr[Component[P, CT]] = + _renderWithReuse1C(proxy, f, s, r, true) + + def _renderWithReuse1C[P, CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[ComponentPCMacros[P]], + renderFn: Expr[(P, PropsChildren) => VdomNode], + summoner: Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]], + r : Expr[Reusability[HookCtx.PC0[P]]], + debug : Boolean) + (using q: Quotes, P: Type[P], CT: Type[CT]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[HookComponentBuilder.ComponentPC.First[P]]] + apply[P, Children.Varargs, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[HookCtx.PC0[P]], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRRWithReuse", Nil, List(List(renderFn.asTerm), List(summoner.asTerm, r.asTerm))), + giveUp = () => '{ $self.renderWithReuse($renderFn)($summoner, $r) }, + ) + } + + // ------------------------------------------------------------------------------------------------------------------- + + inline def renderWithReuse2[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + inline proxy: SecondaryProxy[P, C, Ctx, CtxFn, Step], + inline f : CtxFn[VdomNode], + inline step : Step, + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline r : Reusability[Ctx]): Component[P, CT] = + ${ renderWithReuse2Workaround[P, C, Ctx, CtxFn, Step, CT]('proxy, 'f, 'step, 's, 'r) } + + inline def renderWithReuseDebug2[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + inline proxy: SecondaryProxy[P, C, Ctx, CtxFn, Step], + inline f : CtxFn[VdomNode], + inline step : Step, + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline r : Reusability[Ctx]): Component[P, CT] = + ${ renderWithReuseDebug2Workaround[P, C, Ctx, CtxFn, Step, CT]('proxy, 'f, 'step, 's, 'r) } + + def renderWithReuse2Workaround[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + f : Expr[CtxFn[VdomNode]], + step : Expr[Step], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[Ctx]]) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = + _renderWithReuse2(proxy, f, step, s, r, false) + + def renderWithReuseDebug2Workaround[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + f : Expr[CtxFn[VdomNode]], + step : Expr[Step], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[Ctx]]) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = + _renderWithReuse2(proxy, f, step, s, r, true) + + def _renderWithReuse2[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + renderFn: Expr[CtxFn[VdomNode]], + step : Expr[Step], + summoner: Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[Ctx]], + debug : Boolean) + (using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[SecondaryApi[P, C, Ctx, CtxFn, Step]]] + apply[P, C, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[Ctx], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRRWithReuse", Nil, List(List(renderFn.asTerm), List(step.asTerm, summoner.asTerm, r.asTerm))), + giveUp = () => '{ $self.renderWithReuse($step.squash($renderFn)(_))($summoner, $r) }, + ) + } + + // =================================================================================================================== + // renderWithReuseBy + + inline def renderWithReuseBy1[P, C <: Children, A, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: PrimaryProxy[P, C, Ctx, Step], + inline i : Ctx => A, + inline f : A => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline r : Reusability[A]): Component[P, CT] = + ${ renderWithReuseBy1Workaround[P, C, A, Ctx, Step, CT]('proxy, 'i, 'f, 's, 'r) } + + inline def renderWithReuseByDebug1[P, C <: Children, A, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: PrimaryProxy[P, C, Ctx, Step], + inline i : Ctx => A, + inline f : A => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline r : Reusability[A]): Component[P, CT] = + ${ renderWithReuseByDebug1Workaround[P, C, A, Ctx, Step, CT]('proxy, 'i, 'f, 's, 'r) } + + def renderWithReuseBy1Workaround[P, C <: Children, A, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[PrimaryProxy[P, C, Ctx, Step]], + i : Expr[Ctx => A], + f : Expr[A => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[A]]) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = + _renderWithReuseBy1(proxy, i, f, s, r, false) + + def renderWithReuseByDebug1Workaround[P, C <: Children, A, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[PrimaryProxy[P, C, Ctx, Step]], + i : Expr[Ctx => A], + f : Expr[A => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[A]]) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = + _renderWithReuseBy1(proxy, i, f, s, r, true) + + def _renderWithReuseBy1[P, C <: Children, A, Ctx, Step <: AbstractStep, CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[PrimaryProxy[P, C, Ctx, Step]], + i : Expr[Ctx => A], + f : Expr[A => VdomNode], + summoner: Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[A]], + debug : Boolean) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], Step: Type[Step]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[PrimaryApi[P, C, Ctx, Step]]] + apply[P, C, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[Ctx], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRRWithReuseBy", List(TypeTree.of[A]), List(List(i.asTerm), List(f.asTerm), List(summoner.asTerm, r.asTerm))), + giveUp = () => '{ $self.renderWithReuseBy($i)($f)($summoner, $r) }, + ) + } + + // ------------------------------------------------------------------------------------------------------------------- + + inline def renderWithReuseBy1C[P, A, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: ComponentPCMacros[P], + inline i : (P, PropsChildren) => A, + inline f : A => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], Children.Varargs, CT], + inline r : Reusability[A]): Component[P, CT] = + ${ renderWithReuseBy1CWorkaround[P, A, CT]('proxy, 'i, 'f, 's, 'r) } + + inline def renderWithReuseByDebug1C[P, A, CT[-p, +u] <: CtorType[p, u]]( + inline proxy: ComponentPCMacros[P], + inline i : (P, PropsChildren) => A, + inline f : A => VdomNode, + inline s : CtorType.Summoner.Aux[Box[P], Children.Varargs, CT], + inline r : Reusability[A]): Component[P, CT] = + ${ renderWithReuseByDebug1CWorkaround[P, A, CT]('proxy, 'i, 'f, 's, 'r) } + + def renderWithReuseBy1CWorkaround[P, A, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[ComponentPCMacros[P]], + i : Expr[(P, PropsChildren) => A], + f : Expr[A => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]], + r : Expr[Reusability[A]]) + (using q: Quotes, P: Type[P], A: Type[A], CT: Type[CT]): Expr[Component[P, CT]] = + _renderWithReuseBy1C(proxy, i, f, s, r, false) + + def renderWithReuseByDebug1CWorkaround[P, A, CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[ComponentPCMacros[P]], + i : Expr[(P, PropsChildren) => A], + f : Expr[A => VdomNode], + s : Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]], + r : Expr[Reusability[A]]) + (using q: Quotes, P: Type[P], A: Type[A], CT: Type[CT]): Expr[Component[P, CT]] = + _renderWithReuseBy1C(proxy, i, f, s, r, true) + + def _renderWithReuseBy1C[P, A, CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[ComponentPCMacros[P]], + i : Expr[(P, PropsChildren) => A], + f : Expr[A => VdomNode], + summoner: Expr[CtorType.Summoner.Aux[Box[P], Children.Varargs, CT]], + r : Expr[Reusability[A]], + debug : Boolean) + (using q: Quotes, P: Type[P], A: Type[A], CT: Type[CT]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[HookComponentBuilder.ComponentPC.First[P]]] + apply[P, Children.Varargs, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[HookCtx.PC0[P]], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRRWithReuseBy", List(TypeTree.of[A]), List(List(i.asTerm), List(f.asTerm), List(summoner.asTerm, r.asTerm))), + giveUp = () => '{ $self.renderWithReuseBy($i)($f)($summoner, $r) }, + ) + } + + // ------------------------------------------------------------------------------------------------------------------- + + inline def renderWithReuseBy2[P, C <: Children, A, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + inline proxy: SecondaryProxy[P, C, Ctx, CtxFn, Step], + inline i : CtxFn[A], + inline f : A => VdomNode, + inline step : Step, + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline r : Reusability[A]): Component[P, CT] = + ${ renderWithReuseBy2Workaround[P, C, A, Ctx, CtxFn, Step, CT]('proxy, 'i, 'f, 'step, 's, 'r) } + + inline def renderWithReuseByDebug2[P, C <: Children, A, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + inline proxy: SecondaryProxy[P, C, Ctx, CtxFn, Step], + inline i : CtxFn[A], + inline f : A => VdomNode, + inline step : Step, + inline s : CtorType.Summoner.Aux[Box[P], C, CT], + inline r : Reusability[A]): Component[P, CT] = + ${ renderWithReuseByDebug2Workaround[P, C, A, Ctx, CtxFn, Step, CT]('proxy, 'i, 'f, 'step, 's, 'r) } + + def renderWithReuseBy2Workaround[P, C <: Children, A, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + i : Expr[CtxFn[A]], + f : Expr[A => VdomNode], + step : Expr[Step], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[A]]) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = + _renderWithReuseBy2(proxy, i, f, step, s, r, false) + + def renderWithReuseByDebug2Workaround[P, C <: Children, A, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy: Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + i : Expr[CtxFn[A]], + f : Expr[A => VdomNode], + step : Expr[Step], + s : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[A]]) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = + _renderWithReuseBy2(proxy, i, f, step, s, r, true) + + def _renderWithReuseBy2[P, C <: Children, A, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn], CT[-p, +u] <: CtorType[p, u]]( + proxy : Expr[SecondaryProxy[P, C, Ctx, CtxFn, Step]], + i : Expr[CtxFn[A]], + f : Expr[A => VdomNode], + step : Expr[Step], + summoner: Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + r : Expr[Reusability[A]], + debug : Boolean) + (using q: Quotes, P: Type[P], C: Type[C], A: Type[A], CT: Type[CT], Ctx: Type[Ctx], CtxFn: Type[CtxFn], Step: Type[Step]): Expr[Component[P, CT]] = { + import quotes.reflect.* + val self = proxy.asInstanceOf[Expr[SecondaryApi[P, C, Ctx, CtxFn, Step]]] + apply[P, C, CT]( + macroApplication = self.asTerm, + ctxType = TypeTree.of[Ctx], + summoner = summoner, + debug = debug, + renderStep = HookStep("renderRRWithReuseBy", List(TypeTree.of[A]), List(List(i.asTerm), List(f.asTerm), List(summoner.asTerm, r.asTerm))), + giveUp = () => '{ $self.renderWithReuseBy($step.squash($i)(_))($f)($summoner, $r) }, + ) + } + + // =================================================================================================================== + + private def HookMacrosImpl(qq: Quotes): HookMacrosImpl { val q: qq.type } = + new HookMacrosImpl { + override implicit val q: qq.type = qq + } + + @nowarn("msg=Consider using canonical type reference .+Underlying instead") + private trait HookMacrosImpl extends AbstractHookMacros { + import AbstractHookMacros._ + + implicit val q: Quotes + import q.reflect.* + import scala.quoted.{Type => Tpe} + + // TODO: Move into microlibs + extension (self: q.reflect.TypeTree) { + @targetName("typeTree_asTypeOf") + def asTypeOf[A <: AnyKind]: Tpe[A] = + self.asType.asInstanceOf[Tpe[A]] + } + extension (self: q.reflect.TypeRepr) { + @targetName("typeRepr_asTypeOf") + def asTypeOf[A <: AnyKind]: Tpe[A] = + self.asType.asInstanceOf[Tpe[A]] + } + + override type Expr[+A] = scala.quoted.Expr[A] + override type Ref = UntypedValDef.WithQuotes[q.type] + override type Stmt = q.reflect.Statement + override type Term = q.reflect.Term + override type Type[A] = Tpe[A] + override type TypeTree = q.reflect.TypeTree + + override protected def asTerm [A] = _.asTerm + override protected def Expr [A] = _.asExprOf[Any].asInstanceOf[Expr[A]] + override protected def refToTerm = _.ref + override def showCode = _.show(using q.reflect.Printer.TreeShortCode) + override protected def showRaw = _.show(using q.reflect.Printer.TreeStructure) + override protected def typeOfTerm = _.tpe.asTypeTree + override protected def uninline = _uninline + override protected def unitTerm = '{ () } + override protected def unitType = Tpe.of[Unit] + override protected def wrap = (s, b) => Block(s.toList, b) + + // TODO: Move into microlibs (and make tailrec and non-recursive versions) + @tailrec + private def _uninline(t: Term): Term = + t match { + case Inlined(_, _, e) => _uninline(e) + case _ => t + } + + override protected def call = (function, args, betaReduce) => { + val f = extractFunction(function) + val t = Apply(Select.unique(f, "apply"), args) + if (betaReduce) + Term.betaReduce(t).getOrElse(t) + else + t + } + + @tailrec + private def extractFunction(term: Term): Term = + term match { + case Inlined(None, Nil, f) => extractFunction(f) + case Block(Nil, expr) => extractFunction(expr) + case f => f + } + + override protected def isUnit = + _.tpe.asType match { + case '[Unit] => true + case _ => false + } + + override protected def Type[A] = + _.asTypeOf[A] + + override protected val rewriterBridge: RewriterBridge = + HookRewriter.Bridge[Stmt, Term, Ref]( + apply = Apply(_, _), + hookCtx = (usesChildren, args) => { + if (usesChildren) { + // .patch below removes the PropsChildren arg + val targs = args.patch(1, Nil, 1).map(_.tpe) + Select.overloaded('{HookCtx.withChildren}.asTerm, "apply", targs, args) + } else + Select.overloaded('{HookCtx}.asTerm, "apply", args.map(_.tpe), args) + }, + refToTerm = _.ref, + scalaVer = 3, + valDef = (n, t, l) => { + val flags = if (l) Flags.Lazy else Flags.EmptyFlags + val r = untypedValDef(n, t.tpe, flags)(t) + (r.valDef, r) + }, + ) + + override val ApplyLike = new ApplyExtractor { + override def unapply(a: Term) = a match { + case Apply(x, y) => Some((x, y)) + case _ => None + } + } + + override val TypeApplyLike = new TypeApplyExtractor { + override def unapply(a: Term) = a match { + case TypeApply(x, y) => Some((x, y)) + case _ => None + } + } + + override val SelectLike = new SelectExtractor { + override def unapply(a: Term) = a match { + case Select(x, y) => Some((x, y)) + case _ => None + } + } + + override val FunctionLike = new FunctionExtractor { + @tailrec + override def unapply(function: Term) = function match { + + case Apply(TypeApply(f, args), _) if f.tpe.show.startsWith("scala.scalajs.js.Any.toFunction") => + Some(args.size - 1) + + case Block(List(DefDef(_, List(TermParamClause(params)), _, Some(_))), Closure(Ident(_), _)) => + Some(params.size) + + case Block(Nil, expr) => + unapply(expr) + + case Block(stmts1, Block(stmts2, expr)) => + val stmts = if (stmts2.isEmpty) stmts1 else stmts1 ::: stmts2 + unapply(Block(stmts, expr)) + + case i@ Ident(_) => + i.symbol.tree match { + case d: DefDef => byTypeRepr(d.returnTpt.tpe) + case v: ValDef => byTypeRepr(v.tpt.tpe) + case _ => None + } + + case _ => + None + } + + private def byTypeRepr(t: TypeRepr): Option[Success] = t match { + case AppliedType(TypeRef(ThisType(_), f), args) if f.startsWith("Function") => + Some(args.size - 1) + case _ => + None + } + } + + override protected def custom[I, O] = implicit (ti, to, hook, i) => + '{ $hook.unsafeInit($i) } + + override protected def customArg[Ctx, Arg] = implicit (tc, ta, hookArg, ctx) => + '{ $hookArg.convert($ctx) } + + override protected def hookDepsEmptyArray = + '{ js.Array[Any]() } + + override protected def hookDepsIntArray1 = i => + '{ js.Array[Int]($i) } + + override protected def hooksVar[A] = implicit (tpe, body) => + '{ Hooks.Var[$tpe]($body) } + + override protected def jsComponentRawMountedType[P <: js.Object, S <: js.Object] = implicit (tpeP, tpeS) => + Tpe.of[JsComponent.RawMounted[P, S]] + + override protected def jsComponentRawMountedTypeWithFacade[P <: js.Object, S <: js.Object, F] = implicit (tpeP, tpeS, tpeF) => + Tpe.of[JsComponent.RawMounted[P, S] with F] + + override protected def none[A] = implicit tpe => + '{ None } + + override protected def optionType[A] = { + case '[a] => Tpe.of[Option[a]].asInstanceOf[Type[Option[A]]] + } + + override protected def refFromJs[A] = implicit (ref, tpe) => + '{ ScalaRef.fromJs($ref) } + + override protected def refMapJsMounted[P <: js.Object, S <: js.Object] = implicit (ref, tpeP, tpeS) => + '{ $ref.map(JsComponent.mounted(_)) } + + override protected def refMapJsMountedWithFacade[P <: js.Object, S <: js.Object, F <: js.Object] = implicit (ref, tpeP, tpeS, tpeF) => + '{ $ref.map(JsComponent.mounted[P, S](_).addFacade[F]) } + + override protected def refMapMountedImpure[P, S, B] = implicit (ref, tpeS, tpeP, tpeB) => + '{ $ref.map(_.mountedImpure) } + + override protected def refWithJsComponentArgHelper[F[_], A[_], P1, S1, CT1[-p, +u] <: CtorType[p, u], R <: JsComponent.RawMounted[P0, S0], P0 <: js.Object, S0 <: js.Object, CT0[-p, +u] <: CtorType[p, u]] = + implicit (r, a, ttF, ttA, tpeP1, tpeS1, ttCT1, tpeR, tpeP0, tpeS0) => { + implicit val tpeF = ttF.asTypeOf[F] + implicit val tpeA = ttA.asTypeOf[A] + implicit val tpeC = ttCT1.asTypeOf[CT1] + '{ AbstractHookMacros.helperRefToJsComponent($r, $a) } + } + + override protected def refNarrowOption[A, B <: A] = implicit (ref, ct, tpeA, tpeB) => + '{ $ref.narrowOption[$tpeB]($ct) } + + override protected def refToComponentInject[P, S, B, CT[-p, +u] <: CtorType[p, u]] = implicit (c, r, tpeS, tpeP, tpeB, ttCT) => { + implicit val tpeCT = ttCT.asTypeOf[CT] + '{ AbstractHookMacros.helperRefToComponentInject($c, $r) } + } + + override protected def reusableDepsLogic[D] = implicit (d, s, r, tpeD) => + '{ CustomHook.reusableDepsLogic[D]($d)($s)($r) } + + override protected def reusableDepStateRev = rds => + '{ $rds.rev } + + override protected def reusableDepStateType[D] = { + case '[d] => Tpe.of[ReusableDepState[d]].asInstanceOf[Type[ReusableDepState[D]]] + } + + override protected def reusableDepStateValue[D] = implicit (rds, tpeD) => + '{ $rds.value } + + override protected def reusableValueByInt[A] = implicit (i, a, tpeA) => + '{ Reusable.implicitly($i).withValue($a) } + + override protected def topNodeType = + Tpe.of[TopNode] + + override protected def scalaComponentRawMountedType[P, S, B] = implicit (tpeS, tpeP, tpeB) => + Tpe.of[ScalaComponent.RawMounted[P, S, B]] + + override protected def scalaFn0[A] = implicit (tpe, body) => + '{ () => $body } + + override protected def useCallback[F <: js.Function] = implicit (f, deps, tpe) => + '{ React.useCallback($f, $deps) } + + override protected def useCallbackArgFromJs[A, J <: js.Function] = implicit (x, j, ta, tj) => + '{ $x.fromJs($j) } + + override protected def useCallbackArgToJs[A, J <: js.Function] = implicit (x, a, ta, tj) => + '{ $x.toJs($a) } + + override protected def useCallbackArgTypeJs[A, J <: js.Function] = x => + TypeSelect(x.asTerm, "J").asTypeOf[J] + + override protected def useContext[A] = implicit (ctx, tpe) => + '{ React.useContext($ctx.raw) } + + override protected def useDebugValue = desc => + '{ React.useDebugValue[Null](null, _ => $desc) } + + override protected def useEffect = implicit (a, d) => + '{ React.useEffect($a, $d) } + + override protected def useEffectArgToJs[A] = implicit (arg, a, tpeA) => + '{ $arg.toJs($a) } + + override protected def useForceUpdate1 = + '{ React.useStateValue(0) } + + override protected def useForceUpdate2 = s => + '{ CustomHook.useForceUpdateRaw($s) } + + override protected def useLayoutEffect = implicit (a, d) => + '{ React.useLayoutEffect($a, $d) } + + override protected def useMemo[A] = implicit (a, d, tpeA) => + '{ React.useMemo(() => $a, $d) } + + override protected def useReducer[S, A] = implicit (r, s, tpeS, tpeA) => + '{ React.useReducer[Null, $tpeS, $tpeA](js.Any.fromFunction2($r), null, _ => $s) } + + override protected def useReducerFromJs[S, A] = implicit (raw, tpeS, tpeA) => + '{ Hooks.UseReducer.fromJs($raw) } + + override protected def useRef[A] = implicit (a, tpe) => + '{ React.useRef($a) } + + override protected def useRefOrNull[A] = implicit (tpe) => + '{ React.useRef[$tpe | Null](null) } + + override protected def useRefFromJs[A] = implicit (ref, tpe) => + '{ Hooks.UseRef.fromJs($ref) } + + override protected def useStateFn[S] = implicit (tpe, body) => + '{ React.useStateFn(() => Box[$tpe]($body)) } + + override protected def useStateValue[S] = implicit (tpe, body) => + '{ React.useStateValue(Box[$tpe]($body)) } + + override protected def useStateFromJsBoxed[S] = implicit (tpe, raw) => + '{ Hooks.UseState.fromJsBoxed[$tpe]($raw) } + + override protected def useStateWithReuseFromJsBoxed[S] = implicit (tpe, raw, reuse, ct) => + '{ Hooks.UseStateWithReuse.fromJsBoxed[$tpe]($raw)($reuse, $ct) } + + override protected def vdomRawNode = vdom => + '{ $vdom.rawNode } + + override protected def reusabilityReusable[A] = implicit tpe => + '{ Reusable.reusableReusability[A] } + + override protected def reusableMap[A, B] = implicit (r, f, tpeA, tpeB) => + '{ $r.map($f) } + + override protected def reusableType[A] = { + case '[a] => Tpe.of[Reusable[a]].asInstanceOf[Type[Reusable[A]]] + } + + override protected def reusableValue[A] = implicit (r, tpe) => + '{ $r.value } + + override protected def shouldComponentUpdateComponent = (rev, render) => + '{ ShouldComponentUpdateComponent($rev, () => $render) } + + override protected def vdomNodeType = + Tpe.of[VdomNode] + } + + // =================================================================================================================== + + private def apply[P, C <: Children, CT[-p, +u] <: CtorType[p, u]]( + using q: Quotes, P: Type[P], C: Type[C], CT: Type[CT])( + macroApplication: q.reflect.Term, + ctxType : q.reflect.TypeTree, + summoner : Expr[CtorType.Summoner.Aux[Box[P], C, CT]], + debug : Boolean, + renderStep : HookStep[q.reflect.Term, q.reflect.TypeTree], + giveUp : () => Expr[Component[P, CT]]): Expr[Component[P, CT]] = { + + import quotes.reflect.* + + val hookMacros = HookMacrosImpl(q) + + import hookMacros.log + log.enabled = debug + log.header() + // log("self", macroApplication.show) + + def onFailure(msg: String): Expr[Component[P, CT]] = { + import Console._ + log(RED_B + WHITE + "Giving up. " + msg + RESET) + report.warning(msg) + giveUp() + } + + val result: Expr[Component[P, CT]] = + try { + + val rewriteAttempt = + for { + hookDefn <- hookMacros.parse(macroApplication) + rewriter <- hookMacros.rewriteComponent(hookDefn + renderStep) + } yield rewriter + + rewriteAttempt match { + + case Right(rewriter) => + type JsProps = Box[P] with facade.PropsWithChildren + + def newBody(props: Expr[JsProps]): Expr[React.Node] = { + val children = typedValDef[PropsChildren]("children", Flags.EmptyFlags)('{ PropsChildren.fromRawProps($props) }) + val ctx = hookMacros.rewriterCtx( + props = '{ $props.unbox }.asTerm, + initChildren = children.valDef, + children = children.ref.asTerm, + ctxType = ctxType, + ) + rewriter(ctx) + } + + '{ + val rawComponent: JsFn.RawComponent[Box[P]] = props => ${newBody('props)} + ScalaFn.fromBoxed(JsFn.fromJsFn[Box[P], C](rawComponent)($summoner)) + } + + case Left(err) => + onFailure(err()) + } + + } catch { + case err: Throwable => + // err.printStackTrace() + onFailure(err.getMessage()) + } + + log.footer(hookMacros.showCode(result.asTerm)) + result + } + +} diff --git a/library/coreGeneric/src/main/scala-3/japgolly/scalajs/react/hooks/HookMacrosTraits.scala b/library/coreGeneric/src/main/scala-3/japgolly/scalajs/react/hooks/HookMacrosTraits.scala new file mode 100644 index 000000000..341d41a22 --- /dev/null +++ b/library/coreGeneric/src/main/scala-3/japgolly/scalajs/react/hooks/HookMacrosTraits.scala @@ -0,0 +1,149 @@ +package japgolly.scalajs.react.hooks + +import japgolly.microlibs.compiletime.MacroEnv.* +import japgolly.scalajs.react.component.{JsFn, ScalaFn} +import japgolly.scalajs.react.component.ScalaFn.Component +import japgolly.scalajs.react.facade +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.hooks.Api.* +import japgolly.scalajs.react.hooks.HookCtx +import japgolly.scalajs.react.internal.{Box, MacroLogger} +import japgolly.scalajs.react.vdom.VdomNode +import japgolly.scalajs.react.{Children, CtorType, PropsChildren, Reusable, Reusability} +import scala.annotation._ +import scala.quoted.* +import scala.reflect.ClassTag +import scala.scalajs.js + +trait ApiPrimaryWithRenderMacros[P, C <: Children, Ctx, Step <: AbstractStep] { + self: PrimaryWithRender[P, C, Ctx, Step] => +} + +object ApiPrimaryWithRenderMacros { + extension [P, C <: Children, Ctx, Step <: AbstractStep](inline self: ApiPrimaryWithRenderMacros[P, C, Ctx, Step]) { + + inline def renderRR(inline f: Ctx => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] = + HookMacros.render1[P, C, Ctx, Step, s.CT](self, f, s) + + inline def renderRRDebug(inline f: Ctx => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] = + HookMacros.renderDebug1[P, C, Ctx, Step, s.CT](self, f, s) + + inline def renderRRReusable[A](inline f: Ctx => Reusable[A])(implicit s: CtorType.Summoner[Box[P], C], inline v: A => VdomNode): Component[P, s.CT] = + HookMacros.renderReusable1[P, C, A, Ctx, Step, s.CT](self, f, s, v) + + inline def renderRRReusableDebug[A](inline f: Ctx => Reusable[A])(implicit s: CtorType.Summoner[Box[P], C], inline v: A => VdomNode): Component[P, s.CT] = + HookMacros.renderReusableDebug1[P, C, A, Ctx, Step, s.CT](self, f, s, v) + + inline def renderRRWithReuse(inline f: Ctx => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[Ctx]): Component[P, s.CT] = + HookMacros.renderWithReuse1[P, C, Ctx, Step, s.CT](self, f, s, r) + + inline def renderRRWithReuseDebug(inline f: Ctx => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[Ctx]): Component[P, s.CT] = + HookMacros.renderWithReuseDebug1[P, C, Ctx, Step, s.CT](self, f, s, r) + + inline def renderRRWithReuseBy[A](inline reusableInputs: Ctx => A)(inline f: A => VdomNode) + (implicit inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[A]): Component[P, s.CT] = + HookMacros.renderWithReuseBy1[P, C, A, Ctx, Step, s.CT](self, reusableInputs, f, s, r) + + inline def renderRRWithReuseByDebug[A](inline reusableInputs: Ctx => A)(inline f: A => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[A]): Component[P, s.CT] = + HookMacros.renderWithReuseByDebug1[P, C, A, Ctx, Step, s.CT](self, reusableInputs, f, s, r) + } +} + +// ===================================================================================================================== + +trait ComponentPCMacros[P] + extends ApiPrimaryWithRenderMacros[P, Children.Varargs, HookCtx.PC0[P], HookComponentBuilder.ComponentPC.FirstStep[P]] { + self: HookComponentBuilder.ComponentPC.First[P] => +} + +object ComponentPCMacros { + extension [P](inline self: ComponentPCMacros[P]) { + + inline def renderRR(inline f: (P, PropsChildren) => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], Children.Varargs]): Component[P, s.CT] = + HookMacros.render1C[P, s.CT](self, f, s) + + inline def renderRRDebug(inline f: (P, PropsChildren) => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], Children.Varargs]): Component[P, s.CT] = + HookMacros.renderDebug1C[P, s.CT](self, f, s) + + inline def renderRRReusable[A](inline f: (P, PropsChildren) => Reusable[A])(implicit inline s: CtorType.Summoner[Box[P], Children.Varargs], inline v: A => VdomNode): Component[P, s.CT] = + HookMacros.renderReusable1C[P, A, s.CT](self, f, s, v) + + inline def renderRRReusableDebug[A](inline f: (P, PropsChildren) => Reusable[A])(implicit inline s: CtorType.Summoner[Box[P], Children.Varargs], inline v: A => VdomNode): Component[P, s.CT] = + HookMacros.renderReusableDebug1C[P, A, s.CT](self, f, s, v) + + inline def renderRRWithReuse(inline f: (P, PropsChildren) => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], Children.Varargs], inline r: Reusability[HookCtx.PC0[P]]): Component[P, s.CT] = + HookMacros.renderWithReuse1C[P, s.CT](self, f, s, r) + + inline def renderRRWithReuseDebug(inline f: (P, PropsChildren) => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], Children.Varargs], inline r: Reusability[HookCtx.PC0[P]]): Component[P, s.CT] = + HookMacros.renderWithReuseDebug1C[P, s.CT](self, f, s, r) + + inline def renderRRWithReuseBy[A](inline reusableInputs: (P, PropsChildren) => A)(inline f: A => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], Children.Varargs], inline r: Reusability[A]): Component[P, s.CT] = + HookMacros.renderWithReuseBy1C[P, A, s.CT](self, reusableInputs, f, s, r) + + inline def renderRRWithReuseByDebug[A](inline reusableInputs: (P, PropsChildren) => A)(inline f: A => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], Children.Varargs], inline r: Reusability[A]): Component[P, s.CT] = + HookMacros.renderWithReuseByDebug1C[P, A, s.CT](self, reusableInputs, f, s, r) + } +} + +// ===================================================================================================================== + +trait ApiSecondaryWithRenderMacros[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn]] + extends ApiPrimaryWithRenderMacros[P, C, Ctx, Step] { + self: PrimaryWithRender[P, C, Ctx, Step] with Secondary[Ctx, CtxFn, Step] => +} + +object ApiSecondaryWithRenderMacros { + extension [P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn]](inline self: ApiSecondaryWithRenderMacros[P, C, Ctx, CtxFn, Step]) { + + inline def renderRR(inline f: CtxFn[VdomNode])(implicit inline step: Step, inline s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] = + HookMacros.render2[P, C, Ctx, CtxFn, Step, s.CT](self, f, step, s) + + inline def renderRRDebug(inline f: CtxFn[VdomNode])(implicit inline step: Step, inline s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] = + HookMacros.renderDebug2[P, C, Ctx, CtxFn, Step, s.CT](self, f, step, s) + + inline def renderRRReusable[A](inline f: CtxFn[Reusable[A]])(implicit inline step: Step, inline s: CtorType.Summoner[Box[P], C], inline v: A => VdomNode): Component[P, s.CT] = + HookMacros.renderReusable2[P, C, A, Ctx, CtxFn, Step, s.CT](self, f, step, s, v) + + inline def renderRRReusableDebug[A](inline f: CtxFn[Reusable[A]])(implicit inline step: Step, inline s: CtorType.Summoner[Box[P], C], inline v: A => VdomNode): Component[P, s.CT] = + HookMacros.renderReusableDebug2[P, C, A, Ctx, CtxFn, Step, s.CT](self, f, step, s, v) + + inline def renderRRWithReuse(inline f: CtxFn[VdomNode])(implicit inline step: Step, inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[Ctx]): Component[P, s.CT] = + HookMacros.renderWithReuse2[P, C, Ctx, CtxFn, Step, s.CT](self, f, step, s, r) + + inline def renderRRWithReuseDebug(inline f: CtxFn[VdomNode])(implicit inline step: Step, inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[Ctx]): Component[P, s.CT] = + HookMacros.renderWithReuseDebug2[P, C, Ctx, CtxFn, Step, s.CT](self, f, step, s, r) + + inline def renderRRWithReuseBy[A](inline reusableInputs: CtxFn[A])(inline f: A => VdomNode)(implicit inline step: Step, inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[A]): Component[P, s.CT] = + HookMacros.renderWithReuseBy2[P, C, A, Ctx, CtxFn, Step, s.CT](self, reusableInputs, f, step, s, r) + + inline def renderRRWithReuseByDebug[A](inline reusableInputs: CtxFn[A])(inline f: A => VdomNode)(implicit inline step: Step, inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[A]): Component[P, s.CT] = + HookMacros.renderWithReuseByDebug2[P, C, A, Ctx, CtxFn, Step, s.CT](self, reusableInputs, f, step, s, r) + + // ----------------------------------------------------------------------------------------------- + // Gotta duplicate the primary extensions below due to the way Scala 3 handles overload resolution + + inline def renderRR(inline f: Ctx => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] = + HookMacros.render1[P, C, Ctx, Step, s.CT](self, f, s) + + inline def renderRRDebug(inline f: Ctx => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] = + HookMacros.renderDebug1[P, C, Ctx, Step, s.CT](self, f, s) + + inline def renderRRReusable[A](inline f: Ctx => Reusable[A])(implicit s: CtorType.Summoner[Box[P], C], inline v: A => VdomNode): Component[P, s.CT] = + HookMacros.renderReusable1[P, C, A, Ctx, Step, s.CT](self, f, s, v) + + inline def renderRRReusableDebug[A](inline f: Ctx => Reusable[A])(implicit s: CtorType.Summoner[Box[P], C], inline v: A => VdomNode): Component[P, s.CT] = + HookMacros.renderReusableDebug1[P, C, A, Ctx, Step, s.CT](self, f, s, v) + + inline def renderRRWithReuse(inline f: Ctx => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[Ctx]): Component[P, s.CT] = + HookMacros.renderWithReuse1[P, C, Ctx, Step, s.CT](self, f, s, r) + + inline def renderRRWithReuseDebug(inline f: Ctx => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[Ctx]): Component[P, s.CT] = + HookMacros.renderWithReuseDebug1[P, C, Ctx, Step, s.CT](self, f, s, r) + + inline def renderRRWithReuseBy[A](inline reusableInputs: Ctx => A)(inline f: A => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[A]): Component[P, s.CT] = + HookMacros.renderWithReuseBy1[P, C, A, Ctx, Step, s.CT](self, reusableInputs, f, s, r) + + inline def renderRRWithReuseByDebug[A](inline reusableInputs: Ctx => A)(inline f: A => VdomNode)(implicit inline s: CtorType.Summoner[Box[P], C], inline r: Reusability[A]): Component[P, s.CT] = + HookMacros.renderWithReuseByDebug1[P, C, A, Ctx, Step, s.CT](self, reusableInputs, f, s, r) + } +} diff --git a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/Reusability.scala b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/Reusability.scala index df2de38f6..1aaa855d2 100644 --- a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/Reusability.scala +++ b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/Reusability.scala @@ -286,6 +286,9 @@ object Reusability extends ReusabilityMacros with ScalaVersionSpecificReusabilit implicit def box[A: Reusability]: Reusability[Box[A]] = by(_.unbox) + implicit def propsChildren: Reusability[PropsChildren] = + apply((x, y) => x.raw == y.raw) + implicit def range: Reusability[Range] = byRefOr_== diff --git a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/component/JsFn.scala b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/component/JsFn.scala index 94c44c62a..e57669701 100644 --- a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/component/JsFn.scala +++ b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/component/JsFn.scala @@ -11,9 +11,10 @@ import scala.scalajs.js object JsFn extends JsBaseComponentTemplate[facade.React.StatelessFunctionalComponent] { - type Component[P <: js.Object, CT[-p, +u] <: CtorType[p, u]] = ComponentRoot[P, CT, Unmounted[P]] - type Unmounted[P <: js.Object] = UnmountedRoot[P] - type Mounted = Unit + type RawComponent[P <: js.Object] = js.Function1[P with facade.PropsWithChildren, facade.React.Node] + type Component [P <: js.Object, CT[-p, +u] <: CtorType[p, u]] = ComponentRoot[P, CT, Unmounted[P]] + type Unmounted [P <: js.Object] = UnmountedRoot[P] + type Mounted = Unit def apply[P <: js.Object, C <: Children] (raw: js.Any) @@ -27,9 +28,9 @@ object JsFn extends JsBaseComponentTemplate[facade.React.StatelessFunctionalComp componentRoot[P, s.CT, Unmounted[P]](rc, s.pf.rmap(s.summon(rc))(unmountedRoot))(s.pf) } - def fromJsFn[P <: js.Object, C <: Children](render: js.Function1[P with facade.PropsWithChildren, facade.React.Element]) - (implicit s: CtorType.Summoner[P, C]): Component[P, s.CT] = - JsFn.force[P, C](render)(s) + // TODO: This name... fromRaw? fromJs? Is it consistent across the project? + @inline def fromJsFn[P <: js.Object, C <: Children](render: RawComponent[P])(implicit s: CtorType.Summoner[P, C]): Component[P, s.CT] = + force[P, C](render)(s) /** Type used when creating a JsFnComponent that ignores its props */ type UnusedObject = Box[Unit] diff --git a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/component/ScalaFn.scala b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/component/ScalaFn.scala index 0fc3d6a75..78f9b6cd3 100644 --- a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/component/ScalaFn.scala +++ b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/component/ScalaFn.scala @@ -4,7 +4,6 @@ import japgolly.scalajs.react.hooks.HookComponentBuilder import japgolly.scalajs.react.internal._ import japgolly.scalajs.react.vdom.VdomNode import japgolly.scalajs.react.{Children, CtorType, PropsChildren, Reusability, facade} -import scala.scalajs.js object ScalaFn { @@ -12,22 +11,12 @@ object ScalaFn { type Unmounted[P] = JsFn.UnmountedWithRoot[P, Mounted, Box[P]] type Mounted = JsFn.Mounted - private def create[P, C <: Children, CT[-p, +u] <: CtorType[p, u]] - (render: Box[P] with facade.PropsWithChildren => VdomNode) - (implicit s: CtorType.Summoner.Aux[Box[P], C, CT]): Component[P, CT] = { - - val jsRender = render.andThen(_.rawNode): js.Function1[Box[P] with facade.PropsWithChildren, facade.React.Node] - val rawComponent = jsRender.asInstanceOf[facade.React.StatelessFunctionalComponent[Box[P]]] - JsFn.force[Box[P], C](rawComponent)(s) - .cmapCtorProps[P](Box(_)) - .mapUnmounted(_.mapUnmountedProps(_.unbox)) - } + def fromBoxed[P, CT[-p, +u] <: CtorType[p, u]](js: JsFn.Component[Box[P], CT]): Component[P, CT] = + js.cmapCtorProps[P](Box(_)).mapUnmounted(_.mapUnmountedProps(_.unbox)) @inline def withHooks[P] = HookComponentBuilder.apply[P] - // =================================================================================================================== - def apply[P](render: P => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.None]): Component[P, s.CT] = create[P, Children.None, s.CT](b => render(b.unbox))(s) @@ -37,8 +26,6 @@ object ScalaFn { def justChildren(render: PropsChildren => VdomNode): Component[Unit, CtorType.Children] = create(b => render(PropsChildren(b.children))) - // =================================================================================================================== - def withReuse[P](render: P => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.None], r: Reusability[P]): Component[P, s.CT] = withHooks[P].renderWithReuse(render)(s, r) @@ -46,8 +33,17 @@ object ScalaFn { withHooks[P].renderWithReuseBy(reusableInputs)(render)(s, r) def withChildrenAndReuse[P](render: (P, PropsChildren) => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs], rp: Reusability[P], rc: Reusability[PropsChildren]): Component[P, s.CT] = - withHooks[P].withPropsChildren.renderWithReuse(i => render(i.props, i.propsChildren)) + withHooks[P].withPropsChildren.renderWithReuse(render) def withChildrenAndReuse[P, A](reusableInputs: (P, PropsChildren) => A)(render: A => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs], r: Reusability[A]): Component[P, s.CT] = - withHooks[P].withPropsChildren.renderWithReuseBy(i => reusableInputs(i.props, i.propsChildren))(render) + withHooks[P].withPropsChildren.renderWithReuseBy(reusableInputs)(render) + + // =================================================================================================================== + + private def create[P, C <: Children, CT[-p, +u] <: CtorType[p, u]] + (render: Box[P] with facade.PropsWithChildren => VdomNode) + (implicit s: CtorType.Summoner.Aux[Box[P], C, CT]): Component[P, CT] = { + val jsRender: JsFn.RawComponent[Box[P]] = render(_).rawNode + fromBoxed(JsFn.fromJsFn[Box[P], C](jsRender)(s)) + } } diff --git a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/AbstractHookMacros.scala b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/AbstractHookMacros.scala new file mode 100644 index 000000000..afe332acb --- /dev/null +++ b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/AbstractHookMacros.scala @@ -0,0 +1,958 @@ +package japgolly.scalajs.react.hooks + +import japgolly.scalajs.react.React.Context +import japgolly.scalajs.react.component.{Js => JsComponent, Scala => ScalaComponent} +import japgolly.scalajs.react.facade.React +import japgolly.scalajs.react.facade.React.HookDeps +import japgolly.scalajs.react.hooks.CustomHook.ReusableDepState +import japgolly.scalajs.react.hooks.Hooks +import japgolly.scalajs.react.internal.{Box, MacroLogger} +import japgolly.scalajs.react.util.DefaultEffects +import japgolly.scalajs.react.vdom.{TopNode, VdomNode} +import japgolly.scalajs.react.{CtorType, Ref, Reusability, Reusable} +import scala.annotation.{nowarn, tailrec} +import scala.reflect.ClassTag +import scala.scalajs.js +import scala.scalajs.js.| + +/* Coverage: render + * ================ + * + * - P + * - behaviour tested in HooksRRTest.testProps() + * - react-refresh integration tested in JustPropsViaHookApi + * + * - CtxObj(P) + * - behaviour tested in HooksRRTest.testUseState() + * - react-refresh integration tested in UseStateWithReuse + * + * - CtxFn(P) + * - behaviour tested in HooksRRTest.testUseCallback() + * - react-refresh integration tested in UseState + * + * - (P, PC) + * - behaviour tested in HooksRRTest.testPropsChildren() + * - react-refresh integration tested in JustPropsChildrenViaHookApi + * + * - CtxObj(P, PC) + * - behaviour tested in HooksRRTest.testPropsChildrenCtxObj() + * - react-refresh integration tested in HooksWithChildrenCtxObj + * + * - CtxFn(P, PC) + * - behaviour tested in HooksRRTest.testPropsChildrenCtxFn() + * - react-refresh integration tested in HooksWithChildrenCtxFn + * + * + * Coverage: renderReusable + * ======================== + * + * - P + * - behaviour tested in HooksRRTest.xxxxx() + * - react-refresh integration tested in RenderReusable.P + * + * - CtxObj(P) + * - behaviour tested in HooksRRTest.xxxxx() + * - react-refresh integration tested in RenderReusable.CtxObj_P + * + * - CtxFn(P) + * - behaviour tested in HooksRRTest.xxxxx() + * - react-refresh integration tested in RenderReusable.CtxFn_P + * + * - (P, PC) + * - behaviour tested in HooksRRTest.xxxxx() + * - react-refresh integration tested in RenderReusable.P_PC + * + * - CtxObj(P, PC) + * - behaviour tested in HooksRRTest.xxxxx() + * - react-refresh integration tested in RenderReusable.CtxObj_P_PC + * + * - CtxFn(P, PC) + * - behaviour tested in HooksRRTest.xxxxx() + * - react-refresh integration tested in RenderReusable.CtxFn_P_PC + * + * + * Coverage: renderWithReuse + * ========================= + * + * - P + * - behaviour tested in HooksRRTest.testRenderWithReuseNever() + * - react-refresh integration tested in RenderWithReuse.P + * + * - CtxObj(P) + * - behaviour tested in HooksRRTest.testRenderWithReuseAndUseRef() + * - react-refresh integration tested in RenderWithReuse.CtxObj_P + * + * - CtxFn(P) + * - behaviour tested in HooksRRTest.testRenderWithReuse() + * - react-refresh integration tested in RenderWithReuse.CtxFn_P + * + * - (P, PC) + * - behaviour tested in HooksRRTest.testRenderWithReuseNeverPC() + * - react-refresh integration tested in RenderWithReuse.P_PC + * + * - CtxObj(P, PC) + * - behaviour tested in HooksRRTest.testRenderWithReuseAndUseRefToVdomO() + * - react-refresh integration tested in RenderWithReuse.CtxObj_P_PC + * + * - CtxFn(P, PC) + * - behaviour tested in HooksRRTest.testRenderWithReuseAndUseRefToVdom() + * - react-refresh integration tested in RenderWithReuse.CtxFn_P_PC + * + * + * Coverage: renderWithReuseBy + * =========================== + * + * - P + * - behaviour tested in HooksRRTest.testRenderWithReuseByNever() + * - react-refresh integration tested in RenderWithReuseBy.P + * + * - CtxObj(P) + * - behaviour tested in HooksRRTest.testRenderWithReuseByAndUseRef() + * - react-refresh integration tested in RenderWithReuseBy.CtxObj_P + * + * - CtxFn(P) + * - behaviour tested in HooksRRTest.testRenderWithReuseBy() + * - react-refresh integration tested in RenderWithReuseBy.CtxFn_P + * + * - (P, PC) + * - behaviour tested in HooksRRTest.testRenderWithReuseByNeverPC() + * - react-refresh integration tested in RenderWithReuseBy.P_PC + * + * - CtxObj(P, PC) + * - behaviour tested in HooksRRTest.testRenderWithReuseByAndUseRefToVdomO() + * - react-refresh integration tested in RenderWithReuseBy.CtxObj_P_PC + * + * - CtxFn(P, PC) + * - behaviour tested in HooksRRTest.testRenderWithReuseByAndUseRefToVdom() + * - react-refresh integration tested in RenderWithReuseBy.CtxFn_P_PC + */ +object AbstractHookMacros { + + final case class HookDefn[Term, TypeTree](steps: Vector[HookStep[Term, TypeTree]]) { + def +(s: HookStep[Term, TypeTree]): HookDefn[Term, TypeTree] = + HookDefn(steps :+ s) + } + + final case class HookStep[Term, TypeTree](name: String, targs: List[TypeTree], args: List[List[Term]]) { + def desc = name + def sig = (targs, args) + } + + @inline def helperRefToComponentInject[P, S, B, CT[-p, +u] <: CtorType[p, u]](c: ScalaComponent.Component[P, S, B, CT], r: Ref.ToScalaComponent[P, S, B]): Ref.WithScalaComponent[P, S, B, CT] = + Ref.ToComponent.inject(c, r) + + def helperRefToJsComponent[F[_], A[_], P1, S1, CT1[-p, +u] <: CtorType[p, u], R <: JsComponent.RawMounted[P0, S0], P0 <: js.Object, S0 <: js.Object, CT0[-p, +u] <: CtorType[p, u]]( + ref: Ref.Simple[JsComponent.RawMounted[P0, S0] with R], + arg: Ref.WithJsComponentArg[F, A, P1, S1, CT1, R, P0, S0] + ): Ref.WithJsComponent[F, A, P1, S1, CT1, R, P0, S0] = + arg.wrap(ref.map(JsComponent.mounted[P0, S0](_).addFacade[R])) + + // =================================================================================================================== + // Hook Rewriter + + // Avoid shadowing in Scala 2. + final val hookValPrefix = "__japgolly__" + + sealed trait HookRewriter[Stmt, Term <: Stmt, Type, Ref] { + val bridge : HookRewriter.Bridge[Stmt, Term, Ref] + protected val hookNo : Int + protected val initialCtx : HookRewriter.InitialCtx[Stmt, Term, Type] + protected def initialStmts: Vector[Stmt] + protected val prevHooks : List[Term] // excludes discarded hooks + val usesChildren: Boolean + + private var _stmts: Vector[Stmt] = + initialStmts + + // Don't make this an eager val. It depends on `val hookNo` + protected def hookName = + if (hookNo < 0) + hookValPrefix + "render" + else + hookValPrefix + "hook" + hookNo + + final def +=(stmt: Stmt): Unit = + _stmts :+= stmt + + final def args: List[Term] = + if (usesChildren) + props :: children :: prevHooks + else + props :: prevHooks + + final def argsOrCtxArg(paramCount: Int): List[Term] = { + val takesHookCtx = ( + ctxContainsHookResults // HookCtx only provided when previous hook results exist + && paramCount == 1 // Function argument takes a single param + ) + if (takesHookCtx) + ctxArg :: Nil + else + args + } + + @inline final def children = + initialCtx.children + + final lazy val ctxArg: Term = { + val create = bridge.hookCtx(usesChildren, args) + val ctx = valDef(create, "_ctx") + bridge.refToTerm(ctx) + } + + final def createHook(body: Term): Ref = { + assert(hookNo > 0) + valDef(body, "") + } + + final def createHook(body: Term, discard: Boolean): Option[Ref] = { + assert(hookNo > 0) + if (discard) { + this += body + None + } else + Some(createHook(body)) + } + + final def createRaw(body: Term, isLazy: Boolean = false): Ref = + valDef(body, "_raw", isLazy = isLazy) + + final def ctxContainsHookResults: Boolean = + prevHooks.nonEmpty + + @inline final def ctxType = + initialCtx.ctxType + + @inline final def isScala2 = + bridge.isScala2 + + @inline final def isScala3 = + bridge.isScala3 + + @inline final def props = + initialCtx.props + + final def stmts() = + _stmts + + final def valDef(body: Term, suffix: String, isLazy: Boolean = false): Ref = { + val x = bridge.valDef(hookName + suffix, body, isLazy) + this += x._1 + x._2 + } + } + + object HookRewriter { + + final case class InitialCtx[Stmt, Term, Type](props: Term, initChildren: Stmt, children: Term, ctxType: Type) + + final case class Bridge[Stmt, Term, Ref]( + apply : (Term, List[Term]) => Term, + hookCtx : (Boolean, List[Term]) => Term, + refToTerm: Ref => Term, + scalaVer : Int, + valDef : (String, Term, Boolean) => (Stmt, Ref), // Bool = isLazy + ) { + @inline def isScala2 = scalaVer == 2 + @inline def isScala3 = scalaVer == 3 + } + + def start[Stmt, Term <: Stmt, Type, Ref](ctx : InitialCtx[Stmt, Term, Type], + bridg : Bridge[Stmt, Term, Ref], + useChildren: Boolean): HookRewriter[Stmt, Term, Type, Ref] = + new HookRewriter[Stmt, Term, Type, Ref] { + override val bridge = bridg + override protected val hookNo = 1 + override protected val initialCtx = ctx + override protected def initialStmts = if (useChildren) Vector(ctx.initChildren) else Vector.empty + override protected val prevHooks = Nil + override val usesChildren = useChildren + } + + def next[Stmt, Term <: Stmt, Type, Ref](prev: HookRewriter[Stmt, Term, Type, Ref])(newHook: Option[Ref]): HookRewriter[Stmt, Term, Type, Ref] = + new HookRewriter[Stmt, Term, Type, Ref] { + override val bridge = prev.bridge + override protected val hookNo = prev.hookNo + 1 + override protected val initialCtx = prev.initialCtx + override protected def initialStmts = prev.stmts() + override protected val prevHooks = newHook.fold(prev.prevHooks)(prev.prevHooks :+ prev.bridge.refToTerm(_)) + override val usesChildren = prev.usesChildren + } + + def end[Stmt, Term <: Stmt, Type, Ref](prev: HookRewriter[Stmt, Term, Type, Ref]): HookRewriter[Stmt, Term, Type, Ref] = + new HookRewriter[Stmt, Term, Type, Ref] { + override val bridge = prev.bridge + override protected val hookNo = -1 + override protected val initialCtx = prev.initialCtx + override protected def initialStmts = prev.stmts() + override protected val prevHooks = prev.prevHooks + override val usesChildren = prev.usesChildren + } + } +} + +// ===================================================================================================================== + +trait AbstractHookMacros { + import AbstractHookMacros.HookRewriter + + type Expr[+A] + type Ref + type Stmt + type Term <: Stmt + type Type[A] + type TypeTree + + protected val ApplyLike: ApplyExtractor + protected abstract class ApplyExtractor { + def unapply(apply: Term): Option[(Term, List[Term])] + } + + protected val TypeApplyLike: TypeApplyExtractor + protected abstract class TypeApplyExtractor { + def unapply(typeApply: Term): Option[(Term, List[TypeTree])] + } + + protected val SelectLike: SelectExtractor + protected abstract class SelectExtractor { + def unapply(select: Term): Option[(Term, String)] + } + + protected val FunctionLike: FunctionExtractor + protected abstract class FunctionExtractor { + final type Success = Int + def unapply(function: Term): Option[Success] + } + + protected def asTerm [A]: Expr[A] => Term + protected def call : (Term, List[Term], Boolean) => Term // Bool = betaReduce (i.e. inline args) + protected def Expr [A]: Term => Expr[A] + protected def isUnit : TypeTree => Boolean + protected def refToTerm : Ref => Term + protected def showCode : Term => String + protected def showRaw : Term => String + protected def Type [A]: TypeTree => Type[A] + protected def typeOfTerm : Term => TypeTree + protected def uninline : Term => Term + protected def unitTerm : Expr[Unit] + protected def unitType : Type[Unit] + protected def wrap : (Vector[Stmt], Term) => Term + protected val rewriterBridge: RewriterBridge + + // ------------------------------------------------------------------------------------------------------------------- + // Concrete + + + final type HookDefn = AbstractHookMacros.HookDefn[Term, TypeTree] + final type HookStep = AbstractHookMacros.HookStep[Term, TypeTree] + final type Rewriter = HookRewriter[Stmt, Term, TypeTree, Ref] + final type RewriterBridge = HookRewriter.Bridge[Stmt, Term, Ref] + final type RewriterCtx = HookRewriter.InitialCtx[Stmt, Term, TypeTree] + + final implicit val log: MacroLogger = + MacroLogger() + + final def rewriterCtx(props: Term, initChildren: Stmt, children: Term, ctxType: TypeTree): RewriterCtx = + HookRewriter.InitialCtx(props, initChildren, children, ctxType) + + protected object AutoTypeImplicits { + @inline implicit def autoTerm[A](e: Expr[A]): Term = asTerm(e) + @inline implicit def autoRefToTerm(r: Ref): Term = refToTerm(r) + @inline implicit def autoRefToExpr[A](r: Ref): Expr[A] = asTerm(refToTerm(r)) + @inline implicit def autoTypeOf[A](t: TypeTree): Type[A] = Type(t) + @inline implicit def autoExprOf[A](t: Term): Expr[A] = Expr(t) + } + + private def traverseVector[A, E, B](as: Vector[A])(f: A => Either[E, B]): Either[E, Vector[B]] = { + var results = Vector.empty[B] + var i = 0 + while (i < as.length) { + f(as(i)) match { + case Right(b) => results :+= b + case Left(e) => return Left(e) + } + i += 1 + } + Right(results) + } + + // ------------------------------------------------------------------------------------------------------------------- + final def parse(tree: Term): Either[() => String, HookDefn] = { + log.hold() + val r = _parse(tree, Nil, Nil, Nil) + log.release(printPending = r.isLeft) + r + } + + private val withHooks = "withHooks" + + @tailrec + private def _parse(tree: Term, targs: List[TypeTree], args: List[List[Term]], steps: List[HookStep]): Either[() => String, HookDefn] = + uninline(tree) match { + + case ApplyLike(t, a) => + _parse(t, targs, a :: args, steps) + + case ta@ TypeApplyLike(t, a) => + if (targs.isEmpty) + _parse(t, a, args, steps) + else + Left(() => "Multiple type arg clauses found at " + showRaw(ta)) + + case SelectLike(t, name) => + if (name == withHooks) { + if (args.nonEmpty) + Left(() => s"$withHooks called with args when none exepcted: ${args.map(_.map(showCode(_)))}") + else + Right(AbstractHookMacros.HookDefn(steps.toVector)) + } else { + val step = AbstractHookMacros.HookStep(name, targs, args) + log(s"Found step '$name'", step) + _parse(t, Nil, Nil, step :: steps) + } + + case t => + Left(() => "Don't know how to parse " + showRaw(t)) + } + + // ------------------------------------------------------------------------------------------------------------------- + def rewriteComponent(h: HookDefn): Either[() => String, RewriterCtx => Expr[React.Node]] = { + if (h.steps.isEmpty) + return Left(() => "Failed to find any hook steps to parse.") + + val withPropsChildren = h.steps.head.name == "withPropsChildren" + val hookSteps = if (withPropsChildren) h.steps.init.tail else h.steps.init + val renderStep = h.steps.last + + for { + hookFns <- traverseVector(hookSteps)(rewriteStep(_)) + renderFn <- rewriteRender(renderStep) + } yield rctx => { + val r0 = HookRewriter.start(rctx, rewriterBridge, withPropsChildren) + val rH = hookFns.foldLeft(r0)((r, hf) => HookRewriter.next(r)(hf(r))) + val rR = HookRewriter.end(rH) + val vdom = renderFn(rR) + + import AutoTypeImplicits._ + wrap(rR.stmts(), vdomRawNode(vdom)) + } + } + + // ------------------------------------------------------------------------------------------------------------------- + // Rewriting util + + private def by[A](fn: Term, betaReduce: Rewriter => Boolean = null)(use: (Rewriter, Term => Term) => A) + (implicit step: HookStep): Either[() => String, Rewriter => A] = + uninline(fn) match { + case FunctionLike(paramCount) => + Right { b => + val args = b.argsOrCtxArg(paramCount) + val br = if (betaReduce eq null) true else betaReduce(b) + use(b, call(_, args, br)) + } + + case _ => + Left(() => s"Expected a function in ${step.desc}, found: ${showRaw(fn)}") + } + + private def maybeBy[A](f: Term, betaReduce: Rewriter => Boolean = null)(use: (Rewriter, Term => Term) => A) + (implicit step: HookStep): Either[() => String, Rewriter => A] = + if (step.name endsWith "By") + by(f, betaReduce = betaReduce)(use) + else + Right(use(_, identity)) + + private def reusableDeps[D](b: Rewriter, depsExpr: Expr[D], reuse: Expr[Reusability[D]], tpeD: Type[D], depsVal: Boolean = true): (Expr[D], Expr[Int]) = { + import AutoTypeImplicits._ + type DS = ReusableDepState[D] + val tpeODS = optionType(reusableDepStateType(tpeD)) + val stateRaw = b.valDef(useStateValue[Option[DS]](tpeODS, none(tpeODS)), "_state_raw") + val state = b.valDef(useStateFromJsBoxed[Option[DS]](tpeODS, stateRaw), "_state") + val newDeps = if (depsVal) autoRefToExpr[D](b.valDef(depsExpr, "_deps")) else depsExpr + val rds = b.valDef(reusableDepsLogic[D](newDeps, state, reuse, tpeD), "_deps_state") + val deps = reusableDepStateValue(rds, tpeD) + val rev = reusableDepStateRev(rds) + (deps, rev) + } + + // ------------------------------------------------------------------------------------------------------------------- + def rewriteStep(implicit step: HookStep): Either[() => String, Rewriter => Option[Ref]] = { + log("rewriteStep:" + step.name, step) + + import AutoTypeImplicits._ + type F[A] = List[A] + trait X + trait Y + trait Z + type JX = js.Object with X + type JY = js.Object with Y + type JZ = js.Object with Z + + def createUseCallbackHook[C](b: Rewriter, ucArg: Term, callback: Expr[C], hookDeps: Expr[HookDeps], tpeC: Type[C]): Ref = { + val a = refToTerm(b.valDef(ucArg, "_arg")) // stablise for dependent types + type J = js.Function + val tpeJ = useCallbackArgTypeJs[C, J](a) + val jsCallback = b.valDef(useCallbackArgToJs[C, J](a, callback, tpeC, tpeJ), "_jscb") + val raw = b.createRaw(useCallback[J](jsCallback, hookDeps, tpeJ)) + val hook = useCallbackArgFromJs[C, J](a, raw, tpeC, tpeJ) + b.createHook(hook) + } + + def reusableByDeps[D, A](b: Rewriter, depsExpr: Expr[D], reuse: Expr[Reusability[D]], tpeD: Type[D], tpeA: Type[A]) + (create: (Expr[D], Expr[Int]) => Expr[A]): Expr[Reusable[A]] = { + val (deps, rev) = reusableDeps[D](b, depsExpr, reuse, tpeD) + val value = b.valDef(create(deps, rev), "_val") + reusableValueByInt[A](rev, value, tpeA) + } + + // This is `def unsafeCreateSimple[A](): Ref.Simple[A]` in `Hooks` + def simpleRef[A](b: Rewriter, tpe: Type[A]): Expr[Ref.Simple[A]] = { + val raw = b.createRaw(useRefOrNull[A](tpe)) + refFromJs(raw, tpe) + } + + implicit def autoSomeRefs(r: Ref): Option[Ref] = + Some(r) + + def fail = + Left(() => s"Inlining of '${step.desc}' not yet supported.") + + step.name match { + + // val (List(), List(List())) = step.sig : @nowarn + + case "custom" => + val (List(i, o), List(List(h), List(_, a, _))) = step.sig : @nowarn + Right { b => + val initHook: Term = + if (isUnit(i)) + custom[Unit, X](unitType, o, h, unitTerm) + else { + val ctxArgs = b.argsOrCtxArg(1) + val List(ctxArg) = ctxArgs : @nowarn + val ctxArgType = typeOfTerm(ctxArg) + val ctx = b.valDef(customArg[X, X](ctxArgType, o, a, ctxArg), "_arg") + custom[X, X](i, o, h, ctx) + } + b.createHook(initHook, discard = isUnit(o)) + } + + case "customBy" => + val (List(o), List(List(h), List(_, _))) = step.sig : @nowarn + by(h) { (b, withCtx) => + val raw = b.createRaw(withCtx(h)) + b.createHook(custom[Unit, X](unitType, o, raw, unitTerm), discard = isUnit(o)) + } + + case "localVal" | "localValBy" => + val (List(_), List(List(valueFn), List(_))) = step.sig : @nowarn + maybeBy(valueFn) { (b, withCtx) => + b.createHook(withCtx(valueFn)) + } + + case "localLazyVal" | "localLazyValBy" => + val (List(tpe), List(List(valueFn), List(_))) = step.sig : @nowarn + // Here we avoid beta-reduction in Scala 3 because it causes a crash if props are referenced + maybeBy(valueFn, betaReduce = _.isScala2) { (b, withCtx) => + val raw = b.createRaw(withCtx(valueFn), isLazy = true) + b.createHook(scalaFn0[X](tpe, raw)) + } + + case "localVar" | "localVarBy" => + val (List(tpe), List(List(valueFn), List(_))) = step.sig : @nowarn + maybeBy(valueFn) { (b, withCtx) => + b.createHook(hooksVar[X](tpe, withCtx(valueFn))) + } + + case "unchecked" | "uncheckedBy" => + val (List(tpe), List(List(valueFn), List(_, _))) = step.sig : @nowarn + maybeBy(valueFn) { (b, withCtx) => + b.createHook(withCtx(valueFn), discard = isUnit(tpe)) + } + + case "useCallback" | "useCallbackBy" => + val (List(tpeC), List(List(callbackFn), List(ucArg, _))) = step.sig : @nowarn + maybeBy(callbackFn) { (b, withCtx) => + createUseCallbackHook[X](b, ucArg, withCtx(callbackFn), hookDepsEmptyArray, tpeC) + } + + case "useCallbackWithDeps" | "useCallbackWithDepsBy" => + val (List(tpeD, tpeC), List(List(depsFn), List(callbackFnFn), List(ucArg, reuse, _))) = step.sig : @nowarn + maybeBy(callbackFnFn) { (b, withCtx) => + val (deps, rev) = reusableDeps[X](b, withCtx(depsFn), reuse, tpeD) + val callbackFn = withCtx(callbackFnFn) + val callback = call(callbackFn, deps :: Nil, false) + val hookDeps = hookDepsIntArray1(rev) + createUseCallbackHook[X](b, ucArg, callback, hookDeps, tpeC) + } + + case "useContext" | "useContextBy" => + val (List(tpe), List(List(ctxFn), List(_))) = step.sig : @nowarn + maybeBy(ctxFn) { (b, withCtx) => + b.createHook(useContext[X](withCtx(ctxFn), tpe)) + } + + case "useDebugValue" | "useDebugValueBy" => + val (Nil, List(List(descFn), List(_))) = step.sig : @nowarn + maybeBy(descFn) { (b, withCtx) => + b.createHook(useDebugValue(withCtx(descFn)), discard = true) + } + + case "useEffect" + | "useEffectBy" + | "useEffectOnMount" + | "useEffectOnMountBy" + | "useLayoutEffect" + | "useLayoutEffectBy" + | "useLayoutEffectOnMount" + | "useLayoutEffectOnMountBy" => + val (List(tpe), List(List(effectFn), List(arg, _))) = step.sig : @nowarn + maybeBy(effectFn) { (b, withCtx) => + val hook = if (step.name.contains("Layout")) useLayoutEffect else useEffect + val hookDeps = if (step.name.contains("Mount")) hookDepsEmptyArray else hookDepsUndefined + val effect = withCtx(effectFn) + val effectJs = useEffectArgToJs[X](arg, effect, tpe) + b.createHook(hook(effectJs, hookDeps), discard = true) + None + } + + case "useEffectWithDeps" + | "useEffectWithDepsBy" + | "useLayoutEffectWithDeps" + | "useLayoutEffectWithDepsBy" => + val (List(tpeD, tpeA), List(List(depsFn), List(effectFnFn), List(arg, reuse, _))) = step.sig : @nowarn + maybeBy(effectFnFn) { (b, withCtx) => + val hook = if (step.name.contains("Layout")) useLayoutEffect else useEffect + val (deps, rev) = reusableDeps[X](b, withCtx(depsFn), reuse, tpeD) + val hookDeps = hookDepsIntArray1(rev) + val effectFn = withCtx(effectFnFn) + val effect = call(effectFn, deps :: Nil, false) + val effectJs = useEffectArgToJs[X](arg, effect, tpeA) + b.createHook(hook(effectJs, hookDeps), discard = true) + None + } + + case "useForceUpdate" => + Right { b => + val s = b.valDef(useForceUpdate1, "_state") + b.createHook(useForceUpdate2(s)) + } + + case "useMemo" | "useMemoBy" => + val (List(tpeD, tpeA), List(List(depsFn), List(createFnFn), List(reuse, _))) = step.sig : @nowarn + maybeBy(depsFn) { (b, withCtx) => + b.createHook { + reusableByDeps[X, Y](b, withCtx(depsFn), reuse, tpeD, tpeA) { (deps, rev) => + val createFn = withCtx(createFnFn) + val newValue = call(createFn, asTerm(deps) :: Nil, false) + val hookDeps = hookDepsIntArray1(rev) + useMemo[Y](newValue, hookDeps, tpeA) + } + } + } + + case "useReducer" | "useReducerBy" => + val (List(tpeS, tpeA), List(List(reducerFn, initialStateFn), List(_))) = step.sig : @nowarn + maybeBy(reducerFn) { (b, withCtx) => + val reducer = withCtx(reducerFn) + val initialState = withCtx(initialStateFn) + val raw = b.createRaw(useReducer[X, Y](reducer, initialState, tpeS, tpeA)) + b.createHook(useReducerFromJs[X, Y](raw, tpeS, tpeA)) + } + + case "useRef" | "useRefBy" => + val (List(tpe), List(List(valueFn), List(_))) = step.sig : @nowarn + maybeBy(valueFn) { (b, withCtx) => + val value = withCtx(valueFn) + val raw = b.createRaw(useRef[X](value, tpe)) + b.createHook(useRefFromJs[X](raw, tpe)) + } + + case "useRefToAnyVdom" => + Right { b => + b.createHook(simpleRef[TopNode](b, topNodeType)) + } + + case "useRefToJsComponent" => + step.sig match { + case (List(tpeP, tpeS), List(_)) => + type P = JX + type S = JY + Right { b => + val tpeM = jsComponentRawMountedType[P, S](tpeP, tpeS) + val ref = simpleRef[JsComponent.RawMounted[P, S]](b, tpeM) + b.createHook(refMapJsMounted[P, S](ref, tpeP, tpeS)) + } + + case (List(tpeF, tpeA, tpeP1, tpeS1, tpeCT1, tpeR, tpeP0, tpeS0), List(List(arg), List(_))) => + type P = JX + type S = JY + type R = js.Object with JsComponent.RawMounted[P, S] + Right { b => + val tpeM = jsComponentRawMountedTypeWithFacade[P, S, R](tpeP0, tpeS0, tpeR) + val ref = simpleRef[JsComponent.RawMounted[P, S] with R](b, tpeM) + val hook = refWithJsComponentArgHelper[F, F, P, S, CtorType, R, P, S, CtorType](ref, arg, tpeF, tpeA, tpeP1, tpeS1, tpeCT1, tpeR, tpeP0, tpeS0) + b.createHook(hook) + } + + case _ => fail + } + + case "useRefToJsComponentWithMountedFacade" => + val (List(tpeP, tpeS, tpeF), List(List(_))) = step.sig : @nowarn + type P = JX + type S = JY + type F = JZ + Right { b => + val tpeM = jsComponentRawMountedTypeWithFacade[P, S, F](tpeP, tpeS, tpeF) + val ref = simpleRef[JsComponent.RawMounted[P, S] with F](b, tpeM) + val hook = refMapJsMountedWithFacade[P, S, F](ref, tpeP, tpeS, tpeF) + b.createHook(hook) + } + + case "useRefToScalaComponent" => + def build[P, S, B](b: Rewriter, tpeP: Type[P], tpeS: Type[S], tpeB: Type[B]) = { + val tpeM = scalaComponentRawMountedType[P, S, B](tpeP, tpeS, tpeB) + val ref = simpleRef[ScalaComponent.RawMounted[P, S, B]](b, tpeM) + refMapMountedImpure(ref, tpeP, tpeS, tpeB) + } + step.sig match { + case (List(tpeP, tpeS, tpeB), List(List(_))) => + Right { b => + b.createHook(build[X, Y, Z](b, tpeP, tpeS, tpeB)) + } + + case (List(tpeP, tpeS, tpeB, tpeCT), List(List(comp), List(_))) => + Right { b => + val ref = build[X, Y, Z](b, tpeP, tpeS, tpeB) + b.createHook(refToComponentInject[X, Y, Z, CtorType](comp, ref, tpeP, tpeS, tpeB, tpeCT)) + } + + case _ => fail + } + + case "useRefToVdom" => + val (List(tpe), List(List(ct, _))) = step.sig : @nowarn + Right { b => + val sup = simpleRef[TopNode](b, topNodeType) + b.createHook(refNarrowOption[TopNode, TopNode](sup, ct, topNodeType, tpe)) + } + + case "useState" | "useStateBy" => + val (List(tpe), List(List(initialStateFn), List(_))) = step.sig : @nowarn + maybeBy(initialStateFn) { (b, withCtx) => + val raw = b.createRaw(useStateFn[X](tpe, withCtx(initialStateFn))) + b.createHook(useStateFromJsBoxed[X](tpe, raw)) + } + + case "useStateWithReuse" | "useStateWithReuseBy" => + val (List(tpe), List(List(initialStateFn), List(ct, reuse, _))) = step.sig : @nowarn + maybeBy(initialStateFn) { (b, withCtx) => + val raw = b.createRaw(useStateFn[X](tpe, withCtx(initialStateFn))) + b.createHook(useStateWithReuseFromJsBoxed[X](tpe, raw, reuse, ct)) + } + + case _ => + fail + } + } + + protected def custom[I, O]: (Type[I], Type[O], Expr[CustomHook[I, O]], Expr[I]) => Expr[O] + + protected def customArg[C, A]: (Type[C], Type[A], Expr[CustomHook.Arg[C, A]], Expr[C]) => Expr[A] + + protected def hookDepsEmptyArray: Expr[HookDeps] + + protected def hookDepsIntArray1: Expr[Int] => Expr[HookDeps] + + protected def hookDepsUndefined: Expr[HookDeps] = + unitTerm.asInstanceOf[Expr[HookDeps]] + + protected def hooksVar[A]: (Type[A], Expr[A]) => Expr[Hooks.Var[A]] + + protected def jsComponentRawMountedType[P <: js.Object, S <: js.Object]: (Type[P], Type[S]) => Type[JsComponent.RawMounted[P, S]] + + protected def jsComponentRawMountedTypeWithFacade[P <: js.Object, S <: js.Object, F]: (Type[P], Type[S], Type[F]) => Type[JsComponent.RawMounted[P, S] with F] + + protected def none[A]: Type[Option[A]] => Expr[Option[A]] + + protected def optionType[A]: Type[A] => Type[Option[A]] + + protected def refFromJs[A]: (Expr[React.RefHandle[A | Null]], Type[A]) => Expr[Ref.Simple[A]] + + protected def refMapJsMounted[P <: js.Object, S <: js.Object]: (Expr[Ref.Simple[JsComponent.RawMounted[P, S]]], Type[P], Type[S]) => Expr[Ref.ToJsComponent[P, S, JsComponent.RawMounted[P, S]]] + + protected def refMapJsMountedWithFacade[P <: js.Object, S <: js.Object, F <: js.Object]: (Expr[Ref.Simple[JsComponent.RawMounted[P, S] with F]], Type[P], Type[S], Type[F]) => Expr[Ref.ToJsComponent[P, S, JsComponent.RawMounted[P, S] with F]] + + protected def refMapMountedImpure[P, S, B]: (Expr[Ref.Simple[ScalaComponent.RawMounted[P, S, B]]], Type[P], Type[S], Type[B]) => Expr[Ref.ToScalaComponent[P, S, B]] + + protected def refWithJsComponentArgHelper[F[_], A[_], P1, S1, CT1[-p, +u] <: CtorType[p, u], R <: JsComponent.RawMounted[P0, S0], P0 <: js.Object, S0 <: js.Object, CT0[-p, +u] <: CtorType[p, u]]: + (Expr[Ref.Simple[JsComponent.RawMounted[P0, S0] with R]], Expr[Ref.WithJsComponentArg[F, A, P1, S1, CT1, R, P0, S0]], + TypeTree, TypeTree, Type[P1], Type[S1], TypeTree, Type[R], Type[P0], Type[S0] + ) => Expr[Ref.WithJsComponent[F, A, P1, S1, CT1, R, P0, S0]] + + protected def refNarrowOption[A, B <: A]: (Expr[Ref.Simple[A]], Expr[ClassTag[B]], Type[A], Type[B]) => Expr[Ref.Full[A, A, B]] + + protected def refToComponentInject[P, S, B, CT[-p, +u] <: CtorType[p, u]]: (Expr[ScalaComponent.Component[P, S, B, CT]], Expr[Ref.ToScalaComponent[P, S, B]], Type[P], Type[S], Type[B], TypeTree) => Expr[Ref.WithScalaComponent[P, S, B, CT]] + + protected def reusableDepsLogic[D]: (Expr[D], Expr[Hooks.UseState[Option[ReusableDepState[D]]]], Expr[Reusability[D]], Type[D]) => Expr[ReusableDepState[D]] + + protected def reusableDepStateRev: Expr[ReusableDepState[Any]] => Expr[Int] + + protected def reusableDepStateType[D]: Type[D] => Type[ReusableDepState[D]] + + protected def reusableDepStateValue[D]: (Expr[ReusableDepState[D]], Type[D]) => Expr[D] + + protected def reusableValueByInt[A]: (Expr[Int], Expr[A], Type[A]) => Expr[Reusable[A]] + + protected def topNodeType: Type[TopNode] + + protected def scalaComponentRawMountedType[P, S, B]: (Type[P], Type[S], Type[B]) => Type[ScalaComponent.RawMounted[P, S, B]] + + protected def scalaFn0[A]: (Type[A], Expr[A]) => Expr[() => A] + + protected def useCallback[F <: js.Function]: (Expr[F], Expr[HookDeps], Type[F]) => Expr[F] + + protected def useCallbackArgFromJs[A, J <: js.Function]: (Expr[Hooks.UseCallbackArg.To[A, J]], Expr[J], Type[A], Type[J]) => Expr[Reusable[A]] + + protected def useCallbackArgToJs[A, J <: js.Function]: (Expr[Hooks.UseCallbackArg.To[A, J]], Expr[A], Type[A], Type[J]) => Expr[J] + + protected def useCallbackArgTypeJs[A, J <: js.Function]: (Expr[Hooks.UseCallbackArg.To[A, J]]) => Type[J] + + protected def useContext[A]: (Expr[Context[A]], Type[A]) => Expr[A] + + protected def useDebugValue: Expr[Any] => Expr[Unit] + + protected def useEffect: (Expr[React.UseEffectArg], Expr[HookDeps]) => Expr[Unit] + + protected def useEffectArgToJs[A]: (Expr[Hooks.UseEffectArg[A]], Expr[A], Type[A]) => Expr[React.UseEffectArg] + + protected def useForceUpdate1: Expr[React.UseState[Int]] + + protected def useForceUpdate2: Expr[React.UseState[Int]] => Expr[Reusable[DefaultEffects.Sync[Unit]]] + + protected def useLayoutEffect: (Expr[React.UseEffectArg], Expr[HookDeps]) => Expr[Unit] + + protected def useMemo[A]: (Expr[A], Expr[HookDeps], Type[A]) => Expr[A] + + protected def useReducer[S, A]: (Expr[(S, A) => S], Expr[S], Type[S], Type[A]) => Expr[React.UseReducer[S, A]] + + protected def useReducerFromJs[S, A]: (Expr[React.UseReducer[S, A]], Type[S], Type[A]) => Expr[Hooks.UseReducer[S, A]] + + protected def useRef[A]: (Expr[A], Type[A]) => Expr[React.RefHandle[A]] + + protected def useRefOrNull[A]: Type[A] => Expr[React.RefHandle[A | Null]] + + protected def useRefFromJs[A]: (Expr[React.RefHandle[A]], Type[A]) => Expr[Hooks.UseRef[A]] + + protected def useStateFn[S]: (Type[S], Expr[S]) => Expr[React.UseState[Box[S]]] + + protected def useStateValue[S]: (Type[S], Expr[S]) => Expr[React.UseState[Box[S]]] + + protected def useStateFromJsBoxed[S]: (Type[S], Expr[React.UseState[Box[S]]]) => Expr[Hooks.UseState[S]] + + protected def useStateWithReuseFromJsBoxed[S]: (Type[S], Expr[React.UseState[Box[S]]], Expr[Reusability[S]], Expr[ClassTag[S]]) => Expr[Hooks.UseStateWithReuse[S]] + + protected def vdomRawNode: Expr[VdomNode] => Expr[React.Node] + + // ------------------------------------------------------------------------------------------------------------------- + private def rewriteRender(implicit step: HookStep): Either[() => String, Rewriter => Term] = { + log("rewriteRender:" + step.name, step) + + def withParamCount(fn: Term): Either[() => String, Int] = + uninline(fn) match { + case FunctionLike(paramCount) => Right(paramCount) + case f => Left(() => s"Expected a function in ${step.desc}, found: ${showRaw(f)}") + } + + import AutoTypeImplicits._ + + def shouldComponentUpdate[D](b: Rewriter, depsExpr: Expr[D], render: Expr[D => VdomNode], reuse: Expr[Reusability[D]], tpe: Type[D]): Expr[VdomNode] = { + val (deps, rev) = reusableDeps[D](b, depsExpr, reuse, tpe, depsVal = false) + val body = call(render, deps :: Nil, true) + shouldComponentUpdateComponent(rev, body) + } + + trait Ctx + trait D + + def fail = + Left(() => s"Inlining of '${step.desc}' not yet supported.") + + step.name.stripSuffix("Debug") match { + + case "renderRR" => + val List(List(fn), _) = step.args : @nowarn + withParamCount(fn).map { paramCount => b => + val args = b.argsOrCtxArg(paramCount) + call(fn, args, true) + } + + case "renderRRReusable" => + val (List(tpe), List(List(renderFn), implicits)) = step.sig : @nowarn + val implicitCount = implicits.size + withParamCount(renderFn).map { paramCount => b => + val mkVdom = implicits.last + val reusableA = call(renderFn, b.argsOrCtxArg(paramCount), true) + val tpeV = vdomNodeType + val tpeRV = reusableType[VdomNode](tpeV) + val reusableV = reusableMap[D, VdomNode](reusableA, mkVdom, tpe, tpeV) + val reuse = reusabilityReusable[VdomNode](tpeV) + val (deps, rev) = reusableDeps[Reusable[VdomNode]](b, reusableV, reuse, tpeRV) + val body = reusableValue[VdomNode](deps, tpeV) + shouldComponentUpdateComponent(rev, body) + } + + case "renderRRWithReuse" => + val List(List(renderFn), implicits) = step.args : @nowarn + val implicitCount = implicits.size + withParamCount(renderFn).map { paramCount => b => + val reuse = implicits.last + val ctx = if (paramCount == 1 && !b.ctxContainsHookResults) b.props else b.ctxArg + val (deps, rev) = reusableDeps[Ctx](b, ctx, reuse, b.ctxType, depsVal = false) + // log(s"paramCount = $paramCount, implicitCount = $implicitCount, usesChildren = ${b.usesChildren}, ctxContainsHookResults = ${b.ctxContainsHookResults}") + val renderArgs: List[Term] = + if (implicitCount == 3) + b.argsOrCtxArg(paramCount) + else if (b.usesChildren && paramCount == 2) + b.props :: b.children :: Nil + else if (b.ctxContainsHookResults) + deps :: Nil + else + b.props :: Nil + val body = call(renderFn, renderArgs, true) + shouldComponentUpdateComponent(rev, body) + } + + case "renderRRWithReuseBy" => + val List(tpe) = step.targs : @nowarn + val List(List(reusableInputs), List(renderFn), implicits) = step.args : @nowarn + by(reusableInputs) { (b, withCtx) => + val reuse = implicits.last + val deps: Expr[D] = + if (b.ctxContainsHookResults) + withCtx(reusableInputs) + else if (b.usesChildren) + call(reusableInputs, b.props :: b.children :: Nil, true) + else + call(reusableInputs, b.props :: Nil, true) + shouldComponentUpdate[D](b, deps, renderFn, reuse, tpe) + } + + case _ => + fail + } + } + + protected def reusabilityReusable[A]: Type[A] => Expr[Reusability[Reusable[A]]] + + protected def reusableMap[A, B]: (Expr[Reusable[A]], Expr[A => B], Type[A], Type[B]) => Expr[Reusable[B]] + + protected def reusableType[A]: Type[A] => Type[Reusable[A]] + + protected def reusableValue[A]: (Expr[Reusable[A]], Type[A]) => Expr[A] + + protected def shouldComponentUpdateComponent: (Expr[Int], Expr[VdomNode]) => Expr[VdomNode] + + protected def vdomNodeType: Type[VdomNode] +} diff --git a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/Api.scala b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/Api.scala index f905850f2..9c8827261 100644 --- a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/Api.scala +++ b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/Api.scala @@ -421,7 +421,7 @@ object Api { next(_ => UseRef.unsafeCreateToJsComponentWithMountedFacade[P, S, F]()) /** Create a mutable ref that will persist for the full lifetime of the component. */ - final def useRefToJsComponent[F[_], A[_], P1, S1, CT1[-p, +u] <: CtorType[p, u], R <: JsComponent.RawMounted[P0, S0], P0 <: js.Object, S0 <: js.Object, CT0[-p, +u] <: CtorType[p, u]] + final def useRefToJsComponent[F[_], A[_], P1, S1, CT1[-p, +u] <: CtorType[p, u], R <: JsComponent.RawMounted[P0, S0], P0 <: js.Object, S0 <: js.Object] (a: Ref.WithJsComponentArg[F, A, P1, S1, CT1, R, P0, S0])(implicit step: Step) : step.Next[Ref.WithJsComponent[F, A, P1, S1, CT1, R, P0, S0]] = next(_ => UseRef.unsafeCreateToJsComponent(a)) @@ -650,8 +650,8 @@ object Api { useReducerBy(step.squash(reducer)(_), step.squash(initialState)(_)) /** Create a mutable ref that will persist for the full lifetime of the component. */ - final def useRefBy[A](f: CtxFn[A])(implicit step: Step): step.Next[UseRef[A]] = - useRefBy(step.squash(f)(_)) + final def useRefBy[A](initialValue: CtxFn[A])(implicit step: Step): step.Next[UseRef[A]] = + useRefBy(step.squash(initialValue)(_)) /** Returns a stateful value, and a function to update it. * @@ -678,7 +678,7 @@ object Api { // =================================================================================================================== - trait PrimaryWithRender[P, C <: Children, Ctx, _Step <: AbstractStep] extends Primary[Ctx, _Step] { + trait PrimaryWithRender[P, C <: Children, Ctx, _Step <: AbstractStep] extends Primary[Ctx, _Step] with ApiPrimaryWithRenderMacros[P, C, Ctx, _Step] { def render(f: Ctx => VdomNode)(implicit s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] final def renderReusable[A](f: Ctx => Reusable[A])(implicit s: CtorType.Summoner[Box[P], C], v: A => VdomNode): Component[P, s.CT] = @@ -690,7 +690,8 @@ object Api { def renderWithReuseBy[A](reusableInputs: Ctx => A)(f: A => VdomNode)(implicit s: CtorType.Summoner[Box[P], C], r: Reusability[A]): Component[P, s.CT] } - trait SecondaryWithRender[P, C <: Children, Ctx, CtxFn[_], _Step <: SubsequentStep[Ctx, CtxFn]] extends PrimaryWithRender[P, C, Ctx, _Step] with Secondary[Ctx, CtxFn, _Step] { + trait SecondaryWithRender[P, C <: Children, Ctx, CtxFn[_], _Step <: SubsequentStep[Ctx, CtxFn]] extends PrimaryWithRender[P, C, Ctx, _Step] with Secondary[Ctx, CtxFn, _Step] with ApiSecondaryWithRenderMacros[P, C, Ctx, CtxFn, _Step] { + final def render(f: CtxFn[VdomNode])(implicit step: Step, s: CtorType.Summoner[Box[P], C]): Component[P, s.CT] = render(step.squash(f)(_)) diff --git a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/CustomHook.scala b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/CustomHook.scala index 95a033d5d..735ec5f6d 100644 --- a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/CustomHook.scala +++ b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/CustomHook.scala @@ -4,7 +4,8 @@ import japgolly.microlibs.types.NaturalComposition import japgolly.scalajs.react.internal.ShouldComponentUpdateComponent import japgolly.scalajs.react.util.DefaultEffects import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.{PropsChildren, Reusability, Reusable} +import japgolly.scalajs.react.{PropsChildren, Reusability, Reusable, facade} +import scala.scalajs.js final class CustomHook[I, O] private[CustomHook] (val unsafeInit: I => O) extends AnyVal { @@ -57,13 +58,14 @@ object CustomHook { trait ArgLowPri { implicit def id[A, B >: A]: Arg[A, B] = - Arg[A, B](a => a) + Arg[A, B](a => a) } object Arg extends ArgLowPri { def const[C, I](i: I): Arg[C, I] = apply[C, I](_ => i) + implicit def exactId [A] : Arg[A, A] = apply(a => a) implicit def unit [Ctx] : Arg[Ctx, Unit] = const(()) implicit def ctxProps[P] : Arg[HookCtx.P0[P], P] = apply((_: HookCtx.P0[P]).props) implicit def ctxPropsChildren : Arg[HookCtx.PC0[Any], PropsChildren] = apply((_: HookCtx.PC0[Any]).propsChildren) @@ -169,39 +171,39 @@ object CustomHook { // =================================================================================================================== - private final case class ReusableDepState[+A](value: A, rev: Int) { + final case class ReusableDepState[+A](value: A, rev: Int) { var skipTest = true val asTuple = (value, rev) } + def reusableDepsLogic[D](next: D) + (depsState: Hooks.UseState[Option[ReusableDepState[D]]]) + (implicit r: Reusability[D]): ReusableDepState[D] = + depsState.value match { + + // React is calling us again after the setState below + // Don't re-test reusability, we could end up in an infinite-loop (see #1027) + case Some(s) if s.skipTest => + s.skipTest = false + s + + // Previous result can be reused + case Some(prevState) if r.test(prevState.value, next) => + prevState + + // Not reusable + case o => + val nextRev = o.fold(1)(_.rev + 1) + val nextState = ReusableDepState(next, nextRev) + val updateState = depsState.setState(Some(nextState)) // this causes a hook re-eval + DefaultEffects.Sync.runSync(updateState) + nextState + } + def reusableDeps[D](implicit r: Reusability[D]): CustomHook[() => D, (D, Int)] = CustomHook[() => D] .useState[Option[ReusableDepState[D]]](None) - .buildReturning { (getDeps, depsState) => - val next = getDeps() - val nextDepState = - depsState.value match { - - // React is calling us again after the setState below - // Don't re-test reusability, we could end up in an infinite-loop (see #1027) - case Some(s) if s.skipTest => - s.skipTest = false - s - - // Previous result can be reused - case Some(prevState) if r.test(prevState.value, next) => - prevState - - // Not reusable - case o => - val nextRev = o.fold(1)(_.rev + 1) - val nextState = ReusableDepState(next, nextRev) - val updateState = depsState.setState(Some(nextState)) // this causes a hook re-eval - DefaultEffects.Sync.runSync(updateState) - nextState - } - nextDepState.asTuple - } + .buildReturning((d, s) => reusableDepsLogic(d())(s).asTuple) def reusableByDeps[D, A](create: (D, Int) => A)(implicit r: Reusability[D]): CustomHook[() => D, Reusable[A]] = reusableDeps[D].map { case (d, rev) => Reusable.implicitly(rev).withValue(create(d, rev)) } @@ -221,4 +223,9 @@ object CustomHook { }) } + def useForceUpdateRaw(s: facade.React.UseState[Int]): Reusable[DefaultEffects.Sync[Unit]] = { + @inline def inc: js.Function1[Int, Int] = _ + 1 + Reusable.implicitly(s._1).withLazyValue(DefaultEffects.Sync.delay(s._2(inc))) + } + } diff --git a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/HookComponentBuilder.scala b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/HookComponentBuilder.scala index 5b35e50d1..f962142fa 100644 --- a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/HookComponentBuilder.scala +++ b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/HookComponentBuilder.scala @@ -4,7 +4,7 @@ import japgolly.scalajs.react.component.ScalaFn import japgolly.scalajs.react.component.ScalaFn.Component import japgolly.scalajs.react.internal.Box import japgolly.scalajs.react.vdom.VdomNode -import japgolly.scalajs.react.{Children, CtorType, PropsChildren, Reusability} +import japgolly.scalajs.react.{Children, CtorType, PropsChildren, Reusable, Reusability} object HookComponentBuilder { @@ -107,7 +107,7 @@ object HookComponentBuilder { object ComponentPC { - final class First[P](init: HookCtx.PC0[P] => Unit) extends Api.PrimaryWithRender[P, Children.Varargs, HookCtx.PC0[P], FirstStep[P]] { + final class First[P](init: HookCtx.PC0[P] => Unit) extends Api.PrimaryWithRender[P, Children.Varargs, HookCtx.PC0[P], FirstStep[P]] with ComponentPCMacros[P] { type Ctx = HookCtx.PC0[P] override protected def self(f: Ctx => Any)(implicit step: Step): step.Self = @@ -119,12 +119,21 @@ object HookComponentBuilder { override def render(f: Ctx => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs]): Component[P, s.CT] = ScalaFn.withChildren((p: P, pc: PropsChildren) => f(HookCtx.withChildren(p, pc))) - def render(f: (P, PropsChildren) => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs]): Component[P, s.CT] = - ScalaFn.withChildren(f) - override def renderWithReuseBy[A](reusableInputs: Ctx => A)(f: A => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs], r: Reusability[A]): Component[P, s.CT] = customBy(ctx => CustomHook.shouldComponentUpdate(f).apply(() => reusableInputs(ctx))) .render((_: HookCtx.PC1[P, VdomNode]).hook1) + + def render(f: (P, PropsChildren) => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs]): Component[P, s.CT] = + ScalaFn.withChildren(f) + + def renderReusable[A](f: (P, PropsChildren) => Reusable[A])(implicit s: CtorType.Summoner[Box[P], Children.Varargs], v: A => VdomNode): Component[P, s.CT] = + renderReusable(($: Ctx) => f($.props, $.propsChildren)) + + def renderWithReuse(f: (P, PropsChildren) => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs], r: Reusability[Ctx]): Component[P, s.CT] = + renderWithReuse(($: Ctx) => f($.props, $.propsChildren)) + + def renderWithReuseBy[A](reusableInputs: (P, PropsChildren) => A)(f: A => VdomNode)(implicit s: CtorType.Summoner[Box[P], Children.Varargs], r: Reusability[A]): Component[P, s.CT] = + renderWithReuseBy(($: Ctx) => reusableInputs($.props, $.propsChildren))(f) } type RenderFn[-P, +Ctx] = (Ctx => VdomNode) => (P, PropsChildren) => VdomNode diff --git a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/HookCtx.scala b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/HookCtx.scala index 6b37cf974..4c9d176da 100644 --- a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/HookCtx.scala +++ b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/HookCtx.scala @@ -12,237 +12,238 @@ import japgolly.scalajs.react.{PropsChildren, Reusability} object HookCtx { - def apply[P, H1](props: P, hook1: H1): P1[P, H1] = + @inline def apply[P, H1](props: P, hook1: H1): P1[P, H1] = new P1(props, hook1) - def apply[P, H1, H2](props: P, hook1: H1, hook2: H2): P2[P, H1, H2] = + @inline def apply[P, H1, H2](props: P, hook1: H1, hook2: H2): P2[P, H1, H2] = new P2(props, hook1, hook2) - def apply[P, H1, H2, H3](props: P, hook1: H1, hook2: H2, hook3: H3): P3[P, H1, H2, H3] = + @inline def apply[P, H1, H2, H3](props: P, hook1: H1, hook2: H2, hook3: H3): P3[P, H1, H2, H3] = new P3(props, hook1, hook2, hook3) - def apply[P, H1, H2, H3, H4](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4): P4[P, H1, H2, H3, H4] = + @inline def apply[P, H1, H2, H3, H4](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4): P4[P, H1, H2, H3, H4] = new P4(props, hook1, hook2, hook3, hook4) - def apply[P, H1, H2, H3, H4, H5](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5): P5[P, H1, H2, H3, H4, H5] = + @inline def apply[P, H1, H2, H3, H4, H5](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5): P5[P, H1, H2, H3, H4, H5] = new P5(props, hook1, hook2, hook3, hook4, hook5) - def apply[P, H1, H2, H3, H4, H5, H6](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6): P6[P, H1, H2, H3, H4, H5, H6] = + @inline def apply[P, H1, H2, H3, H4, H5, H6](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6): P6[P, H1, H2, H3, H4, H5, H6] = new P6(props, hook1, hook2, hook3, hook4, hook5, hook6) - def apply[P, H1, H2, H3, H4, H5, H6, H7](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7): P7[P, H1, H2, H3, H4, H5, H6, H7] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7): P7[P, H1, H2, H3, H4, H5, H6, H7] = new P7(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8): P8[P, H1, H2, H3, H4, H5, H6, H7, H8] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8): P8[P, H1, H2, H3, H4, H5, H6, H7, H8] = new P8(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9): P9[P, H1, H2, H3, H4, H5, H6, H7, H8, H9] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9): P9[P, H1, H2, H3, H4, H5, H6, H7, H8, H9] = new P9(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10): P10[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10): P10[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10] = new P10(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11): P11[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11): P11[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11] = new P11(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12): P12[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12): P12[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12] = new P12(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13): P13[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13): P13[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13] = new P13(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14): P14[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14): P14[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14] = new P14(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15): P15[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15): P15[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15] = new P15(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16): P16[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16): P16[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16] = new P16(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17): P17[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17): P17[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17] = new P17(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18): P18[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18): P18[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18] = new P18(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19): P19[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19): P19[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19] = new P19(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20): P20[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20): P20[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20] = new P20(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20, hook21: H21): P21[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21] = + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20, hook21: H21): P21[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21] = new P21(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20, hook21) - abstract class P0[+P](final val props: P) + + @inline abstract class P0[+P](final val props: P) implicit def reusabilityP0[P](implicit P: Reusability[P]): Reusability[P0[P]] = Reusability.by(_.props) - class P1[+P, +H1](props: P, final val hook1: H1) extends P0(props) { + @inline class P1[+P, +H1](props: P, final val hook1: H1) extends P0(props) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1)" - def apply1[A](f: (P, H1) => A): A = f(props, hook1) + @inline final def apply1[A](f: (P, H1) => A): A = f(props, hook1) } implicit def reusabilityP1[P, H1](implicit P: Reusability[P], H1: Reusability[H1]): Reusability[P1[P, H1]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1)) - class P2[+P, +H1, +H2](props: P, hook1: H1, final val hook2: H2) extends P1(props, hook1) { + @inline class P2[+P, +H1, +H2](props: P, hook1: H1, final val hook2: H2) extends P1(props, hook1) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2)" - def apply2[A](f: (P, H1, H2) => A): A = f(props, hook1, hook2) + @inline final def apply2[A](f: (P, H1, H2) => A): A = f(props, hook1, hook2) } implicit def reusabilityP2[P, H1, H2](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2]): Reusability[P2[P, H1, H2]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2)) - class P3[+P, +H1, +H2, +H3](props: P, hook1: H1, hook2: H2, final val hook3: H3) extends P2(props, hook1, hook2) { + @inline class P3[+P, +H1, +H2, +H3](props: P, hook1: H1, hook2: H2, final val hook3: H3) extends P2(props, hook1, hook2) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3)" - def apply3[A](f: (P, H1, H2, H3) => A): A = f(props, hook1, hook2, hook3) + @inline final def apply3[A](f: (P, H1, H2, H3) => A): A = f(props, hook1, hook2, hook3) } implicit def reusabilityP3[P, H1, H2, H3](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3]): Reusability[P3[P, H1, H2, H3]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3)) - class P4[+P, +H1, +H2, +H3, +H4](props: P, hook1: H1, hook2: H2, hook3: H3, final val hook4: H4) extends P3(props, hook1, hook2, hook3) { + @inline class P4[+P, +H1, +H2, +H3, +H4](props: P, hook1: H1, hook2: H2, hook3: H3, final val hook4: H4) extends P3(props, hook1, hook2, hook3) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4)" - def apply4[A](f: (P, H1, H2, H3, H4) => A): A = f(props, hook1, hook2, hook3, hook4) + @inline final def apply4[A](f: (P, H1, H2, H3, H4) => A): A = f(props, hook1, hook2, hook3, hook4) } implicit def reusabilityP4[P, H1, H2, H3, H4](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4]): Reusability[P4[P, H1, H2, H3, H4]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4)) - class P5[+P, +H1, +H2, +H3, +H4, +H5](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, final val hook5: H5) extends P4(props, hook1, hook2, hook3, hook4) { + @inline class P5[+P, +H1, +H2, +H3, +H4, +H5](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, final val hook5: H5) extends P4(props, hook1, hook2, hook3, hook4) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5)" - def apply5[A](f: (P, H1, H2, H3, H4, H5) => A): A = f(props, hook1, hook2, hook3, hook4, hook5) + @inline final def apply5[A](f: (P, H1, H2, H3, H4, H5) => A): A = f(props, hook1, hook2, hook3, hook4, hook5) } implicit def reusabilityP5[P, H1, H2, H3, H4, H5](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5]): Reusability[P5[P, H1, H2, H3, H4, H5]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5)) - class P6[+P, +H1, +H2, +H3, +H4, +H5, +H6](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, final val hook6: H6) extends P5(props, hook1, hook2, hook3, hook4, hook5) { + @inline class P6[+P, +H1, +H2, +H3, +H4, +H5, +H6](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, final val hook6: H6) extends P5(props, hook1, hook2, hook3, hook4, hook5) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6)" - def apply6[A](f: (P, H1, H2, H3, H4, H5, H6) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6) + @inline final def apply6[A](f: (P, H1, H2, H3, H4, H5, H6) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6) } implicit def reusabilityP6[P, H1, H2, H3, H4, H5, H6](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6]): Reusability[P6[P, H1, H2, H3, H4, H5, H6]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6)) - class P7[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, final val hook7: H7) extends P6(props, hook1, hook2, hook3, hook4, hook5, hook6) { + @inline class P7[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, final val hook7: H7) extends P6(props, hook1, hook2, hook3, hook4, hook5, hook6) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7)" - def apply7[A](f: (P, H1, H2, H3, H4, H5, H6, H7) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7) + @inline final def apply7[A](f: (P, H1, H2, H3, H4, H5, H6, H7) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7) } implicit def reusabilityP7[P, H1, H2, H3, H4, H5, H6, H7](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7]): Reusability[P7[P, H1, H2, H3, H4, H5, H6, H7]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7)) - class P8[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, final val hook8: H8) extends P7(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7) { + @inline class P8[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, final val hook8: H8) extends P7(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8)" - def apply8[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) + @inline final def apply8[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) } implicit def reusabilityP8[P, H1, H2, H3, H4, H5, H6, H7, H8](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8]): Reusability[P8[P, H1, H2, H3, H4, H5, H6, H7, H8]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8)) - class P9[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, final val hook9: H9) extends P8(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) { + @inline class P9[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, final val hook9: H9) extends P8(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9)" - def apply9[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) + @inline final def apply9[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) } implicit def reusabilityP9[P, H1, H2, H3, H4, H5, H6, H7, H8, H9](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9]): Reusability[P9[P, H1, H2, H3, H4, H5, H6, H7, H8, H9]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9)) - class P10[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, final val hook10: H10) extends P9(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) { + @inline class P10[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, final val hook10: H10) extends P9(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10)" - def apply10[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) + @inline final def apply10[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) } implicit def reusabilityP10[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10]): Reusability[P10[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10)) - class P11[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, final val hook11: H11) extends P10(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) { + @inline class P11[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, final val hook11: H11) extends P10(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11)" - def apply11[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) + @inline final def apply11[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) } implicit def reusabilityP11[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11]): Reusability[P11[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11)) - class P12[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, final val hook12: H12) extends P11(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) { + @inline class P12[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, final val hook12: H12) extends P11(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12)" - def apply12[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) + @inline final def apply12[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) } implicit def reusabilityP12[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12]): Reusability[P12[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12)) - class P13[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, final val hook13: H13) extends P12(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) { + @inline class P13[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, final val hook13: H13) extends P12(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13)" - def apply13[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) + @inline final def apply13[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) } implicit def reusabilityP13[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13]): Reusability[P13[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13)) - class P14[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, final val hook14: H14) extends P13(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) { + @inline class P14[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, final val hook14: H14) extends P13(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14)" - def apply14[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) + @inline final def apply14[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) } implicit def reusabilityP14[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14]): Reusability[P14[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14)) - class P15[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, final val hook15: H15) extends P14(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) { + @inline class P15[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, final val hook15: H15) extends P14(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15)" - def apply15[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) + @inline final def apply15[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) } implicit def reusabilityP15[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15]): Reusability[P15[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15)) - class P16[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, final val hook16: H16) extends P15(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) { + @inline class P16[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, final val hook16: H16) extends P15(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16)" - def apply16[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) + @inline final def apply16[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) } implicit def reusabilityP16[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16]): Reusability[P16[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16)) - class P17[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, final val hook17: H17) extends P16(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) { + @inline class P17[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, final val hook17: H17) extends P16(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17)" - def apply17[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) + @inline final def apply17[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) } implicit def reusabilityP17[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17]): Reusability[P17[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16) && H17.test(x.hook17, y.hook17)) - class P18[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, final val hook18: H18) extends P17(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) { + @inline class P18[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, final val hook18: H18) extends P17(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17,\n hook18 = $hook18)" - def apply18[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) + @inline final def apply18[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) } implicit def reusabilityP18[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17], H18: Reusability[H18]): Reusability[P18[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16) && H17.test(x.hook17, y.hook17) && H18.test(x.hook18, y.hook18)) - class P19[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, final val hook19: H19) extends P18(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) { + @inline class P19[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, final val hook19: H19) extends P18(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17,\n hook18 = $hook18,\n hook19 = $hook19)" - def apply19[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) + @inline final def apply19[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) } implicit def reusabilityP19[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17], H18: Reusability[H18], H19: Reusability[H19]): Reusability[P19[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16) && H17.test(x.hook17, y.hook17) && H18.test(x.hook18, y.hook18) && H19.test(x.hook19, y.hook19)) - class P20[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19, +H20](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, final val hook20: H20) extends P19(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) { + @inline class P20[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19, +H20](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, final val hook20: H20) extends P19(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17,\n hook18 = $hook18,\n hook19 = $hook19,\n hook20 = $hook20)" - def apply20[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) + @inline final def apply20[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) } implicit def reusabilityP20[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17], H18: Reusability[H18], H19: Reusability[H19], H20: Reusability[H20]): Reusability[P20[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20]] = Reusability((x, y) => P.test(x.props, y.props) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16) && H17.test(x.hook17, y.hook17) && H18.test(x.hook18, y.hook18) && H19.test(x.hook19, y.hook19) && H20.test(x.hook20, y.hook20)) - class P21[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19, +H20, +H21](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20, final val hook21: H21) extends P20(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) { + @inline class P21[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19, +H20, +H21](props: P, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20, final val hook21: H21) extends P20(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) { override def toString = s"HookCtx(\n props = $props,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17,\n hook18 = $hook18,\n hook19 = $hook19,\n hook20 = $hook20,\n hook21 = $hook21)" - def apply21[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20, hook21) + @inline final def apply21[A](f: (P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21) => A): A = f(props, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20, hook21) } implicit def reusabilityP21[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21](implicit P: Reusability[P], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17], H18: Reusability[H18], H19: Reusability[H19], H20: Reusability[H20], H21: Reusability[H21]): Reusability[P21[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21]] = @@ -252,230 +253,231 @@ object HookCtx { object withChildren { - def apply[P](props: P, propsChildren: PropsChildren): PC0[P] = + @inline def apply[P](props: P, propsChildren: PropsChildren): PC0[P] = new PC0(props, propsChildren) - def apply[P, H1](props: P, propsChildren: PropsChildren, hook1: H1): PC1[P, H1] = - new PC1(props, propsChildren, hook1) + @inline def apply[P, H1](props: P, propsChildren: PropsChildren, hook1: H1): PC1[P, H1] = + new PC1(props, propsChildren, hook1) + + @inline def apply[P, H1, H2](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2): PC2[P, H1, H2] = + new PC2(props, propsChildren, hook1, hook2) - def apply[P, H1, H2](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2): PC2[P, H1, H2] = - new PC2(props, propsChildren, hook1, hook2) + @inline def apply[P, H1, H2, H3](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3): PC3[P, H1, H2, H3] = + new PC3(props, propsChildren, hook1, hook2, hook3) - def apply[P, H1, H2, H3](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3): PC3[P, H1, H2, H3] = - new PC3(props, propsChildren, hook1, hook2, hook3) + @inline def apply[P, H1, H2, H3, H4](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4): PC4[P, H1, H2, H3, H4] = + new PC4(props, propsChildren, hook1, hook2, hook3, hook4) - def apply[P, H1, H2, H3, H4](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4): PC4[P, H1, H2, H3, H4] = - new PC4(props, propsChildren, hook1, hook2, hook3, hook4) + @inline def apply[P, H1, H2, H3, H4, H5](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5): PC5[P, H1, H2, H3, H4, H5] = + new PC5(props, propsChildren, hook1, hook2, hook3, hook4, hook5) - def apply[P, H1, H2, H3, H4, H5](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5): PC5[P, H1, H2, H3, H4, H5] = - new PC5(props, propsChildren, hook1, hook2, hook3, hook4, hook5) + @inline def apply[P, H1, H2, H3, H4, H5, H6](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6): PC6[P, H1, H2, H3, H4, H5, H6] = + new PC6(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6) - def apply[P, H1, H2, H3, H4, H5, H6](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6): PC6[P, H1, H2, H3, H4, H5, H6] = - new PC6(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7): PC7[P, H1, H2, H3, H4, H5, H6, H7] = + new PC7(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7) - def apply[P, H1, H2, H3, H4, H5, H6, H7](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7): PC7[P, H1, H2, H3, H4, H5, H6, H7] = - new PC7(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8): PC8[P, H1, H2, H3, H4, H5, H6, H7, H8] = + new PC8(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8): PC8[P, H1, H2, H3, H4, H5, H6, H7, H8] = - new PC8(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9): PC9[P, H1, H2, H3, H4, H5, H6, H7, H8, H9] = + new PC9(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9): PC9[P, H1, H2, H3, H4, H5, H6, H7, H8, H9] = - new PC9(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10): PC10[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10] = + new PC10(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10): PC10[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10] = - new PC10(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11): PC11[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11] = + new PC11(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11): PC11[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11] = - new PC11(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12): PC12[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12] = + new PC12(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12): PC12[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12] = - new PC12(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13): PC13[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13] = + new PC13(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13): PC13[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13] = - new PC13(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14): PC14[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14] = + new PC14(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14): PC14[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14] = - new PC14(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15): PC15[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15] = + new PC15(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15): PC15[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15] = - new PC15(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16): PC16[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16] = + new PC16(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16): PC16[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16] = - new PC16(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17): PC17[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17] = + new PC17(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17): PC17[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17] = - new PC17(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18): PC18[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18] = + new PC18(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18): PC18[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18] = - new PC18(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19): PC19[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19] = + new PC19(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19): PC19[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19] = - new PC19(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) + @inline def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20): PC20[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20] = + new PC20(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) - def apply[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20): PC20[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20] = - new PC20(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) } - class PC0[+P](props: P, final val propsChildren: PropsChildren) extends P0(props) + @inline class PC0[+P](props: P, final val propsChildren: PropsChildren) extends P0(props) implicit def reusabilityPC0[P](implicit P: Reusability[P], PC: Reusability[PropsChildren]): Reusability[PC0[P]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren)) - class PC1[+P, +H1](props: P, propsChildren: PropsChildren, final val hook1: H1) extends PC0(props, propsChildren) { + @inline class PC1[+P, +H1](props: P, propsChildren: PropsChildren, final val hook1: H1) extends PC0(props, propsChildren) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1)" - def apply1[A](f: (P, PropsChildren, H1) => A): A = f(props, propsChildren, hook1) + @inline final def apply1[A](f: (P, PropsChildren, H1) => A): A = f(props, propsChildren, hook1) } implicit def reusabilityPC1[P, H1](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1]): Reusability[PC1[P, H1]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1)) - class PC2[+P, +H1, +H2](props: P, propsChildren: PropsChildren, hook1: H1, final val hook2: H2) extends PC1(props, propsChildren, hook1) { + @inline class PC2[+P, +H1, +H2](props: P, propsChildren: PropsChildren, hook1: H1, final val hook2: H2) extends PC1(props, propsChildren, hook1) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2)" - def apply2[A](f: (P, PropsChildren, H1, H2) => A): A = f(props, propsChildren, hook1, hook2) + @inline final def apply2[A](f: (P, PropsChildren, H1, H2) => A): A = f(props, propsChildren, hook1, hook2) } implicit def reusabilityPC2[P, H1, H2](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2]): Reusability[PC2[P, H1, H2]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2)) - class PC3[+P, +H1, +H2, +H3](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, final val hook3: H3) extends PC2(props, propsChildren, hook1, hook2) { + @inline class PC3[+P, +H1, +H2, +H3](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, final val hook3: H3) extends PC2(props, propsChildren, hook1, hook2) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3)" - def apply3[A](f: (P, PropsChildren, H1, H2, H3) => A): A = f(props, propsChildren, hook1, hook2, hook3) + @inline final def apply3[A](f: (P, PropsChildren, H1, H2, H3) => A): A = f(props, propsChildren, hook1, hook2, hook3) } implicit def reusabilityPC3[P, H1, H2, H3](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3]): Reusability[PC3[P, H1, H2, H3]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3)) - class PC4[+P, +H1, +H2, +H3, +H4](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, final val hook4: H4) extends PC3(props, propsChildren, hook1, hook2, hook3) { + @inline class PC4[+P, +H1, +H2, +H3, +H4](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, final val hook4: H4) extends PC3(props, propsChildren, hook1, hook2, hook3) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4)" - def apply4[A](f: (P, PropsChildren, H1, H2, H3, H4) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4) + @inline final def apply4[A](f: (P, PropsChildren, H1, H2, H3, H4) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4) } implicit def reusabilityPC4[P, H1, H2, H3, H4](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4]): Reusability[PC4[P, H1, H2, H3, H4]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4)) - class PC5[+P, +H1, +H2, +H3, +H4, +H5](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, final val hook5: H5) extends PC4(props, propsChildren, hook1, hook2, hook3, hook4) { + @inline class PC5[+P, +H1, +H2, +H3, +H4, +H5](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, final val hook5: H5) extends PC4(props, propsChildren, hook1, hook2, hook3, hook4) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5)" - def apply5[A](f: (P, PropsChildren, H1, H2, H3, H4, H5) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5) + @inline final def apply5[A](f: (P, PropsChildren, H1, H2, H3, H4, H5) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5) } implicit def reusabilityPC5[P, H1, H2, H3, H4, H5](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5]): Reusability[PC5[P, H1, H2, H3, H4, H5]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5)) - class PC6[+P, +H1, +H2, +H3, +H4, +H5, +H6](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, final val hook6: H6) extends PC5(props, propsChildren, hook1, hook2, hook3, hook4, hook5) { + @inline class PC6[+P, +H1, +H2, +H3, +H4, +H5, +H6](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, final val hook6: H6) extends PC5(props, propsChildren, hook1, hook2, hook3, hook4, hook5) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6)" - def apply6[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6) + @inline final def apply6[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6) } implicit def reusabilityPC6[P, H1, H2, H3, H4, H5, H6](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6]): Reusability[PC6[P, H1, H2, H3, H4, H5, H6]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6)) - class PC7[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, final val hook7: H7) extends PC6(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6) { + @inline class PC7[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, final val hook7: H7) extends PC6(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7)" - def apply7[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7) + @inline final def apply7[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7) } implicit def reusabilityPC7[P, H1, H2, H3, H4, H5, H6, H7](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7]): Reusability[PC7[P, H1, H2, H3, H4, H5, H6, H7]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7)) - class PC8[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, final val hook8: H8) extends PC7(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7) { + @inline class PC8[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, final val hook8: H8) extends PC7(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8)" - def apply8[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) + @inline final def apply8[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) } implicit def reusabilityPC8[P, H1, H2, H3, H4, H5, H6, H7, H8](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8]): Reusability[PC8[P, H1, H2, H3, H4, H5, H6, H7, H8]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8)) - class PC9[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, final val hook9: H9) extends PC8(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) { + @inline class PC9[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, final val hook9: H9) extends PC8(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9)" - def apply9[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) + @inline final def apply9[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) } implicit def reusabilityPC9[P, H1, H2, H3, H4, H5, H6, H7, H8, H9](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9]): Reusability[PC9[P, H1, H2, H3, H4, H5, H6, H7, H8, H9]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9)) - class PC10[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, final val hook10: H10) extends PC9(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) { + @inline class PC10[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, final val hook10: H10) extends PC9(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10)" - def apply10[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) + @inline final def apply10[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) } implicit def reusabilityPC10[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10]): Reusability[PC10[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10)) - class PC11[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, final val hook11: H11) extends PC10(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) { + @inline class PC11[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, final val hook11: H11) extends PC10(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11)" - def apply11[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) + @inline final def apply11[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) } implicit def reusabilityPC11[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11]): Reusability[PC11[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11)) - class PC12[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, final val hook12: H12) extends PC11(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) { + @inline class PC12[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, final val hook12: H12) extends PC11(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12)" - def apply12[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) + @inline final def apply12[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) } implicit def reusabilityPC12[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12]): Reusability[PC12[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12)) - class PC13[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, final val hook13: H13) extends PC12(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) { + @inline class PC13[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, final val hook13: H13) extends PC12(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13)" - def apply13[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) + @inline final def apply13[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) } implicit def reusabilityPC13[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13]): Reusability[PC13[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13)) - class PC14[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, final val hook14: H14) extends PC13(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) { + @inline class PC14[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, final val hook14: H14) extends PC13(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14)" - def apply14[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) + @inline final def apply14[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) } implicit def reusabilityPC14[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14]): Reusability[PC14[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14)) - class PC15[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, final val hook15: H15) extends PC14(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) { + @inline class PC15[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, final val hook15: H15) extends PC14(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15)" - def apply15[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) + @inline final def apply15[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) } implicit def reusabilityPC15[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15]): Reusability[PC15[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15)) - class PC16[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, final val hook16: H16) extends PC15(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) { + @inline class PC16[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, final val hook16: H16) extends PC15(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16)" - def apply16[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) + @inline final def apply16[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) } implicit def reusabilityPC16[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16]): Reusability[PC16[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16)) - class PC17[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, final val hook17: H17) extends PC16(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) { + @inline class PC17[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, final val hook17: H17) extends PC16(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17)" - def apply17[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) + @inline final def apply17[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) } implicit def reusabilityPC17[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17]): Reusability[PC17[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16) && H17.test(x.hook17, y.hook17)) - class PC18[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, final val hook18: H18) extends PC17(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) { + @inline class PC18[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, final val hook18: H18) extends PC17(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17,\n hook18 = $hook18)" - def apply18[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) + @inline final def apply18[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) } implicit def reusabilityPC18[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17], H18: Reusability[H18]): Reusability[PC18[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16) && H17.test(x.hook17, y.hook17) && H18.test(x.hook18, y.hook18)) - class PC19[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, final val hook19: H19) extends PC18(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) { + @inline class PC19[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, final val hook19: H19) extends PC18(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17,\n hook18 = $hook18,\n hook19 = $hook19)" - def apply19[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) + @inline final def apply19[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) } implicit def reusabilityPC19[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17], H18: Reusability[H18], H19: Reusability[H19]): Reusability[PC19[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19]] = Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16) && H17.test(x.hook17, y.hook17) && H18.test(x.hook18, y.hook18) && H19.test(x.hook19, y.hook19)) - class PC20[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19, +H20](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, final val hook20: H20) extends PC19(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) { + @inline class PC20[+P, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19, +H20](props: P, propsChildren: PropsChildren, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, final val hook20: H20) extends PC19(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) { override def toString = s"HookCtx.withChildren(\n props = $props,\n propsChildren = $propsChildren,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17,\n hook18 = $hook18,\n hook19 = $hook19,\n hook20 = $hook20)" - def apply20[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) + @inline final def apply20[A](f: (P, PropsChildren, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20) => A): A = f(props, propsChildren, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) } implicit def reusabilityPC20[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20](implicit P: Reusability[P], PC: Reusability[PropsChildren], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17], H18: Reusability[H18], H19: Reusability[H19], H20: Reusability[H20]): Reusability[PC20[P, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20]] = @@ -486,241 +488,242 @@ object HookCtx { object withInput { - def apply[I](input: I): I0[I] = + @inline def apply[I](input: I): I0[I] = new I0(input) - def apply[I, H1](input: I, hook1: H1): I1[I, H1] = + @inline def apply[I, H1](input: I, hook1: H1): I1[I, H1] = new I1(input, hook1) - def apply[I, H1, H2](input: I, hook1: H1, hook2: H2): I2[I, H1, H2] = + @inline def apply[I, H1, H2](input: I, hook1: H1, hook2: H2): I2[I, H1, H2] = new I2(input, hook1, hook2) - def apply[I, H1, H2, H3](input: I, hook1: H1, hook2: H2, hook3: H3): I3[I, H1, H2, H3] = + @inline def apply[I, H1, H2, H3](input: I, hook1: H1, hook2: H2, hook3: H3): I3[I, H1, H2, H3] = new I3(input, hook1, hook2, hook3) - def apply[I, H1, H2, H3, H4](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4): I4[I, H1, H2, H3, H4] = + @inline def apply[I, H1, H2, H3, H4](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4): I4[I, H1, H2, H3, H4] = new I4(input, hook1, hook2, hook3, hook4) - def apply[I, H1, H2, H3, H4, H5](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5): I5[I, H1, H2, H3, H4, H5] = + @inline def apply[I, H1, H2, H3, H4, H5](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5): I5[I, H1, H2, H3, H4, H5] = new I5(input, hook1, hook2, hook3, hook4, hook5) - def apply[I, H1, H2, H3, H4, H5, H6](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6): I6[I, H1, H2, H3, H4, H5, H6] = + @inline def apply[I, H1, H2, H3, H4, H5, H6](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6): I6[I, H1, H2, H3, H4, H5, H6] = new I6(input, hook1, hook2, hook3, hook4, hook5, hook6) - def apply[I, H1, H2, H3, H4, H5, H6, H7](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7): I7[I, H1, H2, H3, H4, H5, H6, H7] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7): I7[I, H1, H2, H3, H4, H5, H6, H7] = new I7(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8): I8[I, H1, H2, H3, H4, H5, H6, H7, H8] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8): I8[I, H1, H2, H3, H4, H5, H6, H7, H8] = new I8(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9): I9[I, H1, H2, H3, H4, H5, H6, H7, H8, H9] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9): I9[I, H1, H2, H3, H4, H5, H6, H7, H8, H9] = new I9(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10): I10[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10): I10[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10] = new I10(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11): I11[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11): I11[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11] = new I11(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12): I12[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12): I12[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12] = new I12(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13): I13[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13): I13[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13] = new I13(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14): I14[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14): I14[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14] = new I14(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15): I15[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15): I15[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15] = new I15(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16): I16[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16): I16[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16] = new I16(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17): I17[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17): I17[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17] = new I17(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18): I18[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18): I18[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18] = new I18(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19): I19[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19): I19[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19] = new I19(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20): I20[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20): I20[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20] = new I20(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) - def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20, hook21: H21): I21[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21] = + @inline def apply[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20, hook21: H21): I21[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21] = new I21(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20, hook21) + } - class I0[+I](final val input: I) + @inline class I0[+I](final val input: I) implicit def reusabilityI0[I](implicit I: Reusability[I]): Reusability[I0[I]] = Reusability.by(_.input) - class I1[+I, +H1](input: I, final val hook1: H1) extends I0(input) { + @inline class I1[+I, +H1](input: I, final val hook1: H1) extends I0(input) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1)" - def apply1[A](f: (I, H1) => A): A = f(input, hook1) + @inline final def apply1[A](f: (I, H1) => A): A = f(input, hook1) } implicit def reusabilityI1[I, H1](implicit I: Reusability[I], H1: Reusability[H1]): Reusability[I1[I, H1]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1)) - class I2[+I, +H1, +H2](input: I, hook1: H1, final val hook2: H2) extends I1(input, hook1) { + @inline class I2[+I, +H1, +H2](input: I, hook1: H1, final val hook2: H2) extends I1(input, hook1) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2)" - def apply2[A](f: (I, H1, H2) => A): A = f(input, hook1, hook2) + @inline final def apply2[A](f: (I, H1, H2) => A): A = f(input, hook1, hook2) } implicit def reusabilityI2[I, H1, H2](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2]): Reusability[I2[I, H1, H2]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2)) - class I3[+I, +H1, +H2, +H3](input: I, hook1: H1, hook2: H2, final val hook3: H3) extends I2(input, hook1, hook2) { + @inline class I3[+I, +H1, +H2, +H3](input: I, hook1: H1, hook2: H2, final val hook3: H3) extends I2(input, hook1, hook2) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3)" - def apply3[A](f: (I, H1, H2, H3) => A): A = f(input, hook1, hook2, hook3) + @inline final def apply3[A](f: (I, H1, H2, H3) => A): A = f(input, hook1, hook2, hook3) } implicit def reusabilityI3[I, H1, H2, H3](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3]): Reusability[I3[I, H1, H2, H3]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3)) - class I4[+I, +H1, +H2, +H3, +H4](input: I, hook1: H1, hook2: H2, hook3: H3, final val hook4: H4) extends I3(input, hook1, hook2, hook3) { + @inline class I4[+I, +H1, +H2, +H3, +H4](input: I, hook1: H1, hook2: H2, hook3: H3, final val hook4: H4) extends I3(input, hook1, hook2, hook3) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4)" - def apply4[A](f: (I, H1, H2, H3, H4) => A): A = f(input, hook1, hook2, hook3, hook4) + @inline final def apply4[A](f: (I, H1, H2, H3, H4) => A): A = f(input, hook1, hook2, hook3, hook4) } implicit def reusabilityI4[I, H1, H2, H3, H4](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4]): Reusability[I4[I, H1, H2, H3, H4]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4)) - class I5[+I, +H1, +H2, +H3, +H4, +H5](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, final val hook5: H5) extends I4(input, hook1, hook2, hook3, hook4) { + @inline class I5[+I, +H1, +H2, +H3, +H4, +H5](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, final val hook5: H5) extends I4(input, hook1, hook2, hook3, hook4) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5)" - def apply5[A](f: (I, H1, H2, H3, H4, H5) => A): A = f(input, hook1, hook2, hook3, hook4, hook5) + @inline final def apply5[A](f: (I, H1, H2, H3, H4, H5) => A): A = f(input, hook1, hook2, hook3, hook4, hook5) } implicit def reusabilityI5[I, H1, H2, H3, H4, H5](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5]): Reusability[I5[I, H1, H2, H3, H4, H5]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5)) - class I6[+I, +H1, +H2, +H3, +H4, +H5, +H6](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, final val hook6: H6) extends I5(input, hook1, hook2, hook3, hook4, hook5) { + @inline class I6[+I, +H1, +H2, +H3, +H4, +H5, +H6](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, final val hook6: H6) extends I5(input, hook1, hook2, hook3, hook4, hook5) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6)" - def apply6[A](f: (I, H1, H2, H3, H4, H5, H6) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6) + @inline final def apply6[A](f: (I, H1, H2, H3, H4, H5, H6) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6) } implicit def reusabilityI6[I, H1, H2, H3, H4, H5, H6](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6]): Reusability[I6[I, H1, H2, H3, H4, H5, H6]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6)) - class I7[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, final val hook7: H7) extends I6(input, hook1, hook2, hook3, hook4, hook5, hook6) { + @inline class I7[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, final val hook7: H7) extends I6(input, hook1, hook2, hook3, hook4, hook5, hook6) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7)" - def apply7[A](f: (I, H1, H2, H3, H4, H5, H6, H7) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7) + @inline final def apply7[A](f: (I, H1, H2, H3, H4, H5, H6, H7) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7) } implicit def reusabilityI7[I, H1, H2, H3, H4, H5, H6, H7](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7]): Reusability[I7[I, H1, H2, H3, H4, H5, H6, H7]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7)) - class I8[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, final val hook8: H8) extends I7(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7) { + @inline class I8[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, final val hook8: H8) extends I7(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8)" - def apply8[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) + @inline final def apply8[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) } implicit def reusabilityI8[I, H1, H2, H3, H4, H5, H6, H7, H8](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8]): Reusability[I8[I, H1, H2, H3, H4, H5, H6, H7, H8]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8)) - class I9[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, final val hook9: H9) extends I8(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) { + @inline class I9[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, final val hook9: H9) extends I8(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9)" - def apply9[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) + @inline final def apply9[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) } implicit def reusabilityI9[I, H1, H2, H3, H4, H5, H6, H7, H8, H9](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9]): Reusability[I9[I, H1, H2, H3, H4, H5, H6, H7, H8, H9]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9)) - class I10[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, final val hook10: H10) extends I9(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) { + @inline class I10[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, final val hook10: H10) extends I9(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10)" - def apply10[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) + @inline final def apply10[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) } implicit def reusabilityI10[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10]): Reusability[I10[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10)) - class I11[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, final val hook11: H11) extends I10(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) { + @inline class I11[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, final val hook11: H11) extends I10(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11)" - def apply11[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) + @inline final def apply11[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) } implicit def reusabilityI11[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11]): Reusability[I11[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11)) - class I12[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, final val hook12: H12) extends I11(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) { + @inline class I12[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, final val hook12: H12) extends I11(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12)" - def apply12[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) + @inline final def apply12[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) } implicit def reusabilityI12[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12]): Reusability[I12[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12)) - class I13[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, final val hook13: H13) extends I12(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) { + @inline class I13[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, final val hook13: H13) extends I12(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13)" - def apply13[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) + @inline final def apply13[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) } implicit def reusabilityI13[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13]): Reusability[I13[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13)) - class I14[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, final val hook14: H14) extends I13(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) { + @inline class I14[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, final val hook14: H14) extends I13(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14)" - def apply14[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) + @inline final def apply14[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) } implicit def reusabilityI14[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14]): Reusability[I14[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14)) - class I15[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, final val hook15: H15) extends I14(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) { + @inline class I15[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, final val hook15: H15) extends I14(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15)" - def apply15[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) + @inline final def apply15[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) } implicit def reusabilityI15[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15]): Reusability[I15[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15)) - class I16[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, final val hook16: H16) extends I15(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) { + @inline class I16[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, final val hook16: H16) extends I15(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16)" - def apply16[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) + @inline final def apply16[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) } implicit def reusabilityI16[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16]): Reusability[I16[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16)) - class I17[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, final val hook17: H17) extends I16(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) { + @inline class I17[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, final val hook17: H17) extends I16(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17)" - def apply17[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) + @inline final def apply17[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) } implicit def reusabilityI17[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17]): Reusability[I17[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16) && H17.test(x.hook17, y.hook17)) - class I18[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, final val hook18: H18) extends I17(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) { + @inline class I18[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, final val hook18: H18) extends I17(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17,\n hook18 = $hook18)" - def apply18[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) + @inline final def apply18[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) } implicit def reusabilityI18[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17], H18: Reusability[H18]): Reusability[I18[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16) && H17.test(x.hook17, y.hook17) && H18.test(x.hook18, y.hook18)) - class I19[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, final val hook19: H19) extends I18(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) { + @inline class I19[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, final val hook19: H19) extends I18(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17,\n hook18 = $hook18,\n hook19 = $hook19)" - def apply19[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) + @inline final def apply19[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) } implicit def reusabilityI19[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17], H18: Reusability[H18], H19: Reusability[H19]): Reusability[I19[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16) && H17.test(x.hook17, y.hook17) && H18.test(x.hook18, y.hook18) && H19.test(x.hook19, y.hook19)) - class I20[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19, +H20](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, final val hook20: H20) extends I19(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) { + @inline class I20[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19, +H20](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, final val hook20: H20) extends I19(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17,\n hook18 = $hook18,\n hook19 = $hook19,\n hook20 = $hook20)" - def apply20[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) + @inline final def apply20[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) } implicit def reusabilityI20[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17], H18: Reusability[H18], H19: Reusability[H19], H20: Reusability[H20]): Reusability[I20[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20]] = Reusability((x, y) => I.test(x.input, y.input) && H1.test(x.hook1, y.hook1) && H2.test(x.hook2, y.hook2) && H3.test(x.hook3, y.hook3) && H4.test(x.hook4, y.hook4) && H5.test(x.hook5, y.hook5) && H6.test(x.hook6, y.hook6) && H7.test(x.hook7, y.hook7) && H8.test(x.hook8, y.hook8) && H9.test(x.hook9, y.hook9) && H10.test(x.hook10, y.hook10) && H11.test(x.hook11, y.hook11) && H12.test(x.hook12, y.hook12) && H13.test(x.hook13, y.hook13) && H14.test(x.hook14, y.hook14) && H15.test(x.hook15, y.hook15) && H16.test(x.hook16, y.hook16) && H17.test(x.hook17, y.hook17) && H18.test(x.hook18, y.hook18) && H19.test(x.hook19, y.hook19) && H20.test(x.hook20, y.hook20)) - class I21[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19, +H20, +H21](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20, final val hook21: H21) extends I20(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) { + @inline class I21[+I, +H1, +H2, +H3, +H4, +H5, +H6, +H7, +H8, +H9, +H10, +H11, +H12, +H13, +H14, +H15, +H16, +H17, +H18, +H19, +H20, +H21](input: I, hook1: H1, hook2: H2, hook3: H3, hook4: H4, hook5: H5, hook6: H6, hook7: H7, hook8: H8, hook9: H9, hook10: H10, hook11: H11, hook12: H12, hook13: H13, hook14: H14, hook15: H15, hook16: H16, hook17: H17, hook18: H18, hook19: H19, hook20: H20, final val hook21: H21) extends I20(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20) { override def toString = s"HookCtx.withInput(\n input = $input,\n hook1 = $hook1,\n hook2 = $hook2,\n hook3 = $hook3,\n hook4 = $hook4,\n hook5 = $hook5,\n hook6 = $hook6,\n hook7 = $hook7,\n hook8 = $hook8,\n hook9 = $hook9,\n hook10 = $hook10,\n hook11 = $hook11,\n hook12 = $hook12,\n hook13 = $hook13,\n hook14 = $hook14,\n hook15 = $hook15,\n hook16 = $hook16,\n hook17 = $hook17,\n hook18 = $hook18,\n hook19 = $hook19,\n hook20 = $hook20,\n hook21 = $hook21)" - def apply21[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20, hook21) + @inline final def apply21[A](f: (I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21) => A): A = f(input, hook1, hook2, hook3, hook4, hook5, hook6, hook7, hook8, hook9, hook10, hook11, hook12, hook13, hook14, hook15, hook16, hook17, hook18, hook19, hook20, hook21) } implicit def reusabilityI21[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21](implicit I: Reusability[I], H1: Reusability[H1], H2: Reusability[H2], H3: Reusability[H3], H4: Reusability[H4], H5: Reusability[H5], H6: Reusability[H6], H7: Reusability[H7], H8: Reusability[H8], H9: Reusability[H9], H10: Reusability[H10], H11: Reusability[H11], H12: Reusability[H12], H13: Reusability[H13], H14: Reusability[H14], H15: Reusability[H15], H16: Reusability[H16], H17: Reusability[H17], H18: Reusability[H18], H19: Reusability[H19], H20: Reusability[H20], H21: Reusability[H21]): Reusability[I21[I, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21]] = diff --git a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/Hooks.scala b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/Hooks.scala index 16a7abd48..48fea15d4 100644 --- a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/Hooks.scala +++ b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/hooks/Hooks.scala @@ -15,16 +15,18 @@ import scala.scalajs.js.| object Hooks { - trait UseCallbackArg[S] { + trait UseCallbackArg[A] { type J <: js.Function - def toJs: S => J - def fromJs: J => Reusable[S] + def toJs: A => J + def fromJs: J => Reusable[A] } object UseCallbackArg extends UseCallbackArgInstances { - def apply[S, F <: js.Function](f: S => F)(g: F => Reusable[S]): UseCallbackArg[S] = - new UseCallbackArg[S] { + type To[A, F <: js.Function] = UseCallbackArg[A] { type J = F } + + def apply[A, F <: js.Function](f: A => F)(g: F => Reusable[A]): UseCallbackArg[A] = + new UseCallbackArg[A] { override type J = F override def toJs = f override def fromJs = g @@ -129,9 +131,9 @@ object Hooks { unsafeCreate[Null, S, A](reducer, null, _ => initialState) def unsafeCreate[I, S, A](reducer: (S, A) => S, initialArg: I, init: I => S): UseReducer[S, A] = - _unsafeCreate(facade.React.useReducer[I, S, A](reducer, initialArg, init)) + fromJs(facade.React.useReducer[I, S, A](reducer, initialArg, init)) - private def _unsafeCreate[S, A](originalResult: facade.React.UseReducer[S, A]): UseReducer[S, A] = { + def fromJs[S, A](originalResult: facade.React.UseReducer[S, A]): UseReducer[S, A] = { val originalDispatch = Reusable.byRef(originalResult._2) UseReducer(originalResult, originalDispatch) } @@ -206,8 +208,11 @@ object Hooks { type UseRef[A] = UseRefF[D.Sync, A] object UseRef { + def fromJs[A](ref: facade.React.RefHandle[A]): UseRef[A] = + new UseRefF(ref)(D.Sync) + def unsafeCreate[A](initialValue: A): UseRef[A] = - new UseRefF(facade.React.useRef(initialValue))(D.Sync) + fromJs(facade.React.useRef(initialValue)) def unsafeCreateSimple[A](): Ref.Simple[A] = Ref.fromJs(facade.React.useRef[A | Null](null)) @@ -247,13 +252,19 @@ object Hooks { @inline def apply[S, O](r: facade.React.UseState[S], oss: Reusable[facade.React.UseStateSetter[O]]): UseState[S] = UseStateF(r, oss)(D.Sync) - def unsafeCreate[S](initialState: => S): UseState[S] = { + def unsafeCreateJsBoxed[S](initialState: => S): facade.React.UseState[Box[S]] = { // Boxing is required because React's useState uses reflection to distinguish between {set,mod}State. - val initialStateFn = (() => Box(initialState)): js.Function0[Box[S]] - val originalResult = facade.React.useState[Box[S]](initialStateFn) - val originalSetState = Reusable.byRef(originalResult._2) - UseState(originalResult, originalSetState) - .xmap(_.unbox)(Box.apply) + facade.React.useStateFn[Box[S]]( + (() => Box(initialState)): js.Function0[Box[S]] + ) + } + + def unsafeCreate[S](initialState: => S): UseState[S] = + fromJsBoxed(unsafeCreateJsBoxed(initialState)) + + def fromJsBoxed[S](r: facade.React.UseState[Box[S]]): UseState[S] = { + val originalSetState = Reusable.byRef(r._2) + UseState(r, originalSetState).xmap(_.unbox)(Box.apply) } } @@ -370,6 +381,12 @@ object Hooks { val us = UseState.unsafeCreate(initialState).withReusability UseStateWithReuseF(us, rr) } + + def fromJsBoxed[S](raw: facade.React.UseState[Box[S]])(implicit r: Reusability[S], ct: ClassTag[S]): UseStateWithReuse[S] = { + val rr = Reusable.reusabilityInstance(r) + val us = UseState.fromJsBoxed(raw).withReusability + UseStateWithReuseF(us, rr) + } } type UseStateWithReuse[S] = UseStateWithReuseF[D.Sync, S] diff --git a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/internal/Box.scala b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/internal/Box.scala index 7eb205eb9..fc7ab71bc 100644 --- a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/internal/Box.scala +++ b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/internal/Box.scala @@ -9,7 +9,7 @@ trait Box[+A] extends js.Object { } object Box { - @inline def apply[A](value: A): Box[A] = + def apply[A](value: A): Box[A] = js.Dynamic.literal(a = value.asInstanceOf[js.Any]).asInstanceOf[Box[A]] val Unit: Box[Unit] = diff --git a/library/coreGeneric/src/main/scala/japgolly/scalajs/react/internal/MacroLogger.scala b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/internal/MacroLogger.scala new file mode 100644 index 000000000..634b655c5 --- /dev/null +++ b/library/coreGeneric/src/main/scala/japgolly/scalajs/react/internal/MacroLogger.scala @@ -0,0 +1,113 @@ +package japgolly.scalajs.react.internal + +import sourcecode.Line + +// TODO: Move into microlibs +object MacroLogger { + + def apply(): MacroLogger = + new MacroLogger + + def apply(enabled: Boolean): MacroLogger = { + val l = new MacroLogger + l.enabled = enabled + l + } +} + +class MacroLogger { + import Console._ + + private var enabledStack = List.empty[Boolean] + + var enabled = false + + def pushDisabled(): Unit = + pushEnabled(false) + + def pushEnabled(e: Boolean = true): Unit = { + enabledStack ::= enabled + enabled = e + } + + def pop(): Unit = + if (enabledStack.nonEmpty) { + enabled = enabledStack.head + enabledStack = enabledStack.tail + } + + private var _hold = false + private var _pending = Vector.empty[() => String] + + def hold(): Unit = { + release() + _hold = true + } + + def release(printPending: Boolean = true): Unit = { + val pending = _pending + _pending = Vector.empty + _hold = false + if (printPending && enabled) + for (p <- pending) + _println(p()) + } + + def apply(): Unit = + if (enabled) + System.out.println() + + def apply(a: => Any)(implicit l: Line): Unit = + if (enabled) { + val text = "" + a + // for (line <- text.linesIterator) { + // System.out.printf("%s[%3d]%s %s\n", CYAN, l.value, RESET, line) + // } + val msg = "%s[%3d]%s %s".format(CYAN, l.value, RESET, text.replace("\n", "\n ")) + _println(msg) + } + + private def _println(a: => Any): Unit = + if (enabled) { + val msg = () => a match { + case s: String => s + case _ => "" + a + } + if (_hold) + _pending :+= msg + else + System.out.println(msg()) + } + + private def width = 200 + private def sep = "=" * width + + def header(): Unit = + _println(sep + "\n") + + def footer(): Unit = + _println("\n" + sep) + + def footer(result: => Any): Unit = { + apply("Result", result) + footer() + } + + def apply(name: => Any, value: => Any)(implicit l: Line): Unit = + apply(s"$YELLOW$name:$RESET $value") + + def all(name: => Any, values: => Iterable[Any])(implicit l: Line): Unit = + if (enabled) { + val vs = values + if (vs.isEmpty) + apply(s"$name [0/0]") + else { + val total = vs.size + var i = 0 + for (v <- vs) { + i += 1 + apply(s"$name [$i/$total]", v) + } + } + } +} diff --git a/library/facadeMain/src/main/scala/japgolly/scalajs/react/facade/Hooks.scala b/library/facadeMain/src/main/scala/japgolly/scalajs/react/facade/Hooks.scala index d892d3eb1..68811780b 100644 --- a/library/facadeMain/src/main/scala/japgolly/scalajs/react/facade/Hooks.scala +++ b/library/facadeMain/src/main/scala/japgolly/scalajs/react/facade/Hooks.scala @@ -2,6 +2,7 @@ package japgolly.scalajs.react.facade import scala.annotation.nowarn import scala.scalajs.js +import scala.scalajs.js.annotation._ import scala.scalajs.js.| /** See https://reactjs.org/docs/hooks-reference.html @@ -19,12 +20,20 @@ trait Hooks extends js.Object { final def useState[S](initial: S | js.Function0[S]): UseState[S] = js.native + /** Using this directly avoid Scala.js adding boilerplate for `|` */ + @JSName("useState") + final def useStateFn[S](initial: js.Function0[S]): UseState[S] = js.native + + /** Using this directly avoid Scala.js adding boilerplate for `|` */ + @JSName("useState") + final def useStateValue[S](initial: S): UseState[S] = js.native + final type UseEffectArg = js.Function0[js.UndefOr[js.Function0[Any]]] final def useEffect(effect: UseEffectArg, - deps : js.UndefOr[HookDeps] = js.native): Unit = js.native + deps : HookDeps = js.native): Unit = js.native final def useLayoutEffect(effect: js.Function0[js.UndefOr[js.Function0[Any]]], - deps : js.UndefOr[HookDeps] = js.native): Unit = js.native + deps : HookDeps = js.native): Unit = js.native final def useContext[A](ctx: React.Context[A]): A = js.native @@ -33,16 +42,16 @@ trait Hooks extends js.Object { final def useReducer[ S, A](reducer: js.Function2[S, A, S], initialState: S ): UseReducer[S, A] = js.native final def useReducer[I, S, A](reducer: js.Function2[S, A, S], initialArg: I, init: js.Function1[I, S]): UseReducer[S, A] = js.native - final def useCallback[F <: js.Function](callback: F, deps: js.UndefOr[HookDeps] = js.native): F = js.native + final def useCallback[F <: js.Function](callback: F, deps: HookDeps = js.native): F = js.native - final def useMemo[A](f: js.Function0[A], deps: js.UndefOr[HookDeps] = js.native): A = js.native + final def useMemo[A](f: js.Function0[A], deps: HookDeps = js.native): A = js.native final def useRef[A](f: A): React.RefHandle[A] = js.native final def useImperativeHandle[A]( ref : React.RefHandle[A | Null] | ((A | Null) => Any) | Null | Unit, create: js.Function0[A], - deps : js.UndefOr[HookDeps] = js.native): Unit = js.native + deps : HookDeps = js.native): Unit = js.native final def useDebugValue(desc: Any): Unit = js.native final def useDebugValue[A](value: A, desc: A => Any): Unit = js.native diff --git a/library/mktmp b/library/mktmp new file mode 100755 index 000000000..d20f840e9 --- /dev/null +++ b/library/mktmp @@ -0,0 +1,65 @@ +#!/bin/bash + +# TODO: REMEMBER TO DELETE THIS +# TODO: REMEMBER TO DELETE THIS +# TODO: REMEMBER TO DELETE THIS +# TODO: REMEMBER TO DELETE THIS +# TODO: REMEMBER TO DELETE THIS + +cd "$(dirname "$0")" + +function create { + m=$1 + t="$2" + + d=$m/src/test/scala + mkdir -p $d + f=$d/TEMP.scala + [ -e $f ] || (echo "$t" > $f) + ls -l $f +} + +# ====================================================================================================================== + +create coreGeneric 'import japgolly.scalajs.react._ +import japgolly.scalajs.react.component.{ScalaFn => ScalaFnComponent} +import japgolly.scalajs.react.vdom.html_<^._ + +object TEMP { + + final case class PI(pi: Int) { + def unary_- : PI = PI(-pi) + def *(n: Int): PI = PI(pi * n) + def +(n: Int): PI = PI(pi + n) + def +(n: PI): PI = PI(pi + n.pi) + } + +} +' + +# ====================================================================================================================== + +create coreBundleCallback 'import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +object TEMP { + + final class Counter { + var value = 0 + def inc(by: Int = 1): Int = { + value += by + value + } + def incCB : Callback = incCB(1) + def incCB(by: Int): Callback = Callback{ inc(by); () } + } + + final case class PI(pi: Int) { + def unary_- : PI = PI(-pi) + def *(n: Int): PI = PI(pi * n) + def +(n: Int): PI = PI(pi + n) + def +(n: PI): PI = PI(pi + n.pi) + } + +} +' diff --git a/library/project/Build.scala b/library/project/Build.scala index 2647b2121..25d9d373f 100644 --- a/library/project/Build.scala +++ b/library/project/Build.scala @@ -1,6 +1,7 @@ import sbt._ import sbt.Keys._ import org.scalajs.jsdependencies.sbtplugin.JSDependenciesPlugin.autoImport._ +import org.scalajs.linker.interface.{CheckedBehavior, ModuleInitializer, ModuleSplitStyle} import org.scalajs.sbtplugin.ScalaJSPlugin import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._ import scalafix.sbt.BuildInfo.{scalafixVersion => ScalafixVer} @@ -35,20 +36,25 @@ object ScalaJsReact { ghpages, ghpagesMacros, scalafixRules, + testEmissions, + testEmissionsJS, tests, - testUtilMacros, testUtil, + testUtilMacros, util, utilCatsEffect, utilDummyDefaults, utilFallbacks, ) - def commonSettings: PE = - _.enablePlugins(ScalaJSPlugin, ScalafixPlugin) + def commonSettingsCross: PE = + _.enablePlugins(ScalafixPlugin) .dependsOn(scalafixRules % ScalafixConfig) .configure(commonSettingsWithoutPlugins) + def commonSettings: PE = + _.enablePlugins(ScalaJSPlugin).configure(commonSettingsCross) + def shimDummyDefaults: PE = _.dependsOn(utilDummyDefaults % Provided) @@ -209,6 +215,51 @@ object ScalaJsReact { ) .configure(conditionallyDisable) // keep this last + lazy val testEmissions = project + .in(file("testEmissions/jvm")) + .configure(commonSettingsCross, preventPublication, utestSettingsCross) + .settings( + libraryDependencies += Dep.microlibsUtils.value, + Test / fork := true, + Test / javaOptions ++= { + val jsOutputDir = (testEmissionsJS / Compile / fastLinkJS / scalaJSLinkerOutputDirectory).value + val scalaVer = scalaVersion.value + val tempDir = (Test / classDirectory).value + val testResDir = (Test / resourceDirectory).value + val testRootDir = (Test / sourceDirectory).value + Seq( + s"-DCI=${if (inCI) "1" else "0"}", + s"-DjsOutputDir=${jsOutputDir.absolutePath}", + s"-DscalaVer=$scalaVer", + s"-DtempDir=${tempDir.absolutePath}", + s"-DtestResDir=${testResDir.absolutePath}", + s"-DtestRootDir=${testRootDir.absolutePath}", + ) + }, + Test / test := (Test / test ).dependsOn(testEmissionsJS / Compile / fastLinkJS).value, + Test / testOnly := (Test / testOnly).dependsOn(testEmissionsJS / Compile / fastLinkJS).evaluated, + ) + + lazy val testEmissionsJS = project + .in(file("testEmissions/js")) + .configure(commonSettings, preventPublication, hasNoTests) + .dependsOn(coreBundleCallback) + .settings( + Compile / scalaJSLinkerConfig ~= { _ + .withModuleKind(ModuleKind.ESModule) + .withModuleSplitStyle(ModuleSplitStyle.SmallestModules) + .withSourceMap(false) + // .withESFeatures(_.withESVersion(ESVersion.ES2021)) + .withSemantics(_ + .withArrayIndexOutOfBounds(CheckedBehavior.Unchecked) + .withAsInstanceOfs(CheckedBehavior.Unchecked) + .withProductionMode(true) + ) + }, + Compile / scalaJSModuleInitializers += + ModuleInitializer.mainMethod("japgolly.scalajs.react.test.emissions.Main", "main") + ) + lazy val tests = project .dependsOn(testUtil, coreExtCatsEffect, extraExtMonocle3) .dependsOn(coreBundleCallback) // Low priority diff --git a/library/project/Dependencies.scala b/library/project/Dependencies.scala index 46ab36677..3587834ae 100644 --- a/library/project/Dependencies.scala +++ b/library/project/Dependencies.scala @@ -47,6 +47,7 @@ object Dependencies { val microlibsCompileTime = Def.setting("com.github.japgolly.microlibs" %%% "compile-time" % Ver.microlibs) val microlibsTestUtil = Def.setting("com.github.japgolly.microlibs" %%% "test-util" % Ver.microlibs) val microlibsTypes = Def.setting("com.github.japgolly.microlibs" %%% "types" % Ver.microlibs) + val microlibsUtils = Def.setting("com.github.japgolly.microlibs" %%% "utils" % Ver.microlibs) val monocle2 = Def.setting("com.github.julien-truffaut" %%% "monocle-core" % Ver.monocle2 cross CrossVersion.for3Use2_13 excludeAll(ExclusionRule(organization = "org.typelevel"))) val monocle3 = Def.setting("dev.optics" %%% "monocle-core" % Ver.monocle3) val nyayaGen = Def.setting("com.github.japgolly.nyaya" %%% "nyaya-gen" % Ver.nyaya) diff --git a/library/project/GenHooks.scala b/library/project/GenHooks.scala index c9194789d..7579d2142 100644 --- a/library/project/GenHooks.scala +++ b/library/project/GenHooks.scala @@ -60,14 +60,20 @@ object GenHooks { |""".stripMargin if (n <= 21) { - hookCtxCtorsI += s" def apply[I, $Hns](input: I, $hookParams): I$n[I, $Hns] =\n new I$n(input, $hookArgs)" + hookCtxCtorsI += + s""" @inline def apply[I, $Hns](input: I, $hookParams): I$n[I, $Hns] = + | new I$n(input, $hookArgs) + |""".stripMargin - hookCtxCtorsP += s" def apply[P, $Hns](props: P, $hookParams): P$n[P, $Hns] =\n new P$n(props, $hookArgs)" + hookCtxCtorsP += + s""" @inline def apply[P, $Hns](props: P, $hookParams): P$n[P, $Hns] = + | new P$n(props, $hookArgs) + |""".stripMargin hookCtxsI += - s""" class I$n[+I, $coHns](input: I, $ctxParams) extends I${n-1}(input$ctxSuperArgs) { + s""" @inline class I$n[+I, $coHns](input: I, $ctxParams) extends I${n-1}(input$ctxSuperArgs) { | override def toString = s"HookCtx.withInput(\\n input = !input$ctxToStr)" - | def apply$n[A](f: (I, $Hns) => A): A = f(input, $hookArgs) + | @inline final def apply$n[A](f: (I, $Hns) => A): A = f(input, $hookArgs) | } | | implicit def reusabilityI$n[I, $Hns](implicit I: Reusability[I], $RHns): Reusability[I$n[I, $Hns]] = @@ -75,9 +81,9 @@ object GenHooks { |""".stripMargin.replace('!', '$') hookCtxsP += - s""" class P$n[+P, $coHns](props: P, $ctxParams) extends P${n-1}(props$ctxSuperArgs) { + s""" @inline class P$n[+P, $coHns](props: P, $ctxParams) extends P${n-1}(props$ctxSuperArgs) { | override def toString = s"HookCtx(\\n props = !props$ctxToStr)" - | def apply$n[A](f: (P, $Hns) => A): A = f(props, $hookArgs) + | @inline final def apply$n[A](f: (P, $Hns) => A): A = f(props, $hookArgs) | } | | implicit def reusabilityP$n[P, $Hns](implicit P: Reusability[P], $RHns): Reusability[P$n[P, $Hns]] = @@ -85,12 +91,15 @@ object GenHooks { |""".stripMargin.replace('!', '$') if (n <= 20) { - hookCtxCtorsPC += s" def apply[P, $Hns](props: P, propsChildren: PropsChildren, $hookParams): PC$n[P, $Hns] =\n new PC$n(props, propsChildren, $hookArgs)" + hookCtxCtorsPC += + s""" @inline def apply[P, $Hns](props: P, propsChildren: PropsChildren, $hookParams): PC$n[P, $Hns] = + | new PC$n(props, propsChildren, $hookArgs) + |""".stripMargin hookCtxsPC += - s""" class PC$n[+P, $coHns](props: P, propsChildren: PropsChildren, $ctxParams) extends PC${n-1}(props, propsChildren$ctxSuperArgs) { + s""" @inline class PC$n[+P, $coHns](props: P, propsChildren: PropsChildren, $ctxParams) extends PC${n-1}(props, propsChildren$ctxSuperArgs) { | override def toString = s"HookCtx.withChildren(\\n props = !props,\\n propsChildren = !propsChildren$ctxToStr)" - | def apply$n[A](f: (P, PropsChildren, $Hns) => A): A = f(props, propsChildren, $hookArgs) + | @inline final def apply$n[A](f: (P, PropsChildren, $Hns) => A): A = f(props, propsChildren, $hookArgs) | } | | implicit def reusabilityPC$n[P, $Hns](implicit P: Reusability[P], PC: Reusability[PropsChildren], $RHns): Reusability[PC$n[P, $Hns]] = @@ -213,9 +222,9 @@ object GenHooks { | |object HookCtx { | - |${hookCtxCtorsP.result().mkString("\n\n")} + |${hookCtxCtorsP.result().mkString("\n")} | - | abstract class P0[+P](final val props: P) + | @inline abstract class P0[+P](final val props: P) | | implicit def reusabilityP0[P](implicit P: Reusability[P]): Reusability[P0[P]] = | Reusability.by(_.props) @@ -225,13 +234,13 @@ object GenHooks { | | object withChildren { | - | def apply[P](props: P, propsChildren: PropsChildren): PC0[P] = + | @inline def apply[P](props: P, propsChildren: PropsChildren): PC0[P] = | new PC0(props, propsChildren) | - |${hookCtxCtorsPC.result().mkString("\n\n")} + |${hookCtxCtorsPC.result().mkString("\n")} | } | - | class PC0[+P](props: P, final val propsChildren: PropsChildren) extends P0(props) + | @inline class PC0[+P](props: P, final val propsChildren: PropsChildren) extends P0(props) | | implicit def reusabilityPC0[P](implicit P: Reusability[P], PC: Reusability[PropsChildren]): Reusability[PC0[P]] = | Reusability((x, y) => P.test(x.props, y.props) && PC.test(x.propsChildren, y.propsChildren)) @@ -242,13 +251,13 @@ object GenHooks { | | object withInput { | - | def apply[I](input: I): I0[I] = + | @inline def apply[I](input: I): I0[I] = | new I0(input) | - |${hookCtxCtorsI.result().mkString("\n\n")} + |${hookCtxCtorsI.result().mkString("\n")} | } | - | class I0[+I](final val input: I) + | @inline class I0[+I](final val input: I) | | implicit def reusabilityI0[I](implicit I: Reusability[I]): Reusability[I0[I]] = | Reusability.by(_.input) diff --git a/library/project/Lib.scala b/library/project/Lib.scala index 511cc88cb..3bce8d278 100644 --- a/library/project/Lib.scala +++ b/library/project/Lib.scala @@ -14,6 +14,12 @@ object Lib { val ghProject = "scalajs-react" + private def readConfigVar(name: String): String = + Option(System.getProperty(name)).orElse(Option(System.getenv(name))) + .fold("")(_.trim.toLowerCase) + + val inCI = readConfigVar("CI") == "1" + def scalacCommonFlags: Seq[String] = Seq( "-deprecation", "-feature", @@ -82,6 +88,10 @@ object Lib { libraryDependencies ++= Seq(Dep.betterMonadicFor, Dep.kindProjector).filter(_ => scalaVersion.value startsWith "2"), disable := false, dependencyOverrides ++= globalDependencyOverrides.value, + Test / clean := { + val dir = (Test / classDirectory).value + IO.delete(dir) + } ) def byScalaVersion[A](f: PartialFunction[(Long, Long), Seq[A]]): Def.Initialize[Seq[A]] = @@ -113,14 +123,24 @@ object Lib { def preventPublication: PE = _.settings(publish / skip := true) + def utestSettingsCross(scope: Configuration): PE = + _.settings( + scope / scalacOptions ++= { + val isScala2 = scalaVersion.value.startsWith("2") + if (isScala2) Seq("-Wconf:msg=copyArrayToImmutableIndexedSeq:s") else Seq() + }, + libraryDependencies += Dep.utest.value % scope, + libraryDependencies += Dep.microlibsTestUtil.value % scope, + testFrameworks += new TestFramework("utest.runner.Framework")) + + def utestSettingsCross: PE = + utestSettingsCross(Test) + def utestSettings(scope: Configuration): PE = - _.configure(InBrowserTesting.js) + _.configure(InBrowserTesting.js, utestSettingsCross(scope)) .settings( jsEnv := new JSDOMNodeJSEnv, - Test / scalacOptions += "-language:reflectiveCalls", - libraryDependencies += Dep.utest.value % scope, - libraryDependencies += Dep.microlibsTestUtil.value % scope, - testFrameworks += new TestFramework("utest.runner.Framework")) + Test / scalacOptions += "-language:reflectiveCalls") def utestSettings: PE = utestSettings(Test) diff --git a/library/project/plugins.sbt b/library/project/plugins.sbt index e6e430cbe..d61371d37 100644 --- a/library/project/plugins.sbt +++ b/library/project/plugins.sbt @@ -5,4 +5,4 @@ libraryDependencies ++= Seq( addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.0") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1") diff --git a/library/testEmissions/js/src/main/scala-2/japgolly/scalajs/react/test/emissions/HooksWithScalaFns.scala b/library/testEmissions/js/src/main/scala-2/japgolly/scalajs/react/test/emissions/HooksWithScalaFns.scala new file mode 100644 index 000000000..8997eb0b3 --- /dev/null +++ b/library/testEmissions/js/src/main/scala-2/japgolly/scalajs/react/test/emissions/HooksWithScalaFns.scala @@ -0,0 +1,37 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.hooks.HookCtx +import japgolly.scalajs.react.vdom.html_<^._ + +object HooksWithScalaFns { + + private type US = Hooks.UseState[Int] + + private def state0() = + 123 + + private def state1(p: Int, s: US) = + p + s.value + + private val state2: HookCtx.P2[Int, US, US] => Int = + $ => $.props + $.hook1.value + $.hook2.value + + private val state3: (Int, US, US, US) => Int = + _ + _.value + _.value + _.value + + private def render(p: Int, s1: US, s2: US, s3: US, s4: US) = { + val sum = p + s1.value + s2.value + s3.value + s4.value + <.button( + "Sum = ", sum, + ^.onClick --> s1.modState(_ + 1), + ) + } + + val Component = ScalaFnComponent.withHooks[Int] + .useState(state0()) + .useStateBy(state1(_, _)) + .useStateBy(state2) + .useStateBy(state3) + .renderRR(render _) +} diff --git a/library/testEmissions/js/src/main/scala-3/japgolly/scalajs/react/test/emissions/HooksWithScalaFns.scala b/library/testEmissions/js/src/main/scala-3/japgolly/scalajs/react/test/emissions/HooksWithScalaFns.scala new file mode 100644 index 000000000..3b514c822 --- /dev/null +++ b/library/testEmissions/js/src/main/scala-3/japgolly/scalajs/react/test/emissions/HooksWithScalaFns.scala @@ -0,0 +1,37 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.hooks.HookCtx +import japgolly.scalajs.react.vdom.html_<^._ + +object HooksWithScalaFns { + + private type US = Hooks.UseState[Int] + + private def state0() = + 123 + + private def state1(p: Int, s: US) = + p + s.value + + private val state2: HookCtx.P2[Int, US, US] => Int = + $ => $.props + $.hook1.value + $.hook2.value + + private val state3: (Int, US, US, US) => Int = + _ + _.value + _.value + _.value + + private def render(p: Int, s1: US, s2: US, s3: US, s4: US) = { + val sum = p + s1.value + s2.value + s3.value + s4.value + <.button( + "Sum = ", sum, + ^.onClick --> s1.modState(_ + 1), + ) + } + + val Component = ScalaFnComponent.withHooks[Int] + .useState(state0()) + .useStateBy(state1) + .useStateBy(state2) + .useStateBy(state3) + .renderRR(render) +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/CustomHooks.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/CustomHooks.scala new file mode 100644 index 000000000..3d3f7971a --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/CustomHooks.scala @@ -0,0 +1,29 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +object CustomHooks { + + val customHook1 = CustomHook[Int].useStateBy(_ + 1).buildReturning(_.hook1) + val customHook2 = CustomHook[Unit].useEffect(Callback.log("hello")).build + val customHook3 = CustomHook[Unit].useState(123).buildReturning(_.hook1) + val customHook4 = CustomHook[Int].useStateBy(_ + 1).buildReturning(_.hook1) + val customHook5 = CustomHook[Int].useStateBy(_ * 2).buildReturning(_.hook1) + val customHook6 = CustomHook[Int].useStateBy(_ * 3).buildReturning(_.hook1) + + val Component = ScalaFnComponent.withHooks[Int] + + .custom(customHook1) + .custom(customHook2) + .custom(customHook3) + + .customBy((p, _, _) => customHook4(p - 1)) + .customBy((_, _, _, a) => customHook5(a.value)) + .customBy($ => customHook6($.hook4.value)) + + .renderRR { (p, s1, s2, s3, s4, s5) => + val sum = p + s1.value + s2.value + s3.value + s4.value + s5.value + <.div("Sum = ", sum) + } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksPrimative.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksPrimative.scala new file mode 100644 index 000000000..dd5c33d68 --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksPrimative.scala @@ -0,0 +1,31 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ +import org.scalajs.dom.console + +object HooksPrimative { + + val Component = ScalaFnComponent.withHooks[Unit] + + .localVal(1111) + .localValBy(_ => 2222) + .localValBy((_, _, _) => 3333) + + .localLazyVal(4444) + .localLazyValBy(_ => 5555) + .localLazyValBy((_, _, _, _, _, _) => 6666) + + .localVar(7777) + .localVarBy(_ => 8888) + .localVarBy((_, _, _, _, _, _, _, _, _) => 9999) + + .unchecked(console.log("aaaaa")) + .uncheckedBy(_ => "bbbbb") + .uncheckedBy((_, _, _, _, _, _, _, _, _, _, _) => console.log("ccccc")) + + .renderRR { (_, a, b, c, d, e, f, g, h, i, j) => + val sum = a + b + c + d() + e() + f() + g.value + h.value + i.value + j.length + sum + } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksTrivial.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksTrivial.scala new file mode 100644 index 000000000..88380c778 --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksTrivial.scala @@ -0,0 +1,35 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +object HooksTrivial { + + private val ctx = React.createContext(100) + private def add(n: Int): (Int, Int) => Int = _ + _ + n + + val Component = ScalaFnComponent.withHooks[Int] + + .useContext(ctx) + .useContextBy(_ => ctx) + .useContextBy((_, _, _) => ctx) + + .useDebugValue("aaaaa") + .useDebugValueBy(_ => 321654) + .useDebugValueBy((_, _, _, _) => 987) + + .useReducer(add(0), 100) + .useReducerBy((p, _, _, _, _) => add(p), _ + _ + _ + _ + _.value) + .useReducerBy($ => add($.hook4.value), $ => $.props + $.hook4.value + $.hook5.value) + + .useState(123) + .useStateBy((p, a, _, _, _, _, f, _) => p + a + f.value) + .useStateBy($ => $.props + $.hook1 + $.hook6.value) + + .useForceUpdate + + .renderRR { (_, a, b, c, d, e, f, g, h, i, forceUpdate) => + val sum = a + b + c + d.value + e.value + f.value + g.value + h.value + i.value + <.div(sum, ^.onClick --> forceUpdate) + } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksWithChildrenCtxFn.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksWithChildrenCtxFn.scala new file mode 100644 index 000000000..7bb0737ee --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksWithChildrenCtxFn.scala @@ -0,0 +1,19 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +object HooksWithChildrenCtxFn { + + val Component = ScalaFnComponent.withHooks[Int] + .withPropsChildren + .useState(123) + .renderRR { (p, c, s1) => + val sum = p + s1.value + c.count + <.button( + "Sum = ", sum, + ^.onClick --> s1.modState(_ + 1), + c + ) + } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksWithChildrenCtxObj.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksWithChildrenCtxObj.scala new file mode 100644 index 000000000..eb86dc193 --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksWithChildrenCtxObj.scala @@ -0,0 +1,15 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +object HooksWithChildrenCtxObj { + + val Component = ScalaFnComponent.withHooks[Int] + .withPropsChildren + .useState(123) + .renderRR { $ => + val sum = $.props + $.hook1.value + $.propsChildren.count + sum + } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksWithJsFns.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksWithJsFns.scala new file mode 100644 index 000000000..ae733d392 --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/HooksWithJsFns.scala @@ -0,0 +1,35 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.hooks.HookCtx +import japgolly.scalajs.react.vdom.html_<^._ +import scala.scalajs.js + +object HooksWithJsFns { + + private type US = Hooks.UseState[Int] + + private def jsState0() = + 123 + + private def jsState1: js.Function2[Int, US, Int] = + _ + _.value + + private val jsState2: js.Function1[HookCtx.P2[Int, US, US], Int] = + $ => $.props + $.hook1.value + $.hook2.value + + private def render: js.Function4[Int, US, US, US, VdomNode] = + (p, s1, s2, s3) => { + val sum = p + s1.value + s2.value + s3.value + <.button( + "Sum = ", sum, + ^.onClick --> s1.modState(_ + 1), + ) + } + + val Component = ScalaFnComponent.withHooks[Int] + .useState(jsState0()) + .useStateBy(jsState1) + .useStateBy(jsState2) + .renderRR(render) +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/JustPropsChildrenViaHookApi.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/JustPropsChildrenViaHookApi.scala new file mode 100644 index 000000000..51e132c8b --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/JustPropsChildrenViaHookApi.scala @@ -0,0 +1,14 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +object JustPropsChildrenViaHookApi { + + val Component = ScalaFnComponent.withHooks[Int] + .withPropsChildren + .renderRR { (p, c) => + val sum = p + c.count + sum + } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/JustPropsViaHookApi.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/JustPropsViaHookApi.scala new file mode 100644 index 000000000..98b41cd24 --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/JustPropsViaHookApi.scala @@ -0,0 +1,13 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +object JustPropsViaHookApi { + + val Component = ScalaFnComponent.withHooks[Int] + .renderRR { p => + val magicNumber = p + 654 + magicNumber + } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/Main.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/Main.scala new file mode 100644 index 000000000..36462a56c --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/Main.scala @@ -0,0 +1,36 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ +import org.scalajs.dom + +object Main { + + def main(): Unit = { + val app = Component() + val cont = dom.document.getElementById("root") + app.renderIntoDOM(cont) + } + + private val Component = ScalaFnComponent[Unit] { _ => + <.div( + CustomHooks .Component(0), + HooksPrimative .Component(), + HooksTrivial .Component(0), + HooksWithChildrenCtxFn .Component(0)(<.div), + HooksWithChildrenCtxObj .Component(0)(<.div), + HooksWithJsFns .Component(0), + HooksWithScalaFns .Component(0), + JustPropsChildrenViaHookApi.Component(0)(<.div), + JustPropsViaHookApi .Component(0), + RenderReusable .all(PI(987)), + RenderWithReuse .all(PI(123)), + RenderWithReuseBy .all(PI(456)), + UseCallback .Component(0), + UseEffect .Component(0), + UseMemo .Component(0), + UseRef .Component(0), + UseStateWithReuse .Component(0), + ) + } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/PI.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/PI.scala new file mode 100644 index 000000000..8761462ff --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/PI.scala @@ -0,0 +1,15 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ + +final case class PI(pi: Int) { + def unary_- : PI = PI(-pi) + def *(n: Int): PI = PI(pi * n) + def +(n: Int): PI = PI(pi + n) + def +(n: PI): PI = PI(pi + n.pi) +} + +object PI { + implicit val reusability: Reusability[PI] = + Reusability.by[PI, Int](_.pi >> 1) +} \ No newline at end of file diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/RenderReusable.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/RenderReusable.scala new file mode 100644 index 000000000..01c3dcd87 --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/RenderReusable.scala @@ -0,0 +1,90 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.hooks.HookCtx +import japgolly.scalajs.react.vdom.html_<^._ +import org.scalajs.dom.html.Input + +object RenderReusable { + + def all = ScalaFnComponent[PI] { p => + <.div( + P (p), + CtxObj_P (), + CtxFn_P (p), + P_PC (p)(1), + CtxObj_P_PC(2), + CtxFn_P_PC (3), + ) + } + + val P = + ScalaFnComponent.withHooks[PI] + .renderRRReusable(p => Reusable.implicitly(p.toString)) + + val CtxObj_P = + ScalaFnComponent.withHooks[Unit] + .useRef(100) + .useState(0) + .renderRRReusable { $ => + val ref = $.hook1 + val s = $.hook2 + Reusable.never( + <.div( + ref.value, + <.button(^.onClick --> ref.mod(_ + 1)), + <.button(^.onClick --> s.modState(_ + 1)), + ) + ) + } + + val CtxFn_P = + ScalaFnComponent.withHooks[PI] + .useState(20) + .useCallback(Callback.log("asd")) + .useForceUpdate + .renderRRReusable { (p, s, incES, fu) => + Reusable.never( + <.div( + s"P=$p, S=${s.value}", + <.button(^.onClick --> s.modState(_ + 1)), + <.button(^.onClick --> (incES >> fu)), + ) + ) + } + + val P_PC = + ScalaFnComponent.withHooks[PI] + .withPropsChildren + .renderRRReusable { (p, c) => + Reusable.always(<.div(s"P=$p", c)) + } + + val CtxObj_P_PC = + ScalaFnComponent.withHooks[Unit] + .withPropsChildren + .useRefToVdom[Input] + .useState("x") + .renderRRReusable { $ => + val c = $.propsChildren + val inputRef = $.hook1 + val s = $.hook2 + def onChange(e: ReactEventFromInput): Callback = s.setState(e.target.value) + Reusable.never( + <.div(<.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), c) + ) + } + + val CtxFn_P_PC = + ScalaFnComponent.withHooks[Unit] + .withPropsChildren + .useRefToVdom[Input] + .useState("x") + .renderRRReusable { (_, c, inputRef, s) => + def onChange(e: ReactEventFromInput): Callback = s.setState(e.target.value) + Reusable.never( + <.div(<.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), c) + ) + } + +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/RenderWithReuse.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/RenderWithReuse.scala new file mode 100644 index 000000000..c6d19d035 --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/RenderWithReuse.scala @@ -0,0 +1,82 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.hooks.HookCtx +import japgolly.scalajs.react.vdom.html_<^._ +import org.scalajs.dom.html.Input + +object RenderWithReuse { + + def all = ScalaFnComponent[PI] { p => + <.div( + P (p), + CtxObj_P (), + CtxFn_P (p), + P_PC (p)(1), + CtxObj_P_PC(2), + CtxFn_P_PC (3), + ) + } + + val P = + ScalaFnComponent.withHooks[PI] + .renderRRWithReuse(_.toString) + + val CtxObj_P = + ScalaFnComponent.withHooks[Unit] + .useRef(100) + .useState(0) + .renderRRWithReuse { $ => + val ref = $.hook1 + val s = $.hook2 + <.div( + ref.value, + <.button(^.onClick --> ref.mod(_ + 1)), + <.button(^.onClick --> s.modState(_ + 1)), + ) + } + + val CtxFn_P = + ScalaFnComponent.withHooks[PI] + .useState(20) + .useCallback(Callback.log("asd")) + .useForceUpdate + .renderRRWithReuse { (p, s, incES, fu) => + <.div( + s"P=$p, S=${s.value}", + <.button(^.onClick --> s.modState(_ + 1)), + <.button(^.onClick --> (incES >> fu)), + ) + } + + val P_PC = + ScalaFnComponent.withHooks[PI] + .withPropsChildren + .renderRRWithReuse { (p, c) => + <.div(s"P=$p", c) + } + + val CtxObj_P_PC = + ScalaFnComponent.withHooks[Unit] + .withPropsChildren + .useRefToVdom[Input] + .useState("x") + .renderRRWithReuse { $ => + val c = $.propsChildren + val inputRef = $.hook1 + val s = $.hook2 + def onChange(e: ReactEventFromInput): Callback = s.setState(e.target.value) + <.div(<.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), c) + } + + val CtxFn_P_PC = + ScalaFnComponent.withHooks[Unit] + .withPropsChildren + .useRefToVdom[Input] + .useState("x") + .renderRRWithReuse { (_, c, inputRef, s) => + def onChange(e: ReactEventFromInput): Callback = s.setState(e.target.value) + <.div(<.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), c) + } + +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/RenderWithReuseBy.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/RenderWithReuseBy.scala new file mode 100644 index 000000000..c7e2cf8be --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/RenderWithReuseBy.scala @@ -0,0 +1,82 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.hooks.HookCtx +import japgolly.scalajs.react.vdom.html_<^._ +import org.scalajs.dom.html.Input + +object RenderWithReuseBy { + + def all = ScalaFnComponent[PI] { p => + <.div( + P (p), + CtxObj_P (), + CtxFn_P (p), + P_PC (p)(1), + CtxObj_P_PC(2), + CtxFn_P_PC (3), + ) + } + + val P = + ScalaFnComponent.withHooks[PI] + .renderRRWithReuseBy(_ + 1)(_.toString) + + val CtxObj_P = + ScalaFnComponent.withHooks[Unit] + .useRef(100) + .useState(0) + .renderRRWithReuseBy(c => c) { $ => + val ref = $.hook1 + val s = $.hook2 + <.div( + ref.value, + <.button(^.onClick --> ref.mod(_ + 1)), + <.button(^.onClick --> s.modState(_ + 1)), + ) + } + + val CtxFn_P = + ScalaFnComponent.withHooks[PI] + .useState(20) + .useCallback(Callback.log("asd")) + .useForceUpdate + .renderRRWithReuseBy((_, _, _, _)) { case (p, s, incES, fu) => + <.div( + s"P=$p, S=${s.value}", + <.button(^.onClick --> s.modState(_ + 1)), + <.button(^.onClick --> (incES >> fu)), + ) + } + + val P_PC = + ScalaFnComponent.withHooks[PI] + .withPropsChildren + .renderRRWithReuseBy((_, _)) { case (p, c) => + <.div(s"P=$p", c) + } + + val CtxObj_P_PC = + ScalaFnComponent.withHooks[Unit] + .withPropsChildren + .useRefToVdom[Input] + .useState("x") + .renderRRWithReuseBy(c => c) { $ => + val c = $.propsChildren + val inputRef = $.hook1 + val s = $.hook2 + def onChange(e: ReactEventFromInput): Callback = s.setState(e.target.value) + <.div(<.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), c) + } + + val CtxFn_P_PC = + ScalaFnComponent.withHooks[Unit] + .withPropsChildren + .useRefToVdom[Input] + .useState("x") + .renderRRWithReuseBy((_, _, _, _)) { case (_, c, inputRef, s) => + def onChange(e: ReactEventFromInput): Callback = s.setState(e.target.value) + <.div(<.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), c) + } + +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseCallback.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseCallback.scala new file mode 100644 index 000000000..e5f25694d --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseCallback.scala @@ -0,0 +1,20 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +object UseCallback { + + val Component = ScalaFnComponent.withHooks[Int] + + .useCallback(Callback.log("aaaaaaaaaaaaaa")) + .useCallbackBy($ => Callback.log("bbbbbbbbbbbbbb" + $.props)) + .useCallbackBy((p, _, _) => Callback.log("cccccccccccccc" + p)) + + .renderRR { (p, a, b, c) => + a.runNow() + b.runNow() + c.runNow() + p + } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseEffect.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseEffect.scala new file mode 100644 index 000000000..63f51f861 --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseEffect.scala @@ -0,0 +1,30 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +object UseEffect { + + val Component = ScalaFnComponent.withHooks[Int] + + .useEffect(Callback.empty) + .useEffectOnMount(Callback.empty) + .useLayoutEffect(Callback.empty) + .useLayoutEffectOnMount(Callback.empty) + + .useEffectBy(Callback.log(_)) + .useEffectOnMountBy(Callback.log(_)) + .useLayoutEffectBy(Callback.log(_)) + .useLayoutEffectOnMountBy(Callback.log(_)) + + .unchecked(0) + + .useEffectBy($ => Callback.log($.props)) + .useEffectOnMountBy($ => Callback.log($.props)) + .useLayoutEffectBy($ => Callback.log($.props)) + .useLayoutEffectOnMountBy($ => Callback.log($.props)) + + .renderRR { (p, s) => + p + s + } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseMemo.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseMemo.scala new file mode 100644 index 000000000..df1c0fb12 --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseMemo.scala @@ -0,0 +1,16 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +object UseMemo { + + val Component = ScalaFnComponent.withHooks[Int] + .useMemo("blah")(_.length) + .useMemoBy((p, a) => (p + a).toString)((p, a) => _.length + p + a) + .useMemoBy($ => ($.props + $.hook1 + $.hook2).toString)($ => _.length + $.props + $.hook1 + $.hook2) + .renderRR { (p, a, b, c) => + val sum = p + a + b + c + sum + } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseRef.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseRef.scala new file mode 100644 index 000000000..99a7d1642 --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseRef.scala @@ -0,0 +1,32 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ +import org.scalajs.dom.html.Input +import scala.scalajs.js + +object UseRef { + + trait JsP extends js.Object + trait JsS extends js.Object + trait JsF extends js.Object + + val jsComp = JsComponent.force[Null, Children.None, Null](null) + + val scalaComp = ScalaComponent.builder[Int].render_P(identity).build + + val Component = ScalaFnComponent.withHooks[Int] + + .useRef(100) + .useRefBy((p, _) => p) + .useRefBy(_.props) + .useRefToVdom[Input] + .useRefToAnyVdom + .useRefToJsComponent(jsComp) + .useRefToJsComponent[JsP, JsS] + .useRefToJsComponentWithMountedFacade[JsP, JsS, JsF] + .useRefToScalaComponent(scalaComp) + .useRefToScalaComponent[Int, Long, String] + + .renderRR { _ => 123 } +} diff --git a/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseStateWithReuse.scala b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseStateWithReuse.scala new file mode 100644 index 000000000..864d0f4b4 --- /dev/null +++ b/library/testEmissions/js/src/main/scala/japgolly/scalajs/react/test/emissions/UseStateWithReuse.scala @@ -0,0 +1,19 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.scalajs.react._ +import japgolly.scalajs.react.vdom.html_<^._ + +// This also tests: +// - render with Ctx instead of CtxFn[_] +// - returning a primative as vdom +object UseStateWithReuse { + + val Component = ScalaFnComponent.withHooks[Int] + .useStateWithReuse(123) + .useStateWithReuseBy((p, s1) => p + s1.value) + .useStateWithReuseBy($ => $.props + $.hook1.value + $.hook2.value) + .renderRR { $ => + val sum = $.hook1.value + $.hook2.value + $.hook3.value + sum + } +} diff --git a/library/testEmissions/jvm/src/test/node/.gitignore b/library/testEmissions/jvm/src/test/node/.gitignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/library/testEmissions/jvm/src/test/node/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/library/testEmissions/jvm/src/test/node/babel.dev.json b/library/testEmissions/jvm/src/test/node/babel.dev.json new file mode 100644 index 000000000..3b9fe4d9a --- /dev/null +++ b/library/testEmissions/jvm/src/test/node/babel.dev.json @@ -0,0 +1,6 @@ +{ + "presets": [], + "plugins": [ + "react-refresh/babel" + ] +} \ No newline at end of file diff --git a/library/testEmissions/jvm/src/test/node/babel.norm.json b/library/testEmissions/jvm/src/test/node/babel.norm.json new file mode 100644 index 000000000..c81d71a6a --- /dev/null +++ b/library/testEmissions/jvm/src/test/node/babel.norm.json @@ -0,0 +1,5 @@ +{ + "comments": false, + "presets": [], + "plugins": [] +} \ No newline at end of file diff --git a/library/testEmissions/jvm/src/test/node/package.json b/library/testEmissions/jvm/src/test/node/package.json new file mode 100644 index 000000000..e5e21079d --- /dev/null +++ b/library/testEmissions/jvm/src/test/node/package.json @@ -0,0 +1,10 @@ +{ + "name": "scalajs_react_testing", + "version": "1.0.0", + "private": true, + "dependencies": { + "@babel/cli": "^7.17.6", + "@babel/core": "^7.17.5", + "react-refresh": "^0.14.0" + } +} diff --git a/library/testEmissions/jvm/src/test/resources/rr-js/custom_hooks-in.js b/library/testEmissions/jvm/src/test/resources/rr-js/custom_hooks-in.js new file mode 100644 index 000000000..18a37e038 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-js/custom_hooks-in.js @@ -0,0 +1,23 @@ +import { useState, useEffect } from 'react'; + +function useFriendStatus(id) { + const [isOnline, setIsOnline] = useState(null); + + useEffect(() => { + setIsOnline(true); + return () => {}; + }); + + return isOnline; +} + +function FriendStatus(props) { + const isOnline = useFriendStatus(props.friend.id); + + if (isOnline === null) { + return 'Loading...'; + } + return isOnline ? 'Online' : 'Offline'; +} + +export default FriendStatus diff --git a/library/testEmissions/jvm/src/test/resources/rr-js/custom_hooks-out.js b/library/testEmissions/jvm/src/test/resources/rr-js/custom_hooks-out.js new file mode 100644 index 000000000..cb186b800 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-js/custom_hooks-out.js @@ -0,0 +1,40 @@ +var _s = $RefreshSig$(), + _s2 = $RefreshSig$(); + +import { useState, useEffect } from 'react'; + +function useFriendStatus(id) { + _s(); + + const [isOnline, setIsOnline] = useState(null); + useEffect(() => { + setIsOnline(true); + return () => {}; + }); + return isOnline; +} + +_s(useFriendStatus, "HLSnnfJYDaeB5hXQTNbVZdmJwXQ="); + +function FriendStatus(props) { + _s2(); + + const isOnline = useFriendStatus(props.friend.id); + + if (isOnline === null) { + return 'Loading...'; + } + + return isOnline ? 'Online' : 'Offline'; +} + +_s2(FriendStatus, "a3B569k9rI2h5KE8Nx8Iioa8o4I=", false, function () { + return [useFriendStatus]; +}); + +_c = FriendStatus; +export default FriendStatus; + +var _c; + +$RefreshReg$(_c, "FriendStatus"); diff --git a/library/testEmissions/jvm/src/test/resources/rr-js/fn-in.js b/library/testEmissions/jvm/src/test/resources/rr-js/fn-in.js new file mode 100644 index 000000000..d3ce852c3 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-js/fn-in.js @@ -0,0 +1,7 @@ +import React from 'react' + +function App() { + return React.createElement("div", {}, "count is: 0"); +} + +export default App diff --git a/library/testEmissions/jvm/src/test/resources/rr-js/fn-out.js b/library/testEmissions/jvm/src/test/resources/rr-js/fn-out.js new file mode 100644 index 000000000..db4a7b468 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-js/fn-out.js @@ -0,0 +1,12 @@ +import React from 'react'; + +function App() { + return React.createElement("div", {}, "count is: 0"); +} + +_c = App; +export default App; + +var _c; + +$RefreshReg$(_c, "App"); diff --git a/library/testEmissions/jvm/src/test/resources/rr-js/hooks-in.js b/library/testEmissions/jvm/src/test/resources/rr-js/hooks-in.js new file mode 100644 index 000000000..d7edeec10 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-js/hooks-in.js @@ -0,0 +1,16 @@ +import React, { useState, useEffect } from 'react' + +function App() { + const [count, setCount] = useState(0) + + useEffect(() => { + document.title = `You clicked ${count} times`; + }); + + return React.createElement("button", { + type: "button", + onClick: () => setCount(count => count + 1) + }, "count is: ", count); +} + +export default App diff --git a/library/testEmissions/jvm/src/test/resources/rr-js/hooks-out.js b/library/testEmissions/jvm/src/test/resources/rr-js/hooks-out.js new file mode 100644 index 000000000..77697c248 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-js/hooks-out.js @@ -0,0 +1,25 @@ +var _s = $RefreshSig$(); + +import React, { useState, useEffect } from 'react'; + +function App() { + _s(); + + const [count, setCount] = useState(0); + useEffect(() => { + document.title = `You clicked ${count} times`; + }); + return React.createElement("button", { + type: "button", + onClick: () => setCount(count => count + 1) + }, "count is: ", count); +} + +_s(App, "/xL7qdScToREtqzbt5GZ1kHtYjQ="); + +_c = App; +export default App; + +var _c; + +$RefreshReg$(_c, "App"); diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/CustomHooks-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/CustomHooks-out2.js new file mode 100644 index 000000000..d8a16dcc5 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/CustomHooks-out2.js @@ -0,0 +1,163 @@ +'use strict'; + +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary from "./japgolly.scalajs.react.hooks.Api$Primary.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024 from "./japgolly.scalajs.react.hooks.CustomHook$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Arg$0024 from "./japgolly.scalajs.react.hooks.CustomHook$Arg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First from "./japgolly.scalajs.react.hooks.CustomHook$Builder$First.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024Subsequent from "./japgolly.scalajs.react.hooks.CustomHook$Builder$Subsequent.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024I1 from "./japgolly.scalajs.react.hooks.HookCtx$I1.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseEffectArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF from "./japgolly.scalajs.react.hooks.Hooks$UseStateF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement from "./japgolly.scalajs.react.vdom.VdomElement.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eWrappedVarArgs from "./scala.scalajs.runtime.WrappedVarArgs.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$() { + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook1 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook2 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook3 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook4 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook5 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook6 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ = this; + var this$3 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var initialState = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$1$2 => { + var x$1 = x$1$2 | 0; + return 1 + x$1 | 0; + }); + var step = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useStateBy__F1__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$3, initialState, step).buildReturning__F1__F1(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$2$2 => { + var x$2 = x$2$2; + return x$2.Ljapgolly_scalajs_react_hooks_HookCtx$I1__f_hook1; + })); + var this$6 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var effect = new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline("hello", $j_scala$002eArray$0024.$m_sci_Nil$())); + var a = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + var step$1 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useEffect__O__F1__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$6, effect, a, step$1).build__F1(); + var this$8 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var initialState$1 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => 123); + var step$2 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useState__F0__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$8, initialState$1, step$2).buildReturning__F1__F1(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$3$2 => { + var x$3 = x$3$2; + return x$3.Ljapgolly_scalajs_react_hooks_HookCtx$I1__f_hook1; + })); + var this$10 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var initialState$2 = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$4$2 => { + var x$4 = x$4$2 | 0; + return 1 + x$4 | 0; + }); + var step$3 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook4 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useStateBy__F1__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$10, initialState$2, step$3).buildReturning__F1__F1(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$5$2 => { + var x$5 = x$5$2; + return x$5.Ljapgolly_scalajs_react_hooks_HookCtx$I1__f_hook1; + })); + var this$12 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var initialState$3 = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$6$2 => { + var x$6 = x$6$2 | 0; + return x$6 << 1; + }); + var step$4 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useStateBy__F1__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$12, initialState$3, step$4).buildReturning__F1__F1(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$7$2 => { + var x$7 = x$7$2; + return x$7.Ljapgolly_scalajs_react_hooks_HookCtx$I1__f_hook1; + })); + var this$14 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var initialState$4 = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$8$2 => { + var x$8 = x$8$2 | 0; + return Math.imul(3, x$8); + }); + var step$5 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook6 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useStateBy__F1__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$14, initialState$4, step$5).buildReturning__F1__F1(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$9$2 => { + var x$9 = x$9$2; + return x$9.Ljapgolly_scalajs_react_hooks_HookCtx$I1__f_hook1; + })); + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_CustomHooks$().japgolly$scalajs$react$test$emissions$CustomHooks$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$15 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$15.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ }; +$c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$; + +function $h_Ljapgolly_scalajs_react_test_emissions_CustomHooks$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ }; +$h_Ljapgolly_scalajs_react_test_emissions_CustomHooks$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$.prototype.japgolly$scalajs$react$test$emissions$CustomHooks$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = function (props) { + var this$1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Arg$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$Arg$().exactId__F1(); + var v1 = props.a | 0; + + var __japgolly__hook1_arg = this$1.apply__O__O(v1) | 0; + + var __japgolly__hook1 = $m_Ljapgolly_scalajs_react_test_emissions_CustomHooks$().Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook1.apply__O__O(__japgolly__hook1_arg); + + $m_Ljapgolly_scalajs_react_test_emissions_CustomHooks$().Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook2.apply__O__O(void 0); + + var __japgolly__hook3 = $m_Ljapgolly_scalajs_react_test_emissions_CustomHooks$().Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook3.apply__O__O(void 0); + + var __japgolly__hook4_raw = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().apply$extension__F1__O__F1($m_Ljapgolly_scalajs_react_test_emissions_CustomHooks$().Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook4, -1 + (props.a | 0) | 0); + + var __japgolly__hook4 = __japgolly__hook4_raw.apply__O__O(void 0); + + var __japgolly__hook5_raw = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().apply$extension__F1__O__F1($m_Ljapgolly_scalajs_react_test_emissions_CustomHooks$().Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook5, __japgolly__hook4.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0]); + + var __japgolly__hook5 = __japgolly__hook5_raw.apply__O__O(void 0); + + props.a; + + var __japgolly__hook6_raw = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().apply$extension__F1__O__F1($m_Ljapgolly_scalajs_react_test_emissions_CustomHooks$().Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook6, __japgolly__hook5.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0]); + + var __japgolly__hook6 = __japgolly__hook6_raw.apply__O__O(void 0); + + var sum = (((((props.a | 0) + (__japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook3.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook4.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook5.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook6.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0; + var $$x1 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1("Sum = ")), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum))]; + var this$12 = $$x1.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + return $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement.$f_Ljapgolly_scalajs_react_vdom_VdomElement__rawNode__sjs_js_$bar(this$12); +}; + +var $d_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_CustomHooks$: 0 +}, false, "japgolly.scalajs.react.test.emissions.CustomHooks$", { + Ljapgolly_scalajs_react_test_emissions_CustomHooks$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ }; +$c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_CustomHooks$; +var $n_Ljapgolly_scalajs_react_test_emissions_CustomHooks$; + +function $m_Ljapgolly_scalajs_react_test_emissions_CustomHooks$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_CustomHooks$) { + $n_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ = new $c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_CustomHooks$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/CustomHooks-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/CustomHooks-out3.js new file mode 100644 index 000000000..9d620dab1 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/CustomHooks-out3.js @@ -0,0 +1,173 @@ +'use strict'; + +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024 from "./japgolly.scalajs.react.callback.Trampoline$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay from "./japgolly.scalajs.react.callback.Trampoline$Delay.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary from "./japgolly.scalajs.react.hooks.Api$Primary.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024 from "./japgolly.scalajs.react.hooks.CustomHook$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Arg$0024 from "./japgolly.scalajs.react.hooks.CustomHook$Arg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First from "./japgolly.scalajs.react.hooks.CustomHook$Builder$First.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024Subsequent from "./japgolly.scalajs.react.hooks.CustomHook$Builder$Subsequent.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024I1 from "./japgolly.scalajs.react.hooks.HookCtx$I1.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseEffectArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF from "./japgolly.scalajs.react.hooks.Hooks$UseStateF.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite from "./japgolly.scalajs.react.vdom.TagLite.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagMod from "./japgolly.scalajs.react.vdom.TagMod.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eCompat$0024 from "./scala.scalajs.runtime.Compat$.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$() { + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook1 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook2 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook3 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook4 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook5 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook6 = null; + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ = this; + var this$3 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var initialState = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$1 => { + var _$1$1 = _$1 | 0; + + return 1 + _$1$1 | 0; + }); + var step = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useStateBy__F1__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$3, initialState, step).buildReturning__F1__F1(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$2 => { + var _$2$1 = _$2; + return _$2$1.Ljapgolly_scalajs_react_hooks_HookCtx$I1__f_hook1; + })); + var this$8 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var optionalParams$proxy1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy3 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log("hello", ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy1)); + }); + var effect = new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy3))); + var a = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + var step$1 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useEffect__O__F1__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$8, effect, a, step$1).build__F1(); + var this$10 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var initialState$1 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => 123); + var step$2 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useState__F0__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$10, initialState$1, step$2).buildReturning__F1__F1(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$3 => { + var _$3$1 = _$3; + return _$3$1.Ljapgolly_scalajs_react_hooks_HookCtx$I1__f_hook1; + })); + var this$12 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var initialState$2 = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$4 => { + var _$4$1 = _$4 | 0; + + return 1 + _$4$1 | 0; + }); + var step$3 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook4 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useStateBy__F1__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$12, initialState$2, step$3).buildReturning__F1__F1(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$5 => { + var _$5$1 = _$5; + return _$5$1.Ljapgolly_scalajs_react_hooks_HookCtx$I1__f_hook1; + })); + var this$14 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var initialState$3 = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$6 => { + var _$6$1 = _$6 | 0; + + return _$6$1 << 1; + }); + var step$4 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useStateBy__F1__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$14, initialState$3, step$4).buildReturning__F1__F1(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$7 => { + var _$7$1 = _$7; + return _$7$1.Ljapgolly_scalajs_react_hooks_HookCtx$I1__f_hook1; + })); + var this$16 = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_CustomHook.apply__Ljapgolly_scalajs_react_hooks_CustomHook$Builder$First(); + var initialState$4 = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$8 => { + var _$8$1 = _$8 | 0; + + return Math.imul(3, _$8$1); + }); + var step$5 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Builder$0024First.$c_Ljapgolly_scalajs_react_hooks_CustomHook$Builder$FirstStep(); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook6 = $j_japgolly$002escalajs$002ereact$002ehooks$002eApi$0024Primary.$f_Ljapgolly_scalajs_react_hooks_Api$Primary__useStateBy__F1__Ljapgolly_scalajs_react_hooks_Api$AbstractStep__O(this$16, initialState$4, step$5).buildReturning__F1__F1(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$9 => { + var _$9$1 = _$9; + return _$9$1.Ljapgolly_scalajs_react_hooks_HookCtx$I1__f_hook1; + })); + + var rawComponent = props => { + var __japgolly__hook1_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024Arg$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$Arg$().exactId__F1().apply__O__O(props.a) | 0; + + var __japgolly__hook1 = this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook1.apply__O__O(__japgolly__hook1_arg); + + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook2.apply__O__O(void 0); + + var __japgolly__hook3 = this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook3.apply__O__O(void 0); + + var p = props.a | 0; + + var __japgolly__hook4_raw = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().apply$extension__F1__O__F1(this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook4, -1 + p | 0); + + var __japgolly__hook4 = __japgolly__hook4_raw.apply__O__O(void 0); + + props.a | 0; + + var __japgolly__hook5_raw = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().apply$extension__F1__O__F1(this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook5, __japgolly__hook4.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0]); + + var __japgolly__hook5 = __japgolly__hook5_raw.apply__O__O(void 0); + + props.a; + + var __japgolly__hook6_raw = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().apply$extension__F1__O__F1(this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_customHook6, __japgolly__hook5.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0]); + + var __japgolly__hook6 = __japgolly__hook6_raw.apply__O__O(void 0); + + var p$2 = props.a | 0; + var sum = ((((p$2 + (__japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook3.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook4.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook5.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook6.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0; + var this$24 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self = "div"; + var xs = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1("Sum = ")), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum))])); + var this$25 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$24, self, xs); + return this$25.rawElement__Ljapgolly_scalajs_react_facade_React$Element(); + }; + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$26 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_CustomHooks$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$26.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ }; +$c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$; + +function $h_Ljapgolly_scalajs_react_test_emissions_CustomHooks$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ }; +$h_Ljapgolly_scalajs_react_test_emissions_CustomHooks$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_CustomHooks$: 0 +}, false, "japgolly.scalajs.react.test.emissions.CustomHooks$", { + Ljapgolly_scalajs_react_test_emissions_CustomHooks$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ }; +$c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_CustomHooks$; +var $n_Ljapgolly_scalajs_react_test_emissions_CustomHooks$; + +function $m_Ljapgolly_scalajs_react_test_emissions_CustomHooks$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_CustomHooks$) { + $n_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ = new $c_Ljapgolly_scalajs_react_test_emissions_CustomHooks$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_CustomHooks$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_CustomHooks$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksPrimative-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksPrimative-out2.js new file mode 100644 index 000000000..fe143f7b6 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksPrimative-out2.js @@ -0,0 +1,138 @@ +'use strict'; + +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024VarF from "./japgolly.scalajs.react.hooks.Hooks$VarF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024 from "./japgolly.scalajs.react.util.DefaultEffects$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eNullPointerException from "./java.lang.NullPointerException.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eruntime$002eLazyInt from "./scala.runtime.LazyInt.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook4_raw$lzycompute$1__sr_LazyInt__I($thiz, __japgolly__hook4_raw$lzy$1) { + if (__japgolly__hook4_raw$lzy$1 === null) { + throw new $j_java$002elang$002eNullPointerException.$c_jl_NullPointerException(); + } + + ; + return __japgolly__hook4_raw$lzy$1.sr_LazyInt__f__initialized ? __japgolly__hook4_raw$lzy$1.sr_LazyInt__f__value : __japgolly__hook4_raw$lzy$1.initialize__I__I(4444); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook4_raw$lzycompute$1__sr_LazyInt__I }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook4_raw$1__sr_LazyInt__I($thiz, __japgolly__hook4_raw$lzy$1) { + return __japgolly__hook4_raw$lzy$1.sr_LazyInt__f__initialized ? __japgolly__hook4_raw$lzy$1.sr_LazyInt__f__value : $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook4_raw$lzycompute$1__sr_LazyInt__I($thiz, __japgolly__hook4_raw$lzy$1); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook4_raw$1__sr_LazyInt__I }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$lzycompute$1__sr_LazyInt__I($thiz, __japgolly__hook5_raw$lzy$1) { + if (__japgolly__hook5_raw$lzy$1 === null) { + throw new $j_java$002elang$002eNullPointerException.$c_jl_NullPointerException(); + } + + ; + return __japgolly__hook5_raw$lzy$1.sr_LazyInt__f__initialized ? __japgolly__hook5_raw$lzy$1.sr_LazyInt__f__value : __japgolly__hook5_raw$lzy$1.initialize__I__I(5555); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$lzycompute$1__sr_LazyInt__I }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$1__sr_LazyInt__I($thiz, __japgolly__hook5_raw$lzy$1) { + return __japgolly__hook5_raw$lzy$1.sr_LazyInt__f__initialized ? __japgolly__hook5_raw$lzy$1.sr_LazyInt__f__value : $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$lzycompute$1__sr_LazyInt__I($thiz, __japgolly__hook5_raw$lzy$1); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$1__sr_LazyInt__I }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$lzycompute$1__sr_LazyInt__I($thiz, __japgolly__hook6_raw$lzy$1) { + if (__japgolly__hook6_raw$lzy$1 === null) { + throw new $j_java$002elang$002eNullPointerException.$c_jl_NullPointerException(); + } + + ; + return __japgolly__hook6_raw$lzy$1.sr_LazyInt__f__initialized ? __japgolly__hook6_raw$lzy$1.sr_LazyInt__f__value : __japgolly__hook6_raw$lzy$1.initialize__I__I(6666); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$lzycompute$1__sr_LazyInt__I }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$1__sr_LazyInt__I($thiz, __japgolly__hook6_raw$lzy$1) { + return __japgolly__hook6_raw$lzy$1.sr_LazyInt__f__initialized ? __japgolly__hook6_raw$lzy$1.sr_LazyInt__f__value : $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$lzycompute$1__sr_LazyInt__I($thiz, __japgolly__hook6_raw$lzy$1); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$1__sr_LazyInt__I }; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$() { + this.Ljapgolly_scalajs_react_test_emissions_HooksPrimative$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$().japgolly$scalajs$react$test$emissions$HooksPrimative$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonN__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_HooksPrimative$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$.prototype.japgolly$scalajs$react$test$emissions$HooksPrimative$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = function (props) { + var __japgolly__hook4_raw$lzy = new $j_scala$002eruntime$002eLazyInt.$c_sr_LazyInt(); + + var __japgolly__hook5_raw$lzy = new $j_scala$002eruntime$002eLazyInt.$c_sr_LazyInt(); + + var __japgolly__hook6_raw$lzy = new $j_scala$002eruntime$002eLazyInt.$c_sr_LazyInt(); + + props.a; + props.a; + var this$4 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook7 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024VarF.$c_Ljapgolly_scalajs_react_hooks_Hooks$VarF(7777, this$4.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + props.a; + var this$7 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook8 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024VarF.$c_Ljapgolly_scalajs_react_hooks_Hooks$VarF(8888, this$7.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + var this$9 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook9 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024VarF.$c_Ljapgolly_scalajs_react_hooks_Hooks$VarF(9999, this$9.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + console.log("aaaaa"); + props.a; + console.log("ccccc"); + var sum = ((((((6666 + $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook4_raw$1__sr_LazyInt__I(this, __japgolly__hook4_raw$lzy) | 0) + $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$1__sr_LazyInt__I(this, __japgolly__hook5_raw$lzy) | 0) + $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$1__sr_LazyInt__I(this, __japgolly__hook6_raw$lzy) | 0) + (__japgolly__hook7.Ljapgolly_scalajs_react_hooks_Hooks$VarF__f_value | 0) | 0) + (__japgolly__hook8.Ljapgolly_scalajs_react_hooks_Hooks$VarF__f_value | 0) | 0) + (__japgolly__hook9.Ljapgolly_scalajs_react_hooks_Hooks$VarF__f_value | 0) | 0) + ("bbbbb".length | 0) | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; +}; + +var $d_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksPrimative$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksPrimative$", { + Ljapgolly_scalajs_react_test_emissions_HooksPrimative$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksPrimative-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksPrimative-out3.js new file mode 100644 index 000000000..7c0314af8 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksPrimative-out3.js @@ -0,0 +1,120 @@ +'use strict'; + +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024VarF from "./japgolly.scalajs.react.hooks.Hooks$VarF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024 from "./japgolly.scalajs.react.util.DefaultEffects$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eNullPointerException from "./java.lang.NullPointerException.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eruntime$002eLazyInt from "./scala.runtime.LazyInt.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$lzyINIT1$1__sr_LazyInt__I($thiz, __japgolly__hook5_raw$lzy1$1) { + if (__japgolly__hook5_raw$lzy1$1 === null) { + throw new $j_java$002elang$002eNullPointerException.$c_jl_NullPointerException(); + } + + ; + return __japgolly__hook5_raw$lzy1$1.sr_LazyInt__f__initialized ? __japgolly__hook5_raw$lzy1$1.sr_LazyInt__f__value : __japgolly__hook5_raw$lzy1$1.initialize__I__I(5555); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$lzyINIT1$1__sr_LazyInt__I }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$1__sr_LazyInt__I($thiz, __japgolly__hook5_raw$lzy1$2) { + return __japgolly__hook5_raw$lzy1$2.sr_LazyInt__f__initialized ? __japgolly__hook5_raw$lzy1$2.sr_LazyInt__f__value : $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$lzyINIT1$1__sr_LazyInt__I($thiz, __japgolly__hook5_raw$lzy1$2); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$1__sr_LazyInt__I }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$lzyINIT1$1__sr_LazyInt__I($thiz, __japgolly__hook6_raw$lzy1$1) { + if (__japgolly__hook6_raw$lzy1$1 === null) { + throw new $j_java$002elang$002eNullPointerException.$c_jl_NullPointerException(); + } + + ; + return __japgolly__hook6_raw$lzy1$1.sr_LazyInt__f__initialized ? __japgolly__hook6_raw$lzy1$1.sr_LazyInt__f__value : __japgolly__hook6_raw$lzy1$1.initialize__I__I(6666); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$lzyINIT1$1__sr_LazyInt__I }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$1__sr_LazyInt__I($thiz, __japgolly__hook6_raw$lzy1$2) { + return __japgolly__hook6_raw$lzy1$2.sr_LazyInt__f__initialized ? __japgolly__hook6_raw$lzy1$2.sr_LazyInt__f__value : $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$lzyINIT1$1__sr_LazyInt__I($thiz, __japgolly__hook6_raw$lzy1$2); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$1__sr_LazyInt__I }; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$() { + this.Ljapgolly_scalajs_react_test_emissions_HooksPrimative$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ = this; + + var rawComponent = props => { + new $j_scala$002eruntime$002eLazyInt.$c_sr_LazyInt(); + + var __japgolly__hook5_raw$lzy1 = new $j_scala$002eruntime$002eLazyInt.$c_sr_LazyInt(); + + var __japgolly__hook6_raw$lzy1 = new $j_scala$002eruntime$002eLazyInt.$c_sr_LazyInt(); + + props.a; + props.a; + var __japgolly__hook5_raw$lzy1$2 = __japgolly__hook5_raw$lzy1; + var __japgolly__hook6_raw$lzy1$2 = __japgolly__hook6_raw$lzy1; + var this$5 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook7 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024VarF.$c_Ljapgolly_scalajs_react_hooks_Hooks$VarF(7777, this$5.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + props.a; + var this$8 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook8 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024VarF.$c_Ljapgolly_scalajs_react_hooks_Hooks$VarF(8888, this$8.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + var this$10 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook9 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024VarF.$c_Ljapgolly_scalajs_react_hooks_Hooks$VarF(9999, this$10.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + console.log("aaaaa"); + props.a; + props.a; + console.log("ccccc"); + props.a; + var sum = (((((11110 + $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook5_raw$1__sr_LazyInt__I(this, __japgolly__hook5_raw$lzy1$2) | 0) + $p_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$____japgolly__hook6_raw$1__sr_LazyInt__I(this, __japgolly__hook6_raw$lzy1$2) | 0) + (__japgolly__hook7.Ljapgolly_scalajs_react_hooks_Hooks$VarF__f_value | 0) | 0) + (__japgolly__hook8.Ljapgolly_scalajs_react_hooks_Hooks$VarF__f_value | 0) | 0) + (__japgolly__hook9.Ljapgolly_scalajs_react_hooks_Hooks$VarF__f_value | 0) | 0) + ("bbbbb".length | 0) | 0; + return ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; + }; + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$14 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonN__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_HooksPrimative$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$14.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksPrimative$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksPrimative$", { + Ljapgolly_scalajs_react_test_emissions_HooksPrimative$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksPrimative$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksTrivial-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksTrivial-out2.js new file mode 100644 index 000000000..463a552ae --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksTrivial-out2.js @@ -0,0 +1,224 @@ +'use strict'; + +var _s = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReact$0024 from "./japgolly.scalajs.react.React$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002efeature$002eContext$0024$0024anon$00243 from "./japgolly.scalajs.react.feature.Context$$anon$3.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024 from "./japgolly.scalajs.react.hooks.CustomHook$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P5 from "./japgolly.scalajs.react.hooks.HookCtx$P5.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P8 from "./japgolly.scalajs.react.hooks.HookCtx$P8.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseReducer from "./japgolly.scalajs.react.hooks.Hooks$UseReducer.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseReducer$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseReducer$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement from "./japgolly.scalajs.react.vdom.VdomElement.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eClassCastException from "./java.lang.ClassCastException.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002ejs$002eAny$0024 from "./scala.scalajs.js.Any$.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction2 from "./scala.scalajs.runtime.AnonFunction2.js"; +import * as $j_scala$002escalajs$002eruntime$002eWrappedVarArgs from "./scala.scalajs.runtime.WrappedVarArgs.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__add__I__F2($thiz, n) { + return new $j_scala$002escalajs$002eruntime$002eAnonFunction2.$c_sjsr_AnonFunction2((x$1$2, x$2$2) => { + var x$1 = x$1$2 | 0; + var x$2 = x$2$2 | 0; + return (x$1 + x$2 | 0) + n | 0; + }); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__add__I__F2 }; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$() { + this.Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_ctx = null; + this.Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ = this; + var this$1 = $j_japgolly$002escalajs$002ereact$002eReact$0024.$m_Ljapgolly_scalajs_react_React$(); + this.Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_ctx = new $j_japgolly$002escalajs$002ereact$002efeature$002eContext$0024$0024anon$00243.$c_Ljapgolly_scalajs_react_feature_Context$$anon$3(100); + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$().japgolly$scalajs$react$test$emissions$HooksTrivial$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$3 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$3.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype.japgolly$scalajs$react$test$emissions$HooksTrivial$$$anonfun$Component$6__N__Ljapgolly_scalajs_react_internal_Box__I__I__I__Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__I = function (x$5, props$1, __japgolly__hook1$1, __japgolly__hook2$1, __japgolly__hook3$1, __japgolly__hook7$1) { + return ((((props$1.a | 0) + __japgolly__hook1$1 | 0) + __japgolly__hook2$1 | 0) + __japgolly__hook3$1 | 0) + (__japgolly__hook7$1.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0; +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype.japgolly$scalajs$react$test$emissions$HooksTrivial$$$anonfun$Component$7__N__Ljapgolly_scalajs_react_hooks_HookCtx$P5__I = function (x$6, __japgolly__hook9_ctx$1) { + var $$x2 = __japgolly__hook9_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + var this$1 = __japgolly__hook9_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P4__f_hook4; + var $$x1 = this$1.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0]; + var this$2 = __japgolly__hook9_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P5__f_hook5; + return (($$x2 | 0) + ($$x1 | 0) | 0) + (this$2.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0; +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype.japgolly$scalajs$react$test$emissions$HooksTrivial$$$anonfun$Component$9__Ljapgolly_scalajs_react_internal_Box__I__Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__Ljapgolly_scalajs_react_internal_Box = function (props$1, __japgolly__hook1$1, __japgolly__hook9$1) { + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(((props$1.a | 0) + __japgolly__hook1$1 | 0) + (__japgolly__hook9$1.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype.japgolly$scalajs$react$test$emissions$HooksTrivial$$$anonfun$Component$10__Ljapgolly_scalajs_react_hooks_HookCtx$P8__Ljapgolly_scalajs_react_internal_Box = function (__japgolly__hook12_ctx$1) { + var $$x3 = $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$(); + var $$x2 = __japgolly__hook12_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + var $$x1 = __japgolly__hook12_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var this$1 = __japgolly__hook12_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P6__f_hook6; + return $$x3.apply__O__Ljapgolly_scalajs_react_internal_Box((($$x2 | 0) + ($$x1 | 0) | 0) + (this$1.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype.japgolly$scalajs$react$test$emissions$HooksTrivial$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var __japgolly__hook1 = $i_react.useContext($m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$().Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_ctx.Ljapgolly_scalajs_react_feature_Context$$anon$3__f_raw) | 0; + + props.a; + + var __japgolly__hook2 = $i_react.useContext($m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$().Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_ctx.Ljapgolly_scalajs_react_feature_Context$$anon$3__f_raw) | 0; + + var __japgolly__hook3 = $i_react.useContext($m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$().Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_ctx.Ljapgolly_scalajs_react_feature_Context$$anon$3__f_raw) | 0; + + $i_react.useDebugValue(null, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$1$2 => { + if (x$1$2 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + return "aaaaa"; + })); + props.a; + $i_react.useDebugValue(null, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$2$2 => { + if (x$2$2 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + return 321654; + })); + $i_react.useDebugValue(null, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$3$2 => { + if (x$3$2 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + return 987; + })); + + var __japgolly__hook7_raw = $i_react.useReducer($j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$().fromFunction2__F2__sjs_js_Function2($p_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__add__I__F2($m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$(), 0)), null, arg1$2 => { + if (arg1$2 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$(); + return 100; + }); + + var __japgolly__hook7 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseReducer$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseReducer$().fromJs__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseReducer(__japgolly__hook7_raw); + + var __japgolly__hook8_raw = $i_react.useReducer($j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$().fromFunction2__F2__sjs_js_Function2($p_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__add__I__F2($m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$(), props.a | 0)), null, arg1$2$1 => { + if (arg1$2$1 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + var arg1$1 = null; + return $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$().japgolly$scalajs$react$test$emissions$HooksTrivial$$$anonfun$Component$6__N__Ljapgolly_scalajs_react_internal_Box__I__I__I__Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__I(arg1$1, props, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3, __japgolly__hook7); + }); + + var __japgolly__hook8 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseReducer$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseReducer$().fromJs__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseReducer(__japgolly__hook8_raw); + + var props$3 = props.a; + + var __japgolly__hook9_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P5.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P5__O__O__O__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P5.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P5(), props$3, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3, __japgolly__hook7, __japgolly__hook8); + + var $$x3 = $i_react; + var $$x2 = $j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$(); + var $$x1 = $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$(); + var this$5 = __japgolly__hook9_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P4__f_hook4; + + var __japgolly__hook9_raw = $$x3.useReducer($$x2.fromFunction2__F2__sjs_js_Function2($p_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__add__I__F2($$x1, this$5.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0)), null, arg1$2$2 => { + if (arg1$2$2 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + var arg1$3 = null; + return $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$().japgolly$scalajs$react$test$emissions$HooksTrivial$$$anonfun$Component$7__N__Ljapgolly_scalajs_react_hooks_HookCtx$P5__I(arg1$3, __japgolly__hook9_ctx); + }); + + var __japgolly__hook9 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseReducer$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseReducer$().fromJs__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseReducer(__japgolly__hook9_raw); + + var __japgolly__hook10_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(123); + }); + + var __japgolly__hook10 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook10_raw); + + var __japgolly__hook11_raw = $i_react.useState(() => $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$().japgolly$scalajs$react$test$emissions$HooksTrivial$$$anonfun$Component$9__Ljapgolly_scalajs_react_internal_Box__I__Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__Ljapgolly_scalajs_react_internal_Box(props, __japgolly__hook1, __japgolly__hook9)); + + var __japgolly__hook11 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook11_raw); + + var props$4 = props.a; + + var __japgolly__hook12_ctx = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P8.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P8(props$4, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3, __japgolly__hook7, __japgolly__hook8, __japgolly__hook9, __japgolly__hook10, __japgolly__hook11); + + var __japgolly__hook12_raw = $i_react.useState(() => $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$().japgolly$scalajs$react$test$emissions$HooksTrivial$$$anonfun$Component$10__Ljapgolly_scalajs_react_hooks_HookCtx$P8__Ljapgolly_scalajs_react_internal_Box(__japgolly__hook12_ctx)); + + var __japgolly__hook12 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook12_raw); + + var __japgolly__hook13_state = $i_react.useState(0); + + var __japgolly__hook13 = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().useForceUpdateRaw__sjs_js_Tuple2__Ljapgolly_scalajs_react_Reusable(__japgolly__hook13_state); + + var sum = (((((((__japgolly__hook1 + __japgolly__hook2 | 0) + __japgolly__hook3 | 0) + (__japgolly__hook7.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0) + (__japgolly__hook8.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0) + (__japgolly__hook9.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0) + (__japgolly__hook10.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook11.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook12.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0; + var $$x4 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__hook13), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().reusableDefaultSync__F1())]; + var this$15 = $$x4.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + return $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement.$f_Ljapgolly_scalajs_react_vdom_VdomElement__rawNode__sjs_js_$bar(this$15); +}, "lR/p6iCdK9mrQXLpqrMrWz0y4PM=", true); +var $d_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksTrivial$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksTrivial$", { + Ljapgolly_scalajs_react_test_emissions_HooksTrivial$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksTrivial-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksTrivial-out3.js new file mode 100644 index 000000000..6ebf90ac7 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksTrivial-out3.js @@ -0,0 +1,218 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReact$0024 from "./japgolly.scalajs.react.React$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002efeature$002eContext$0024$0024anon$00243 from "./japgolly.scalajs.react.feature.Context$$anon$3.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024 from "./japgolly.scalajs.react.hooks.CustomHook$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P5 from "./japgolly.scalajs.react.hooks.HookCtx$P5.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P8 from "./japgolly.scalajs.react.hooks.HookCtx$P8.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseReducer from "./japgolly.scalajs.react.hooks.Hooks$UseReducer.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseReducer$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseReducer$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite from "./japgolly.scalajs.react.vdom.TagLite.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagMod from "./japgolly.scalajs.react.vdom.TagMod.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eClassCastException from "./java.lang.ClassCastException.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002ejs$002eAny$0024 from "./scala.scalajs.js.Any$.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction2 from "./scala.scalajs.runtime.AnonFunction2.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__add__I__F2($thiz, n) { + return new $j_scala$002escalajs$002eruntime$002eAnonFunction2.$c_sjsr_AnonFunction2((_$1, _$2) => { + var _$1$1 = _$1 | 0; + + var _$2$1 = _$2 | 0; + + return (_$1$1 + _$2$1 | 0) + n | 0; + }); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__add__I__F2 }; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$() { + var _s = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_ctx = null; + this.Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ = this; + var this$1 = $j_japgolly$002escalajs$002ereact$002eReact$0024.$m_Ljapgolly_scalajs_react_React$(); + this.Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_ctx = new $j_japgolly$002escalajs$002ereact$002efeature$002eContext$0024$0024anon$00243.$c_Ljapgolly_scalajs_react_feature_Context$$anon$3(100); + + var rawComponent = props => { + _s(); + + var __japgolly__hook1 = $i_react.useContext(this.Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_ctx.Ljapgolly_scalajs_react_feature_Context$$anon$3__f_raw) | 0; + + props.a; + + var __japgolly__hook2 = $i_react.useContext(this.Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_ctx.Ljapgolly_scalajs_react_feature_Context$$anon$3__f_raw) | 0; + + var __japgolly__hook3 = $i_react.useContext((props.a | 0, this.Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_ctx.Ljapgolly_scalajs_react_feature_Context$$anon$3__f_raw)) | 0; + + $i_react.useDebugValue(null, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$25 => { + if (_$25 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + return "aaaaa"; + })); + props.a; + $i_react.useDebugValue(null, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$25$2 => { + if (_$25$2 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + return 321654; + })); + $i_react.useDebugValue(null, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$25$3 => { + if (_$25$3 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + return 987; + })); + + var __japgolly__hook7_raw = $i_react.useReducer($j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$().fromFunction2__F2__sjs_js_Function2($p_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__add__I__F2(this, 0)), null, _$26 => { + if (_$26 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + return 100; + }); + + var __japgolly__hook7 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseReducer$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseReducer$().fromJs__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseReducer(__japgolly__hook7_raw); + + var $$x2 = $i_react; + var $$x1 = $j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$(); + var p = props.a | 0; + + var __japgolly__hook8_raw = $$x2.useReducer($$x1.fromFunction2__F2__sjs_js_Function2($p_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__add__I__F2(this, p)), null, _$26$2 => { + if (_$26$2 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + + var _$16 = props.a | 0; + + return (((_$16 + __japgolly__hook1 | 0) + __japgolly__hook2 | 0) + __japgolly__hook3 | 0) + (__japgolly__hook7.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0; + }); + + var __japgolly__hook8 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseReducer$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseReducer$().fromJs__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseReducer(__japgolly__hook8_raw); + + var props$3 = props.a; + + var __japgolly__hook9_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P5.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P5__O__O__O__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P5.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P5(), props$3, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3, __japgolly__hook7, __japgolly__hook8); + + var $$x4 = $i_react; + var $$x3 = $j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$(); + var this$7 = __japgolly__hook9_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P4__f_hook4; + + var __japgolly__hook9_raw = $$x4.useReducer($$x3.fromFunction2__F2__sjs_js_Function2($p_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__add__I__F2(this, this$7.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0)), null, _$26$3 => { + if (_$26$3 !== null) { + throw new $j_java$002elang$002eClassCastException.$c_jl_ClassCastException(); + } + + ; + var $$x6 = __japgolly__hook9_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + var this$8 = __japgolly__hook9_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P4__f_hook4; + var $$x5 = this$8.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0]; + var this$9 = __japgolly__hook9_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P5__f_hook5; + return (($$x6 | 0) + ($$x5 | 0) | 0) + (this$9.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0; + }); + + var __japgolly__hook9 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseReducer$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseReducer$().fromJs__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseReducer(__japgolly__hook9_raw); + + var __japgolly__hook10_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(123)); + + var __japgolly__hook10 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook10_raw); + + var __japgolly__hook11_raw = $i_react.useState(() => { + var $$x7 = $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$(); + var p$1 = props.a | 0; + return $$x7.apply__O__Ljapgolly_scalajs_react_internal_Box((p$1 + __japgolly__hook1 | 0) + (__japgolly__hook9.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0); + }); + + var __japgolly__hook11 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook11_raw); + + var props$4 = props.a; + + var __japgolly__hook12_ctx = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P8.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P8(props$4, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3, __japgolly__hook7, __japgolly__hook8, __japgolly__hook9, __japgolly__hook10, __japgolly__hook11); + + var __japgolly__hook12_raw = $i_react.useState(() => { + var $$x10 = $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$(); + var $$x9 = __japgolly__hook12_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + var $$x8 = __japgolly__hook12_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var this$11 = __japgolly__hook12_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P6__f_hook6; + return $$x10.apply__O__Ljapgolly_scalajs_react_internal_Box((($$x9 | 0) + ($$x8 | 0) | 0) + (this$11.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0); + }); + + var __japgolly__hook12 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook12_raw); + + var __japgolly__hook13_state = $i_react.useState(0); + + var __japgolly__hook13 = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().useForceUpdateRaw__sjs_js_Tuple2__Ljapgolly_scalajs_react_Reusable(__japgolly__hook13_state); + + props.a | 0; + var sum = (((((((__japgolly__hook1 + __japgolly__hook2 | 0) + __japgolly__hook3 | 0) + (__japgolly__hook7.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0) + (__japgolly__hook8.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0) + (__japgolly__hook9.Ljapgolly_scalajs_react_hooks_Hooks$UseReducer__f_raw[0] | 0) | 0) + (__japgolly__hook10.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook11.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (__japgolly__hook12.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0; + var this$16 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self = "div"; + var xs = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__hook13), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().reusableDefaultSync__F1())])); + var this$17 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$16, self, xs); + return this$17.rawElement__Ljapgolly_scalajs_react_facade_React$Element(); + }; + + _s(rawComponent, "3SdfNYeztHmjlpzAvh9HLOvumYA=", true); + + var $$x11 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$18 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_HooksTrivial$__f_Component = $$x11.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$18.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksTrivial$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksTrivial$", { + Ljapgolly_scalajs_react_test_emissions_HooksTrivial$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksTrivial$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxFn-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxFn-out2.js new file mode 100644 index 000000000..a59ef8c53 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxFn-out2.js @@ -0,0 +1,94 @@ +'use strict'; + +var _s = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024 from "./japgolly.scalajs.react.PropsChildren$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF from "./japgolly.scalajs.react.hooks.Hooks$UseStateF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement from "./japgolly.scalajs.react.vdom.VdomElement.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eWrappedVarArgs from "./scala.scalajs.runtime.WrappedVarArgs.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$() { + this.Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$().japgolly$scalajs$react$test$emissions$HooksWithChildrenCtxFn$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$.prototype; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$.prototype.japgolly$scalajs$react$test$emissions$HooksWithChildrenCtxFn$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + + var __japgolly__hook1_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(123); + }); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + + var sum = ((props.a | 0) + (__japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$().count$extension__sjs_js_Any__I(children) | 0; + var $$x1 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1("Sum = ")), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook1); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$1$2 => { + var x$1 = x$1$2 | 0; + return 1 + x$1 | 0; + })).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children))]; + var this$16 = $$x1.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + return $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement.$f_Ljapgolly_scalajs_react_vdom_VdomElement__rawNode__sjs_js_$bar(this$16); +}, "nfv15B7PjZ4t48VEMZ2SuYrvgqI="); +var $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksWithChildrenCtxFn$", { + Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxFn-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxFn-out3.js new file mode 100644 index 000000000..91f09a828 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxFn-out3.js @@ -0,0 +1,96 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024 from "./japgolly.scalajs.react.PropsChildren$package$PropsChildren$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF from "./japgolly.scalajs.react.hooks.Hooks$UseStateF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite from "./japgolly.scalajs.react.vdom.TagLite.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagMod from "./japgolly.scalajs.react.vdom.TagMod.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$() { + var _s = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ = this; + + var rawComponent = props => { + _s(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props); + + var __japgolly__hook1_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(123)); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + + var p = props.a | 0; + var sum = (p + (__japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + ($i_react.Children.count(children) | 0) | 0; + var this$13 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self = "button"; + var xs = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1("Sum = ")), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook1); + var ev$1 = r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$1 => { + var _$1$1 = _$1 | 0; + + return 1 + _$1$1 | 0; + })); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$1 === null ? null : ev$1.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children))])); + var this$14 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$13, self, xs); + return this$14.rawElement__Ljapgolly_scalajs_react_facade_React$Element(); + }; + + _s(rawComponent, "5jozhEwtxvMwDXdJFU53ltHZ+8U="); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$15 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$15.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksWithChildrenCtxFn$", { + Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxFn$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxObj-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxObj-out2.js new file mode 100644 index 000000000..81a0ed815 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxObj-out2.js @@ -0,0 +1,75 @@ +'use strict'; + +var _s = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024 from "./japgolly.scalajs.react.PropsChildren$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$() { + this.Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$().japgolly$scalajs$react$test$emissions$HooksWithChildrenCtxObj$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$.prototype; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$.prototype.japgolly$scalajs$react$test$emissions$HooksWithChildrenCtxObj$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + + var __japgolly__hook1_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(123); + }); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + + var props$1 = props.a; + var sum = ((props$1 | 0) + (__japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$().count$extension__sjs_js_Any__I(children) | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; +}, "hmdkt3mZsFWuMhW4QTMYhjqDiVQ="); +var $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksWithChildrenCtxObj$", { + Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxObj-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxObj-out3.js new file mode 100644 index 000000000..414dc311c --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithChildrenCtxObj-out3.js @@ -0,0 +1,70 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024 from "./japgolly.scalajs.react.PropsChildren$package$PropsChildren$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$() { + var _s = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ = this; + + var rawComponent = props => { + _s(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props); + + var __japgolly__hook1_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(123)); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + + var props$1 = props.a; + var sum = ((props$1 | 0) + (__japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + ($i_react.Children.count(children) | 0) | 0; + return ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; + }; + + _s(rawComponent, "5jozhEwtxvMwDXdJFU53ltHZ+8U="); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$6.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksWithChildrenCtxObj$", { + Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksWithChildrenCtxObj$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithJsFns-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithJsFns-out2.js new file mode 100644 index 000000000..cc675eb74 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithJsFns-out2.js @@ -0,0 +1,157 @@ +'use strict'; + +var _s = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF from "./japgolly.scalajs.react.hooks.Hooks$UseStateF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode from "./japgolly.scalajs.react.vdom.VdomNode.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002ejs$002eAny$0024 from "./scala.scalajs.js.Any$.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eWrappedVarArgs from "./scala.scalajs.runtime.WrappedVarArgs.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__jsState1__sjs_js_Function2($thiz) { + return (arg1$2, arg2$2) => { + var arg1 = arg1$2 | 0; + var arg2 = arg2$2; + return $m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$().japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$jsState1$1__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__I(arg1, arg2); + }; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__jsState1__sjs_js_Function2 }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__render__sjs_js_Function4($thiz) { + return (arg1$2, arg2$2, arg3$2, arg4$2) => { + var arg1 = arg1$2 | 0; + var arg2 = arg2$2; + var arg3 = arg3$2; + var arg4 = arg4$2; + return $m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$().japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$render$1__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_vdom_VdomNode(arg1, arg2, arg3, arg4); + }; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__render__sjs_js_Function4 }; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$() { + this.Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__f_jsState2 = null; + this.Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ = this; + + this.Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__f_jsState2 = arg1$2 => { + var arg1 = arg1$2; + return $m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$().japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$jsState2$1__Ljapgolly_scalajs_react_hooks_HookCtx$P2__I(arg1); + }; + + var rawComponent = arg1$2$1 => $m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$().japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$1); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype.japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$jsState1$1__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__I = function (x$1, x$2) { + return x$1 + (x$2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0; +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype.japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$jsState2$1__Ljapgolly_scalajs_react_hooks_HookCtx$P2__I = function (δ) { + var $$x2 = δ.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + var this$1 = δ.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var $$x1 = this$1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0]; + var this$2 = δ.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + return (($$x2 | 0) + ($$x1 | 0) | 0) + (this$2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0; +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype.japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$render$1__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_vdom_VdomNode = function (p, s1, s2, s3) { + var sum = ((p + (s1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (s2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (s3.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0; + var $$x1 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1("Sum = ")), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(s1); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$3$2 => { + var x$3 = x$3$2 | 0; + return 1 + x$3 | 0; + })).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + return $$x1.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype.japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$Component$3__Ljapgolly_scalajs_react_internal_Box__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_internal_Box = function (props$1, __japgolly__hook1$1) { + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$().toFunction2__sjs_js_Function2__F2($p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__jsState1__sjs_js_Function2($m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$())).apply__O__O__O(props$1.a, __japgolly__hook1$1)); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype.japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$Component$4__Ljapgolly_scalajs_react_hooks_HookCtx$P2__Ljapgolly_scalajs_react_internal_Box = function (__japgolly__hook3_ctx$1) { + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$().toFunction1__sjs_js_Function1__F1($m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$().Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__f_jsState2).apply__O__O(__japgolly__hook3_ctx$1)); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype.japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var __japgolly__hook1_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(($m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$(), 123)); + }); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + + var __japgolly__hook2_raw = $i_react.useState(() => $m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$().japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$Component$3__Ljapgolly_scalajs_react_internal_Box__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_internal_Box(props, __japgolly__hook1)); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var props$1 = props.a; + + var __japgolly__hook3_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__hook3_raw = $i_react.useState(() => $m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$().japgolly$scalajs$react$test$emissions$HooksWithJsFns$$$anonfun$Component$4__Ljapgolly_scalajs_react_hooks_HookCtx$P2__Ljapgolly_scalajs_react_internal_Box(__japgolly__hook3_ctx)); + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook3_raw); + + return $j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$().toFunction4__sjs_js_Function4__F4($p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__render__sjs_js_Function4($m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$())).apply__O__O__O__O__O(props.a, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3).rawNode__sjs_js_$bar(); +}, "bYmfixlBDAOCGTWfjyExliA5/bY="); +var $d_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksWithJsFns$", { + Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithJsFns-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithJsFns-out3.js new file mode 100644 index 000000000..2d9bb131f --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithJsFns-out3.js @@ -0,0 +1,139 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF from "./japgolly.scalajs.react.hooks.Hooks$UseStateF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite from "./japgolly.scalajs.react.vdom.TagLite.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagMod from "./japgolly.scalajs.react.vdom.TagMod.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode from "./japgolly.scalajs.react.vdom.VdomNode.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002ejs$002eAny$0024 from "./scala.scalajs.js.Any$.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__jsState1__sjs_js_Function2($thiz) { + return (_$1, _$2) => { + var _$1$1 = _$1 | 0; + + var _$2$1 = _$2; + return _$1$1 + (_$2$1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0; + }; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__jsState1__sjs_js_Function2 }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__render__sjs_js_Function4($thiz) { + return (p, s1, s2, s3) => { + var p$1 = p | 0; + var s1$1 = s1; + var s2$1 = s2; + var s3$1 = s3; + var sum = ((p$1 + (s1$1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (s2$1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (s3$1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0; + var this$9 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self = "button"; + var xs = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1("Sum = ")), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(s1$1); + var ev$1 = r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$3 => { + var _$3$1 = _$3 | 0; + + return 1 + _$3$1 | 0; + })); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$1 === null ? null : ev$1.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$9, self, xs); + }; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__render__sjs_js_Function4 }; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$() { + var _s = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__f_jsState2 = null; + this.Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ = this; + + this.Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__f_jsState2 = δ => { + var δ$1 = δ; + var $$x2 = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + var this$2 = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var $$x1 = this$2.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0]; + var this$3 = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + return (($$x2 | 0) + ($$x1 | 0) | 0) + (this$3.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0; + }; + + var rawComponent = props => { + _s(); + + var __japgolly__hook1_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(123)); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + + var __japgolly__hook2_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$().toFunction2__sjs_js_Function2__F2($p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__jsState1__sjs_js_Function2(this)).apply__O__O__O(props.a, __japgolly__hook1))); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var props$1 = props.a; + + var __japgolly__hook3_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__hook3_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$().toFunction1__sjs_js_Function1__F1(this.Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__f_jsState2).apply__O__O(__japgolly__hook3_ctx))); + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook3_raw); + + return $j_scala$002escalajs$002ejs$002eAny$0024.$m_sjs_js_Any$().toFunction4__sjs_js_Function4__F4($p_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__render__sjs_js_Function4(this)).apply__O__O__O__O__O(props.a, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3).rawNode__O(); + }; + + _s(rawComponent, "3lIf5hg6fCL6+CfO6zF6TbnM+6M="); + + var $$x3 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$5 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$__f_Component = $$x3.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$5.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksWithJsFns$", { + Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksWithJsFns$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithScalaFns-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithScalaFns-out2.js new file mode 100644 index 000000000..3b916148d --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithScalaFns-out2.js @@ -0,0 +1,151 @@ +'use strict'; + +var _s = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF from "./japgolly.scalajs.react.hooks.Hooks$UseStateF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement from "./japgolly.scalajs.react.vdom.VdomElement.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction4 from "./scala.scalajs.runtime.AnonFunction4.js"; +import * as $j_scala$002escalajs$002eruntime$002eWrappedVarArgs from "./scala.scalajs.runtime.WrappedVarArgs.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__state1__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__I($thiz, p, s) { + return p + (s.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__state1__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__I }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__render__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_vdom_TagOf($thiz, p, s1, s2, s3, s4) { + var sum = (((p + (s1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (s2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (s3.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (s4.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0; + var $$x1 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1("Sum = ")), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(s1); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$5$2 => { + var x$5 = x$5$2 | 0; + return 1 + x$5 | 0; + })).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + return $$x1.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__render__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_vdom_TagOf }; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$() { + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state2 = null; + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state3 = null; + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ = this; + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state2 = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(δ$2 => { + var δ = δ$2; + var $$x2 = δ.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + var this$2 = δ.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var $$x1 = this$2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0]; + var this$3 = δ.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + return (($$x2 | 0) + ($$x1 | 0) | 0) + (this$3.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0; + }); + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state3 = new $j_scala$002escalajs$002eruntime$002eAnonFunction4.$c_sjsr_AnonFunction4((x$1$2, x$2$2, x$3$2, x$4$2) => { + var x$1 = x$1$2 | 0; + var x$2 = x$2$2; + var x$3 = x$3$2; + var x$4 = x$4$2; + return ((x$1 + (x$2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (x$3.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0) + (x$4.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0; + }); + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$().japgolly$scalajs$react$test$emissions$HooksWithScalaFns$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x3 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_Component = $$x3.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$4.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype.japgolly$scalajs$react$test$emissions$HooksWithScalaFns$$$anonfun$Component$3__Ljapgolly_scalajs_react_internal_Box__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_internal_Box = function (props$1, __japgolly__hook1$1) { + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__state1__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__I($m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$(), props$1.a | 0, __japgolly__hook1$1)); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype.japgolly$scalajs$react$test$emissions$HooksWithScalaFns$$$anonfun$Component$4__Ljapgolly_scalajs_react_hooks_HookCtx$P2__Ljapgolly_scalajs_react_internal_Box = function (__japgolly__hook3_ctx$1) { + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$().Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state2.apply__O__O(__japgolly__hook3_ctx$1)); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype.japgolly$scalajs$react$test$emissions$HooksWithScalaFns$$$anonfun$Component$5__Ljapgolly_scalajs_react_internal_Box__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_internal_Box = function (props$1, __japgolly__hook1$1, __japgolly__hook2$1, __japgolly__hook3$1) { + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$().Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state3.apply__O__O__O__O__O(props$1.a, __japgolly__hook1$1, __japgolly__hook2$1, __japgolly__hook3$1)); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype.japgolly$scalajs$react$test$emissions$HooksWithScalaFns$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var __japgolly__hook1_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(($m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$(), 123)); + }); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + + var __japgolly__hook2_raw = $i_react.useState(() => $m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$().japgolly$scalajs$react$test$emissions$HooksWithScalaFns$$$anonfun$Component$3__Ljapgolly_scalajs_react_internal_Box__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_internal_Box(props, __japgolly__hook1)); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var props$1 = props.a; + + var __japgolly__hook3_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__hook3_raw = $i_react.useState(() => $m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$().japgolly$scalajs$react$test$emissions$HooksWithScalaFns$$$anonfun$Component$4__Ljapgolly_scalajs_react_hooks_HookCtx$P2__Ljapgolly_scalajs_react_internal_Box(__japgolly__hook3_ctx)); + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook3_raw); + + var __japgolly__hook4_raw = $i_react.useState(() => $m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$().japgolly$scalajs$react$test$emissions$HooksWithScalaFns$$$anonfun$Component$5__Ljapgolly_scalajs_react_internal_Box__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_internal_Box(props, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3)); + + var __japgolly__hook4 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook4_raw); + + var this$3 = $p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__render__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_vdom_TagOf($m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$(), props.a | 0, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3, __japgolly__hook4); + return $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement.$f_Ljapgolly_scalajs_react_vdom_VdomElement__rawNode__sjs_js_$bar(this$3); +}, "X1beusEtCU9hbnswQsd+LhtRPXk="); +var $d_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksWithScalaFns$", { + Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithScalaFns-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithScalaFns-out3.js new file mode 100644 index 000000000..d0de0ec9a --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/HooksWithScalaFns-out3.js @@ -0,0 +1,145 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF from "./japgolly.scalajs.react.hooks.Hooks$UseStateF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite from "./japgolly.scalajs.react.vdom.TagLite.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagMod from "./japgolly.scalajs.react.vdom.TagMod.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction4 from "./scala.scalajs.runtime.AnonFunction4.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__state1__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__I($thiz, p, s) { + return p + (s.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__state1__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__I }; + +function $p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__render__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_vdom_TagOf($thiz, p, s1, s2, s3, s4) { + var sum = (((p + (s1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (s2.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (s3.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (s4.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0; + var this$9 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self = "button"; + var xs = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1("Sum = ")), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(s1); + var ev$1 = r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$5 => { + var _$5$1 = _$5 | 0; + + return 1 + _$5$1 | 0; + })); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$1 === null ? null : ev$1.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$9, self, xs); +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__render__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_vdom_TagOf }; + +function $c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$() { + var _s = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state2 = null; + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state3 = null; + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ = this; + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state2 = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(δ => { + var δ$1 = δ; + var $$x2 = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + var this$2 = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var $$x1 = this$2.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0]; + var this$3 = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + return (($$x2 | 0) + ($$x1 | 0) | 0) + (this$3.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0; + }); + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state3 = new $j_scala$002escalajs$002eruntime$002eAnonFunction4.$c_sjsr_AnonFunction4((_$1, _$2, _$3, _$4) => { + var _$1$1 = _$1 | 0; + + var _$2$1 = _$2; + var _$3$1 = _$3; + var _$4$1 = _$4; + return ((_$1$1 + (_$2$1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (_$3$1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0) + (_$4$1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0; + }); + + var rawComponent = props => { + _s(); + + var __japgolly__hook1_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(123)); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + + var __japgolly__hook2_raw = $i_react.useState(() => { + var $$x3 = $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$(); + var p = props.a | 0; + return $$x3.apply__O__Ljapgolly_scalajs_react_internal_Box($p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__state1__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__I(this, p, __japgolly__hook1)); + }); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var props$1 = props.a; + + var __japgolly__hook3_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__hook3_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state2.apply__O__O(__japgolly__hook3_ctx))); + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook3_raw); + + var __japgolly__hook4_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_state3.apply__O__O__O__O__O(props.a, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3))); + + var __japgolly__hook4 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook4_raw); + + var p$1 = props.a | 0; + var this$5 = $p_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__render__I__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_vdom_TagOf(this, p$1, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3, __japgolly__hook4); + return this$5.rawElement__Ljapgolly_scalajs_react_facade_React$Element(); + }; + + _s(rawComponent, "vpNeieHdeSB/R+el2k5JlSwMbWI="); + + var $$x4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$__f_Component = $$x4.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$6.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$; + +function $h_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ }; +$h_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$: 0 +}, false, "japgolly.scalajs.react.test.emissions.HooksWithScalaFns$", { + Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ }; +$c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$; +var $n_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$; + +function $m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$) { + $n_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ = new $c_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_HooksWithScalaFns$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsChildrenViaHookApi-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsChildrenViaHookApi-out2.js new file mode 100644 index 000000000..9617d0dd8 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsChildrenViaHookApi-out2.js @@ -0,0 +1,61 @@ +'use strict'; + +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024 from "./japgolly.scalajs.react.PropsChildren$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$() { + this.Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$().japgolly$scalajs$react$test$emissions$JustPropsChildrenViaHookApi$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ }; +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$; + +function $h_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ }; +$h_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$.prototype.japgolly$scalajs$react$test$emissions$JustPropsChildrenViaHookApi$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = function (props) { + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + var sum = (props.a | 0) + $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$().count$extension__sjs_js_Any__I(children) | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; +}; + +var $d_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$: 0 +}, false, "japgolly.scalajs.react.test.emissions.JustPropsChildrenViaHookApi$", { + Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ }; +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$; +var $n_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$; + +function $m_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$) { + $n_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ = new $c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsChildrenViaHookApi-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsChildrenViaHookApi-out3.js new file mode 100644 index 000000000..4bf4cd35e --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsChildrenViaHookApi-out3.js @@ -0,0 +1,57 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024 from "./japgolly.scalajs.react.PropsChildren$package$PropsChildren$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$() { + this.Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ = this; + + var rawComponent = props => { + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props); + var p = props.a | 0; + var sum = p + ($i_react.Children.count(children) | 0) | 0; + return ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; + }; + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$5 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$5.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ }; +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$; + +function $h_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ }; +$h_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$: 0 +}, false, "japgolly.scalajs.react.test.emissions.JustPropsChildrenViaHookApi$", { + Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ }; +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$; +var $n_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$; + +function $m_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$) { + $n_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ = new $c_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_JustPropsChildrenViaHookApi$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsViaHookApi-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsViaHookApi-out2.js new file mode 100644 index 000000000..9c8e252bb --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsViaHookApi-out2.js @@ -0,0 +1,59 @@ +'use strict'; + +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$() { + this.Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$().japgolly$scalajs$react$test$emissions$JustPropsViaHookApi$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ }; +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$; + +function $h_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ }; +$h_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$.prototype.japgolly$scalajs$react$test$emissions$JustPropsViaHookApi$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = function (props) { + var magicNumber = 654 + (props.a | 0) | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(magicNumber).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; +}; + +var $d_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$: 0 +}, false, "japgolly.scalajs.react.test.emissions.JustPropsViaHookApi$", { + Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ }; +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$; +var $n_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$; + +function $m_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$) { + $n_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ = new $c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsViaHookApi-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsViaHookApi-out3.js new file mode 100644 index 000000000..934e8636e --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/JustPropsViaHookApi-out3.js @@ -0,0 +1,54 @@ +'use strict'; + +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$() { + this.Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ = this; + + var rawComponent = props => { + var p = props.a | 0; + var magicNumber = 654 + p | 0; + return ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(magicNumber)).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; + }; + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$4.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ }; +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$; + +function $h_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ }; +$h_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$: 0 +}, false, "japgolly.scalajs.react.test.emissions.JustPropsViaHookApi$", { + Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ }; +$c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$; +var $n_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$; + +function $m_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$) { + $n_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ = new $c_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_JustPropsViaHookApi$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderReusable-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderReusable-out2.js new file mode 100644 index 000000000..e2595c5af --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderReusable-out2.js @@ -0,0 +1,455 @@ +'use strict'; + +var _s = $RefreshSig$(), + _s2 = $RefreshSig$(), + _s3 = $RefreshSig$(), + _s4 = $RefreshSig$(), + _s5 = $RefreshSig$(), + _s6 = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Children from "./japgolly.scalajs.react.CtorType$Children.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Nullary from "./japgolly.scalajs.react.CtorType$Nullary.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Props from "./japgolly.scalajs.react.CtorType$Props.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024PropsAndChildren from "./japgolly.scalajs.react.CtorType$PropsAndChildren.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF from "./japgolly.scalajs.react.NonEmptyRef$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren from "./japgolly.scalajs.react.PropsChildren.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024 from "./japgolly.scalajs.react.Ref$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024FullF from "./japgolly.scalajs.react.Ref$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusability from "./japgolly.scalajs.react.Reusability.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable from "./japgolly.scalajs.react.Reusable.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eGeneric$0024UnmountedRaw from "./japgolly.scalajs.react.component.Generic$UnmountedRaw.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseCallbackArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF from "./japgolly.scalajs.react.hooks.Hooks$UseRefF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024 from "./japgolly.scalajs.react.internal.ShouldComponentUpdateComponent$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI from "./japgolly.scalajs.react.test.emissions.PI.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024 from "./japgolly.scalajs.react.util.DefaultEffects$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomElement$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode from "./japgolly.scalajs.react.vdom.VdomNode.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_org$002escalajs$002edom$002eHTMLInputElement from "./org.scalajs.dom.HTMLInputElement.js"; +import * as $j_scala$002e$0024less$0024colon$0024less$0024 from "./scala.$less$colon$less$.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002eNone$0024 from "./scala.None$.js"; +import * as $j_scala$002eSome from "./scala.Some.js"; +import * as $j_scala$002ereflect$002eClassTag$0024GenericClassTag from "./scala.reflect.ClassTag$GenericClassTag.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eWrappedVarArgs from "./scala.scalajs.runtime.WrappedVarArgs.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$1__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline($thiz, e, s$2) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(s$2); + return r.value__O().apply__O__O(e.target.value).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$1__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$2__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline($thiz, e, __japgolly__hook2$2) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook2$2); + return r.value__O().apply__O__O(e.target.value).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$2__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$() { + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P_PC = null; + $n_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); + + var rawComponent$2 = arg1$2$1 => $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$CtxObj_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$1); + + var $$x2 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$2 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$1 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonN__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P = $$x2.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$2.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$2, s$1)); + + var rawComponent$3 = arg1$2$2 => $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$CtxFn_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$2); + + var $$x3 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$3 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$2 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P = $$x3.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$3.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$3, s$2)); + + var rawComponent$4 = arg1$2$3 => $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$3); + + var $$x4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$3 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P_PC = $$x4.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$4.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$4, s$3)); + + var rawComponent$5 = arg1$2$4 => $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$CtxObj_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$4); + + var $$x5 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$5 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$4 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P_PC = $$x5.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$5.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$5, s$4)); + + var rawComponent$6 = arg1$2$5 => $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$CtxFn_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$5); + + var $$x6 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$5 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P_PC = $$x6.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$6.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$6, s$5)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$; + +function $h_Ljapgolly_scalajs_react_test_emissions_RenderReusable$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ }; +$h_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.all__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot = function () { + return $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_ScalaFnComponent.apply__F1__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(p$2 => { + var p = p$2; + var $$x6 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var c = $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P; + var this$5 = c.ctor__Ljapgolly_scalajs_react_CtorType(); + var u = this$5.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p, this$5.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n = u.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x5 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n); + var c$1 = $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P; + var u$1 = c$1.ctor__Ljapgolly_scalajs_react_CtorType().apply__O(); + var n$1 = u$1.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x4 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$1); + var c$2 = $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P; + var this$12 = c$2.ctor__Ljapgolly_scalajs_react_CtorType(); + var u$2 = this$12.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p, this$12.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n$2 = u$2.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x3 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$2); + var c$3 = $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P_PC; + var this$21 = c$3.ctor__Ljapgolly_scalajs_react_CtorType(); + var array = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(1))]; + var children = new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array); + var u$3 = this$21.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_construct.apply__O__O__O__O(p, this$21.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_mods, children); + var n$3 = u$3.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x2 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$3); + var c$4 = $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P_PC; + var this$30 = c$4.ctor__Ljapgolly_scalajs_react_CtorType(); + var array$1 = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(2))]; + var children$1 = new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1); + var u$4 = this$30.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$30.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$1); + var n$4 = u$4.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x1 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$4); + var c$5 = $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$().Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P_PC; + var this$39 = c$5.ctor__Ljapgolly_scalajs_react_CtorType(); + var array$2 = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(3))]; + var children$2 = new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$2); + var u$5 = this$39.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$39.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$2); + var n$5 = u$5.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var array$3 = [$$x5, $$x4, $$x3, $$x2, $$x1, new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$5)]; + return $$x6.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$3)); + }), $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null))); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var $$x3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var $$x2 = $j_java$002elang$002eObject.$dp_toString__T(props.a); + var $$x1 = new $j_scala$002ereflect$002eClassTag$0024GenericClassTag.$c_s_reflect_ClassTag$GenericClassTag($j_java$002elang$002eObject.$d_T.getClassOf()); + var this$2 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps = $$x3.implicitly__O__s_reflect_ClassTag__F2__Ljapgolly_scalajs_react_Reusable($$x2, $$x1, this$2.by_$eq$eq__F2()).map__F1__Ljapgolly_scalajs_react_Reusable(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(v$2 => { + var v = v$2; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v); + })); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps, __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__sjs_js_$bar(); +}, "M/diGxSdMncUUNsduOrYE4sj5Xs="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$CtxObj_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s2(function (props) { + _s2(); + + var __japgolly__hook1_raw = $i_react.useRef(100); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook1 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook1_raw, this$2.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + var __japgolly__hook2_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(0); + }); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + props.a; + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var this$24 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var $$x5 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = __japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$UseRefF__f_raw.current | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x4 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v); + var $$x3 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var f = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$1$2 => { + var x$1 = x$1$2 | 0; + return 1 + x$1 | 0; + }); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF.$f_Ljapgolly_scalajs_react_NonEmptyRef$FullF__mod__F1__O(__japgolly__hook1, f).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var $$x2 = $$x3.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + var $$x1 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array$1 = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook2); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$2$2 => { + var x$2 = x$2$2 | 0; + return 1 + x$2 | 0; + })).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$2 = [$$x4, $$x2, $$x1.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1))]; + var a = $$x5.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$2)); + var $$x6 = this$24.const__O__Z__Ljapgolly_scalajs_react_Reusable(a, false); + var this$26 = $j_scala$002e$0024less$0024colon$0024less$0024.$m_s_$less$colon$less$(); + + var __japgolly__render_deps = $$x6.map__F1__Ljapgolly_scalajs_react_Reusable(this$26.s_$less$colon$less$__f_singleton); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps, __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__sjs_js_$bar(); +}, "u+poZOvMfQxaANVa/LUdcuqBd3I="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$CtxFn_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s3(function (props) { + _s3(); + + var __japgolly__hook1_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(20); + }); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + + var __japgolly__hook2_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var __japgolly__hook2_jscb = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_f$1.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline("asd", $j_scala$002eArray$0024.$m_sci_Nil$()))); + + var $$x1 = $i_react; + var a = []; + + var __japgolly__hook2_raw = $$x1.useCallback(__japgolly__hook2_jscb, a); + + var __japgolly__hook2 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_g$1.apply__O__O(__japgolly__hook2_raw); + + var __japgolly__hook3_state = $i_react.useState(0); + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().useForceUpdateRaw__sjs_js_Tuple2__Ljapgolly_scalajs_react_Reusable(__japgolly__hook3_state); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var this$28 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var $$x6 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = "P=" + props.a + ", S=" + __japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0]; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x5 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v); + var $$x4 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook1); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$3$2 => { + var x$3 = x$3$2 | 0; + return 1 + x$3 | 0; + })).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var $$x3 = $$x4.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + var $$x2 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array$1 = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$m_Ljapgolly_scalajs_react_callback_CallbackTo$().$greater$greater$extension__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline(($j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook2.value__O()).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline, ($j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook3.value__O()).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$2 = [$$x5, $$x3, $$x2.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1))]; + var a$1 = $$x6.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$2)); + var $$x7 = this$28.const__O__Z__Ljapgolly_scalajs_react_Reusable(a$1, false); + var this$30 = $j_scala$002e$0024less$0024colon$0024less$0024.$m_s_$less$colon$less$(); + + var __japgolly__render_deps = $$x7.map__F1__Ljapgolly_scalajs_react_Reusable(this$30.s_$less$colon$less$__f_singleton); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps, __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__sjs_js_$bar(); +}, "7yecI2L01YwM+MN3XxuDliv1kG0=", true); +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s4(function (props) { + _s4(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var this$11 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var $$x1 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = "P=" + props.a; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var array = [new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children))]; + var a = $$x1.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + var $$x2 = this$11.const__O__Z__Ljapgolly_scalajs_react_Reusable(a, true); + var this$13 = $j_scala$002e$0024less$0024colon$0024less$0024.$m_s_$less$colon$less$(); + + var __japgolly__render_deps = $$x2.map__F1__Ljapgolly_scalajs_react_Reusable(this$13.s_$less$colon$less$__f_singleton); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps, __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__sjs_js_$bar(); +}, "M/diGxSdMncUUNsduOrYE4sj5Xs="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$CtxObj_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s5(function (props) { + _s5(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + + var __japgolly__hook1_raw = $i_react.useRef(null); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw); + var ct = new $j_scala$002ereflect$002eClassTag$0024GenericClassTag.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$2, ct); + + var __japgolly__hook2_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x"); + }); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + props.a; + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var this$18 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var $$x2 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var $$x1 = $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002eSome.$c_s_Some(__japgolly__hook1)); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(__japgolly__hook2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e$2 => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$1__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline(this, e$2, __japgolly__hook2))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$1 = [$$x1.apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children))]; + var a = $$x2.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1)); + var $$x3 = this$18.const__O__Z__Ljapgolly_scalajs_react_Reusable(a, false); + var this$20 = $j_scala$002e$0024less$0024colon$0024less$0024.$m_s_$less$colon$less$(); + + var __japgolly__render_deps = $$x3.map__F1__Ljapgolly_scalajs_react_Reusable(this$20.s_$less$colon$less$__f_singleton); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps, __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__sjs_js_$bar(); +}, "VSjdwEEAcrMZYQ9UbK8I+017TI4="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.japgolly$scalajs$react$test$emissions$RenderReusable$$$anonfun$CtxFn_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s6(function (props) { + _s6(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + + var __japgolly__hook1_raw = $i_react.useRef(null); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw); + var ct = new $j_scala$002ereflect$002eClassTag$0024GenericClassTag.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$2, ct); + + var __japgolly__hook2_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x"); + }); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var this$17 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var $$x2 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var $$x1 = $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002eSome.$c_s_Some(__japgolly__hook1)); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(__japgolly__hook2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e$2 => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$2__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline(this, e$2, __japgolly__hook2))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$1 = [$$x1.apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children))]; + var a = $$x2.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1)); + var $$x3 = this$17.const__O__Z__Ljapgolly_scalajs_react_Reusable(a, false); + var this$19 = $j_scala$002e$0024less$0024colon$0024less$0024.$m_s_$less$colon$less$(); + + var __japgolly__render_deps = $$x3.map__F1__Ljapgolly_scalajs_react_Reusable(this$19.s_$less$colon$less$__f_singleton); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps, __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__sjs_js_$bar(); +}, "VSjdwEEAcrMZYQ9UbK8I+017TI4="); +var $d_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_RenderReusable$: 0 +}, false, "japgolly.scalajs.react.test.emissions.RenderReusable$", { + Ljapgolly_scalajs_react_test_emissions_RenderReusable$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_RenderReusable$; +var $n_Ljapgolly_scalajs_react_test_emissions_RenderReusable$; + +function $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_RenderReusable$) { + $n_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ = new $c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_RenderReusable$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderReusable-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderReusable-out3.js new file mode 100644 index 000000000..6fa521eed --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderReusable-out3.js @@ -0,0 +1,487 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Children from "./japgolly.scalajs.react.CtorType$Children.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Nullary from "./japgolly.scalajs.react.CtorType$Nullary.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Props from "./japgolly.scalajs.react.CtorType$Props.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024PropsAndChildren from "./japgolly.scalajs.react.CtorType$PropsAndChildren.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF from "./japgolly.scalajs.react.NonEmptyRef$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024 from "./japgolly.scalajs.react.PropsChildren$package$PropsChildren$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024 from "./japgolly.scalajs.react.Ref$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024FullF from "./japgolly.scalajs.react.Ref$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusability from "./japgolly.scalajs.react.Reusability.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable from "./japgolly.scalajs.react.Reusable.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024 from "./japgolly.scalajs.react.callback.Trampoline$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay from "./japgolly.scalajs.react.callback.Trampoline$Delay.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eGeneric$0024UnmountedRaw from "./japgolly.scalajs.react.component.Generic$UnmountedRaw.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseCallbackArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF from "./japgolly.scalajs.react.hooks.Hooks$UseRefF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024 from "./japgolly.scalajs.react.internal.ShouldComponentUpdateComponent$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI from "./japgolly.scalajs.react.test.emissions.PI.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024 from "./japgolly.scalajs.react.util.DefaultEffects$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite from "./japgolly.scalajs.react.vdom.TagLite.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagMod from "./japgolly.scalajs.react.vdom.TagMod.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagOf$0024RefArg$0024 from "./japgolly.scalajs.react.vdom.TagOf$RefArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomElement$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode from "./japgolly.scalajs.react.vdom.VdomNode.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_org$002escalajs$002edom$002eHTMLInputElement from "./org.scalajs.dom.HTMLInputElement.js"; +import * as $j_scala$002e$0024less$0024colon$0024less$0024 from "./scala.$less$colon$less$.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eCompat$0024 from "./scala.scalajs.runtime.Compat$.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$1__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline($thiz, s$2, e) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(s$2); + var ev$7 = r.value__O().apply__O__O(e.target.value); + return ev$7 === null ? null : ev$7.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$1__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline($thiz, __japgolly__hook2$2, e) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook2$2); + var ev$8 = r.value__O().apply__O__O(e.target.value); + return ev$8 === null ? null : ev$8.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$() { + var _s = $RefreshSig$(), + _s2 = $RefreshSig$(), + _s3 = $RefreshSig$(), + _s4 = $RefreshSig$(), + _s5 = $RefreshSig$(), + _s6 = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P_PC = null; + $n_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ = this; + var s$proxy1 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + + var rawComponent = props => { + _s(); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var p = props.a; + var $$x3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + + var $$x2 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$()._toString__s_Product__T(p); + + var $$x1 = new $j_scala$002eArray$0024.$c_s_reflect_ClassTag$GenericClassTag($j_java$002elang$002eObject.$d_T.getClassOf()); + var this$3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps = $$x3.implicitly__O__s_reflect_ClassTag__F2__Ljapgolly_scalajs_react_Reusable($$x2, $$x1, this$3.by_$eq$eq__F2()).map__F1__Ljapgolly_scalajs_react_Reusable(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(v => { + var v$1 = v; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v$1); + })); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps, __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__O(); + }; + + _s(rawComponent, "LqO7qddGnL/1O/Kyd3Xtp6x9iJE="); + + var $$x4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P = $$x4.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$6.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s$proxy1)); + var s$proxy2 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonN__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + + var rawComponent$2 = props$2 => { + _s2(); + + var __japgolly__hook1_raw = $i_react.useRef(100); + + var this$8 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook1 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook1_raw, this$8.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + var __japgolly__hook2_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(0)); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + props$2.a; + + var __japgolly__render_state_raw$1 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$1); + + var this$22 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var this$21 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$2 = "div"; + var $$x7 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v$2 = __japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$UseRefF__f_raw.current | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x6 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v$2); + var this$16 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self = "button"; + var xs = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var f = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$1 => { + var _$1$1 = _$1 | 0; + + return 1 + _$1$1 | 0; + }); + var ev$2 = $j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF.$f_Ljapgolly_scalajs_react_NonEmptyRef$FullF__mod__F1__O(__japgolly__hook1, f); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$2 === null ? null : ev$2.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var $$x5 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$16, self, xs); + var this$20 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$1 = "button"; + var xs$1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook2); + var ev$3 = r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$2 => { + var _$2$1 = _$2 | 0; + + return 1 + _$2$1 | 0; + })); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$3 === null ? null : ev$3.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var xs$2 = $$x7.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$$x6, $$x5, $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$20, self$1, xs$1)])); + var a = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$21, self$2, xs$2); + var $$x8 = this$22.const__O__Z__Ljapgolly_scalajs_react_Reusable(a, false); + var this$24 = $j_scala$002e$0024less$0024colon$0024less$0024.$m_s_$less$colon$less$(); + + var __japgolly__render_deps$1 = $$x8.map__F1__Ljapgolly_scalajs_react_Reusable(this$24.s_$less$colon$less$__f_singleton); + + var __japgolly__render_deps_state$1 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps$1, __japgolly__render_state$1, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$1.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state$1.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__O(); + }; + + _s2(rawComponent$2, "N81TqRKjoN5vKcxkXvqCldke0YU="); + + var $$x9 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$25 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P = $$x9.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$25.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$2, s$proxy2)); + + var rawComponent$3 = props$3 => { + _s3(); + + var __japgolly__hook1_raw$1 = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(20)); + + var __japgolly__hook1$1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw$1); + + var __japgolly__hook2_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var $$x10 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_f$1; + var optionalParams$proxy1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy7 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log("asd", ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy1)); + }); + + var __japgolly__hook2_jscb = $$x10.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy7)))); + + var __japgolly__hook2_raw$1 = $i_react.useCallback(__japgolly__hook2_jscb, []); + + var __japgolly__hook2$1 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_g$1.apply__O__O(__japgolly__hook2_raw$1); + + var __japgolly__hook3_state = $i_react.useState(0); + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().useForceUpdateRaw__sjs_js_Tuple2__Ljapgolly_scalajs_react_Reusable(__japgolly__hook3_state); + + var __japgolly__render_state_raw$2 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$2); + + var p$1 = props$3.a; + var this$43 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var this$42 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$5 = "div"; + var $$x14 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v$3 = "P=" + p$1 + ", S=" + __japgolly__hook1$1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0]; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x13 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v$3); + var this$36 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$3 = "button"; + var xs$3 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r$1 = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook1$1); + var ev$4 = r$1.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$3 => { + var _$3$1 = _$3 | 0; + + return 1 + _$3$1 | 0; + })); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$4 === null ? null : ev$4.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var $$x12 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$36, self$3, xs$3); + var this$41 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$4 = "button"; + var xs$4 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + + var ev$5 = __japgolly__hook2$1.value__O(); + + var ev$1 = ev$5 === null ? null : ev$5.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; + var $$x11 = $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$m_Ljapgolly_scalajs_react_callback_CallbackTo$(); + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + + var ev$6 = __japgolly__hook3.value__O(); + + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($$x11.$greater$greater$extension__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline(ev$1, ev$6 === null ? null : ev$6.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline)); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var xs$5 = $$x14.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$$x13, $$x12, $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$41, self$4, xs$4)])); + var a$1 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$42, self$5, xs$5); + var $$x15 = this$43.const__O__Z__Ljapgolly_scalajs_react_Reusable(a$1, false); + var this$45 = $j_scala$002e$0024less$0024colon$0024less$0024.$m_s_$less$colon$less$(); + + var __japgolly__render_deps$2 = $$x15.map__F1__Ljapgolly_scalajs_react_Reusable(this$45.s_$less$colon$less$__f_singleton); + + var __japgolly__render_deps_state$2 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps$2, __japgolly__render_state$2, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$2.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state$2.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__O(); + }; + + _s3(rawComponent$3, "FfFcmS/xahfGPO7v/c1S2fZHBQE=", true); + + var $$x16 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$46 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P = $$x16.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$46.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$3, s)); + + var rawComponent$4 = props$4 => { + _s4(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props$4); + + var __japgolly__render_state_raw$3 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$3); + + var p$2 = props$4.a; + var this$55 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var this$54 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$6 = "div"; + var $$x17 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v$4 = "P=" + p$2; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var xs$6 = $$x17.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v$4), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children))])); + var a$2 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$54, self$6, xs$6); + var $$x18 = this$55.const__O__Z__Ljapgolly_scalajs_react_Reusable(a$2, true); + var this$57 = $j_scala$002e$0024less$0024colon$0024less$0024.$m_s_$less$colon$less$(); + + var __japgolly__render_deps$3 = $$x18.map__F1__Ljapgolly_scalajs_react_Reusable(this$57.s_$less$colon$less$__f_singleton); + + var __japgolly__render_deps_state$3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps$3, __japgolly__render_state$3, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$3.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state$3.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__O(); + }; + + _s4(rawComponent$4, "L1iPDI2WUeUZjh7Tn4FDlDqxBDc="); + + var $$x19 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$58 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$1 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P_PC = $$x19.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$58.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$4, s$1)); + var s$proxy7 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + + var rawComponent$5 = props$5 => { + _s5(); + + var children$1 = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props$5); + + var __japgolly__hook1_raw$2 = $i_react.useRef(null); + + var this$60 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw$2); + var ct = new $j_scala$002eArray$0024.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1$2 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$60, ct); + + var __japgolly__hook2_raw$2 = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x")); + + var __japgolly__hook2$2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw$2); + + props$5.a; + + var __japgolly__render_state_raw$4 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$4 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$4); + + var this$68 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var this$67 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$7 = "div"; + var xs$7 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf($j_japgolly$002escalajs$002ereact$002evdom$002eTagOf$0024RefArg$0024.$m_Ljapgolly_scalajs_react_vdom_TagOf$RefArg$().set__Ljapgolly_scalajs_react_Ref$SetF__s_Option(__japgolly__hook1$2)).apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf($j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(__japgolly__hook2$2.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$1__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline(this, __japgolly__hook2$2, e))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]))), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children$1))])); + var a$3 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$67, self$7, xs$7); + var $$x20 = this$68.const__O__Z__Ljapgolly_scalajs_react_Reusable(a$3, false); + var this$70 = $j_scala$002e$0024less$0024colon$0024less$0024.$m_s_$less$colon$less$(); + + var __japgolly__render_deps$4 = $$x20.map__F1__Ljapgolly_scalajs_react_Reusable(this$70.s_$less$colon$less$__f_singleton); + + var __japgolly__render_deps_state$4 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps$4, __japgolly__render_state$4, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$4.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state$4.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__O(); + }; + + _s5(rawComponent$5, "Nb2f/gvbdXTWnKivh/RajIDKBbc="); + + var $$x21 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$71 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P_PC = $$x21.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$71.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$5, s$proxy7)); + + var rawComponent$6 = props$6$1 => { + _s6(); + + var children$2 = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props$6$1); + + var __japgolly__hook1_raw$3 = $i_react.useRef(null); + + var this$73 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw$3); + var ct$1 = new $j_scala$002eArray$0024.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1$3 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$73, ct$1); + + var __japgolly__hook2_raw$3 = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x")); + + var __japgolly__hook2$3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw$3); + + var __japgolly__render_state_raw$5 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$5); + + props$6$1.a; + var this$80 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var this$79 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$8 = "div"; + var xs$8 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf($j_japgolly$002escalajs$002ereact$002evdom$002eTagOf$0024RefArg$0024.$m_Ljapgolly_scalajs_react_vdom_TagOf$RefArg$().set__Ljapgolly_scalajs_react_Ref$SetF__s_Option(__japgolly__hook1$3)).apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf($j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(__japgolly__hook2$3.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e$1 => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderReusable$__onChange$2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline(this, __japgolly__hook2$3, e$1))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]))), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children$2))])); + var a$4 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$79, self$8, xs$8); + var $$x22 = this$80.const__O__Z__Ljapgolly_scalajs_react_Reusable(a$4, false); + var this$82 = $j_scala$002e$0024less$0024colon$0024less$0024.$m_s_$less$colon$less$(); + + var __japgolly__render_deps$5 = $$x22.map__F1__Ljapgolly_scalajs_react_Reusable(this$82.s_$less$colon$less$__f_singleton); + + var __japgolly__render_deps_state$5 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_deps$5, __japgolly__render_state$5, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2()); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$5.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => __japgolly__render_deps_state$5.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.value__O())).rawNode__O(); + }; + + _s6(rawComponent$6, "Q2EthKS++vBhx2pAlqNww9Pvaec="); + + var $$x23 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$83 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$2 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P_PC = $$x23.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$83.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$6, s$2)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$; + +function $h_Ljapgolly_scalajs_react_test_emissions_RenderReusable$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ }; +$h_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.all__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot = function () { + return $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_ScalaFnComponent.apply__F1__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(p => { + var p$1 = p; + var this$33 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self = "div"; + var $$x6 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + var c = this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P; + var this$5 = c.ctor__Ljapgolly_scalajs_react_CtorType(); + var u = this$5.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p$1, this$5.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n = u.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x5 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n); + var c$1 = this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P; + var u$1 = c$1.ctor__Ljapgolly_scalajs_react_CtorType().apply__O(); + var n$1 = u$1.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x4 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$1); + var c$2 = this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P; + var this$12 = c$2.ctor__Ljapgolly_scalajs_react_CtorType(); + var u$2 = this$12.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p$1, this$12.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n$2 = u$2.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x3 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$2); + var c$3 = this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_P_PC; + var this$18 = c$3.ctor__Ljapgolly_scalajs_react_CtorType(); + var children = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode.$d_Ljapgolly_scalajs_react_vdom_VdomNode.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(1))])); + var u$3 = this$18.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_construct.apply__O__O__O__O(p$1, this$18.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_mods, children); + var n$3 = u$3.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x2 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$3); + var c$4 = this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxObj_P_PC; + var this$24 = c$4.ctor__Ljapgolly_scalajs_react_CtorType(); + var children$1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode.$d_Ljapgolly_scalajs_react_vdom_VdomNode.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(2))])); + var u$4 = this$24.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$24.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$1); + var n$4 = u$4.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x1 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$4); + var c$5 = this.Ljapgolly_scalajs_react_test_emissions_RenderReusable$__f_CtxFn_P_PC; + var this$30 = c$5.ctor__Ljapgolly_scalajs_react_CtorType(); + var children$2 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode.$d_Ljapgolly_scalajs_react_vdom_VdomNode.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(3))])); + var u$5 = this$30.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$30.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$2); + var n$5 = u$5.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var xs = $$x6.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$$x5, $$x4, $$x3, $$x2, $$x1, new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$5)])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$33, self, xs); + }), $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null)); +}; + +var $d_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_RenderReusable$: 0 +}, false, "japgolly.scalajs.react.test.emissions.RenderReusable$", { + Ljapgolly_scalajs_react_test_emissions_RenderReusable$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_RenderReusable$; +var $n_Ljapgolly_scalajs_react_test_emissions_RenderReusable$; + +function $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_RenderReusable$) { + $n_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ = new $c_Ljapgolly_scalajs_react_test_emissions_RenderReusable$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_RenderReusable$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_RenderReusable$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuse-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuse-out2.js new file mode 100644 index 000000000..06dee4e31 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuse-out2.js @@ -0,0 +1,482 @@ +'use strict'; + +var _s = $RefreshSig$(), + _s2 = $RefreshSig$(), + _s3 = $RefreshSig$(), + _s4 = $RefreshSig$(), + _s5 = $RefreshSig$(), + _s6 = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Children from "./japgolly.scalajs.react.CtorType$Children.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Nullary from "./japgolly.scalajs.react.CtorType$Nullary.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Props from "./japgolly.scalajs.react.CtorType$Props.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024PropsAndChildren from "./japgolly.scalajs.react.CtorType$PropsAndChildren.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF from "./japgolly.scalajs.react.NonEmptyRef$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren from "./japgolly.scalajs.react.PropsChildren.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024 from "./japgolly.scalajs.react.Ref$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024FullF from "./japgolly.scalajs.react.Ref$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusability from "./japgolly.scalajs.react.Reusability.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable from "./japgolly.scalajs.react.Reusable.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eGeneric$0024UnmountedRaw from "./japgolly.scalajs.react.component.Generic$UnmountedRaw.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024 from "./japgolly.scalajs.react.hooks.HookCtx$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P1 from "./japgolly.scalajs.react.hooks.HookCtx$P1.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P3 from "./japgolly.scalajs.react.hooks.HookCtx$P3.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC0 from "./japgolly.scalajs.react.hooks.HookCtx$PC0.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC1 from "./japgolly.scalajs.react.hooks.HookCtx$PC1.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC2 from "./japgolly.scalajs.react.hooks.HookCtx$PC2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseCallbackArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF from "./japgolly.scalajs.react.hooks.Hooks$UseRefF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseStateF$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024 from "./japgolly.scalajs.react.internal.ShouldComponentUpdateComponent$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI from "./japgolly.scalajs.react.test.emissions.PI.js"; +import * as $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI$0024 from "./japgolly.scalajs.react.test.emissions.PI$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024 from "./japgolly.scalajs.react.util.DefaultEffects$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomElement$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_org$002escalajs$002edom$002eHTMLInputElement from "./org.scalajs.dom.HTMLInputElement.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002eNone$0024 from "./scala.None$.js"; +import * as $j_scala$002eSome from "./scala.Some.js"; +import * as $j_scala$002ereflect$002eClassTag$0024GenericClassTag from "./scala.reflect.ClassTag$GenericClassTag.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eWrappedVarArgs from "./scala.scalajs.runtime.WrappedVarArgs.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$1__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline($thiz, e, s$2) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(s$2); + return r.value__O().apply__O__O(e.target.value).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$1__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$2__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline($thiz, e, __japgolly__hook2$2) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook2$2); + return r.value__O().apply__O__O(e.target.value).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$2__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$() { + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P_PC = null; + $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); + + var rawComponent$2 = arg1$2$1 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$CtxObj_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$1); + + var $$x2 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$2 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$1 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonN__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P = $$x2.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$2.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$2, s$1)); + + var rawComponent$3 = arg1$2$2 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$CtxFn_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$2); + + var $$x3 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$3 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$2 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P = $$x3.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$3.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$3, s$2)); + + var rawComponent$4 = arg1$2$3 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$3); + + var $$x4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$3 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P_PC = $$x4.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$4.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$4, s$3)); + + var rawComponent$5 = arg1$2$4 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$CtxObj_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$4); + + var $$x5 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$5 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$4 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P_PC = $$x5.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$5.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$5, s$4)); + + var rawComponent$6 = arg1$2$5 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$CtxFn_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$5); + + var $$x6 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$5 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P_PC = $$x6.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$6.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$6, s$5)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$; + +function $h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ }; +$h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.all__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot = function () { + return $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_ScalaFnComponent.apply__F1__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(p$2 => { + var p = p$2; + var $$x6 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var c = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P; + var this$5 = c.ctor__Ljapgolly_scalajs_react_CtorType(); + var u = this$5.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p, this$5.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n = u.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x5 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n); + var c$1 = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P; + var u$1 = c$1.ctor__Ljapgolly_scalajs_react_CtorType().apply__O(); + var n$1 = u$1.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x4 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$1); + var c$2 = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P; + var this$12 = c$2.ctor__Ljapgolly_scalajs_react_CtorType(); + var u$2 = this$12.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p, this$12.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n$2 = u$2.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x3 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$2); + var c$3 = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P_PC; + var this$21 = c$3.ctor__Ljapgolly_scalajs_react_CtorType(); + var array = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(1))]; + var children = new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array); + var u$3 = this$21.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_construct.apply__O__O__O__O(p, this$21.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_mods, children); + var n$3 = u$3.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x2 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$3); + var c$4 = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P_PC; + var this$30 = c$4.ctor__Ljapgolly_scalajs_react_CtorType(); + var array$1 = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(2))]; + var children$1 = new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1); + var u$4 = this$30.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$30.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$1); + var n$4 = u$4.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x1 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$4); + var c$5 = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P_PC; + var this$39 = c$5.ctor__Ljapgolly_scalajs_react_CtorType(); + var array$2 = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(3))]; + var children$2 = new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$2); + var u$5 = this$39.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$39.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$2); + var n$5 = u$5.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var array$3 = [$$x5, $$x4, $$x3, $$x2, $$x1, new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$5)]; + return $$x6.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$3)); + }), $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null))); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(props.a, __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI$0024.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = $j_java$002elang$002eObject.$dp_toString__T(props.a); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v); + })).rawNode__sjs_js_$bar(); +}, "M/diGxSdMncUUNsduOrYE4sj5Xs="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$CtxObj_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s2(function (props) { + _s2(); + + var __japgolly__hook1_raw = $i_react.useRef(100); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook1 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook1_raw, this$2.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + var __japgolly__hook2_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(0); + }); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var props$1 = props.a; + + var __japgolly__render_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var $$x5 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x4 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var this$5 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x3 = this$5.always__F2(); + var $$x2 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().hooksUseRefF__F2(); + var $$x1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state = $$x5.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx, __japgolly__render_state, $$x4.reusabilityP2__F2__F2__F2__F2($$x3, $$x2, $$x1.reusability__F2__F2(this$6.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var ref = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var s = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + var $$x10 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = ref.Ljapgolly_scalajs_react_hooks_Hooks$UseRefF__f_raw.current | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x9 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v); + var $$x8 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var f = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$2$2 => { + var x$2 = x$2$2 | 0; + return 1 + x$2 | 0; + }); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF.$f_Ljapgolly_scalajs_react_NonEmptyRef$FullF__mod__F1__O(ref, f).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var $$x7 = $$x8.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + var $$x6 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array$1 = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(s); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$3$2 => { + var x$3 = x$3$2 | 0; + return 1 + x$3 | 0; + })).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$2 = [$$x9, $$x7, $$x6.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1))]; + return $$x10.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$2)); + })).rawNode__sjs_js_$bar(); +}, "friQwdICkQg3H/72a+tCGZH/4cE="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$CtxFn_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s3(function (props) { + _s3(); + + var __japgolly__hook1_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(20); + }); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + + var __japgolly__hook2_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var __japgolly__hook2_jscb = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_f$1.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline("asd", $j_scala$002eArray$0024.$m_sci_Nil$()))); + + var $$x1 = $i_react; + var a = []; + + var __japgolly__hook2_raw = $$x1.useCallback(__japgolly__hook2_jscb, a); + + var __japgolly__hook2 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_g$1.apply__O__O(__japgolly__hook2_raw); + + var __japgolly__hook3_state = $i_react.useState(0); + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().useForceUpdateRaw__sjs_js_Tuple2__Ljapgolly_scalajs_react_Reusable(__japgolly__hook3_state); + + var props$1 = props.a; + + var __japgolly__render_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P3.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P3__O__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P3.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P3(), props$1, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var $$x5 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x4 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var $$x3 = $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI$0024.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability; + var $$x2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$8 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state = $$x5.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx, __japgolly__render_state, $$x4.reusabilityP3__F2__F2__F2__F2__F2($$x3, $$x2.reusability__F2__F2(this$8.by_$eq$eq__F2()), $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2(), $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2())); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var $$x10 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = "P=" + props.a + ", S=" + __japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0]; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x9 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v); + var $$x8 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook1); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$4$2 => { + var x$4 = x$4$2 | 0; + return 1 + x$4 | 0; + })).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var $$x7 = $$x8.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + var $$x6 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array$1 = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$m_Ljapgolly_scalajs_react_callback_CallbackTo$().$greater$greater$extension__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline(($j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook2.value__O()).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline, ($j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook3.value__O()).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$2 = [$$x9, $$x7, $$x6.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1))]; + return $$x10.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$2)); + })).rawNode__sjs_js_$bar(); +}, "dBXhXgCZtz5vMCd4F2Oj0k+bIZo=", true); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s4(function (props) { + _s4(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + var props$1 = props.a; + + var __japgolly__render_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC0.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$PC0__O__sjs_js_Any__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC0.$c_Ljapgolly_scalajs_react_hooks_HookCtx$PC0(), props$1, children); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx, __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$().reusabilityPC0__F2__F2__F2($j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI$0024.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2())); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var $$x1 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = "P=" + props.a; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var array = [new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children))]; + return $$x1.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + })).rawNode__sjs_js_$bar(); +}, "M/diGxSdMncUUNsduOrYE4sj5Xs="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$CtxObj_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s5(function (props) { + _s5(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + + var __japgolly__hook1_raw = $i_react.useRef(null); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw); + var ct = new $j_scala$002ereflect$002eClassTag$0024GenericClassTag.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$2, ct); + + var __japgolly__hook2_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x"); + }); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var props$1 = props.a; + + var __japgolly__render_ctx = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$PC2(props$1, children, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var $$x6 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var this$5 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x4 = this$5.always__F2(); + var $$x3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2(); + var $$x2 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().refFullF__F2(); + var $$x1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state = $$x6.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx, __japgolly__render_state, $$x5.reusabilityPC2__F2__F2__F2__F2__F2($$x4, $$x3, $$x2, $$x1.reusability__F2__F2(this$6.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var c = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.Ljapgolly_scalajs_react_hooks_HookCtx$PC0__f_propsChildren; + var inputRef = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.Ljapgolly_scalajs_react_hooks_HookCtx$PC1__f_hook1; + var s = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.Ljapgolly_scalajs_react_hooks_HookCtx$PC2__f_hook2; + var $$x8 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var $$x7 = $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002eSome.$c_s_Some(inputRef)); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(s.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e$2 => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$1__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline(this, e$2, s))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$1 = [$$x7.apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(c))]; + return $$x8.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1)); + })).rawNode__sjs_js_$bar(); +}, "mdZWJ2Ot/KUCIZwAHIZGfXRzKCk="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuse$$$anonfun$CtxFn_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s6(function (props) { + _s6(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + + var __japgolly__hook1_raw = $i_react.useRef(null); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw); + var ct = new $j_scala$002ereflect$002eClassTag$0024GenericClassTag.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$2, ct); + + var __japgolly__hook2_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x"); + }); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var props$1 = props.a; + + var __japgolly__render_ctx = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$PC2(props$1, children, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var $$x6 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var this$5 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x4 = this$5.always__F2(); + var $$x3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2(); + var $$x2 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().refFullF__F2(); + var $$x1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state = $$x6.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx, __japgolly__render_state, $$x5.reusabilityPC2__F2__F2__F2__F2__F2($$x4, $$x3, $$x2, $$x1.reusability__F2__F2(this$6.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var $$x8 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var $$x7 = $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002eSome.$c_s_Some(__japgolly__hook1)); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(__japgolly__hook2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e$2 => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$2__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline(this, e$2, __japgolly__hook2))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$1 = [$$x7.apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children))]; + return $$x8.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1)); + })).rawNode__sjs_js_$bar(); +}, "mdZWJ2Ot/KUCIZwAHIZGfXRzKCk="); +var $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$: 0 +}, false, "japgolly.scalajs.react.test.emissions.RenderWithReuse$", { + Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$; +var $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$; + +function $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$) { + $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ = new $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuse-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuse-out3.js new file mode 100644 index 000000000..a72560cd8 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuse-out3.js @@ -0,0 +1,514 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Children from "./japgolly.scalajs.react.CtorType$Children.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Nullary from "./japgolly.scalajs.react.CtorType$Nullary.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Props from "./japgolly.scalajs.react.CtorType$Props.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024PropsAndChildren from "./japgolly.scalajs.react.CtorType$PropsAndChildren.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF from "./japgolly.scalajs.react.NonEmptyRef$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024 from "./japgolly.scalajs.react.PropsChildren$package$PropsChildren$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024 from "./japgolly.scalajs.react.Ref$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024FullF from "./japgolly.scalajs.react.Ref$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusability from "./japgolly.scalajs.react.Reusability.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable from "./japgolly.scalajs.react.Reusable.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024 from "./japgolly.scalajs.react.callback.Trampoline$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay from "./japgolly.scalajs.react.callback.Trampoline$Delay.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eGeneric$0024UnmountedRaw from "./japgolly.scalajs.react.component.Generic$UnmountedRaw.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024 from "./japgolly.scalajs.react.hooks.HookCtx$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P3 from "./japgolly.scalajs.react.hooks.HookCtx$P3.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC0 from "./japgolly.scalajs.react.hooks.HookCtx$PC0.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC2 from "./japgolly.scalajs.react.hooks.HookCtx$PC2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseCallbackArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF from "./japgolly.scalajs.react.hooks.Hooks$UseRefF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseStateF$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024 from "./japgolly.scalajs.react.internal.ShouldComponentUpdateComponent$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI from "./japgolly.scalajs.react.test.emissions.PI.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024 from "./japgolly.scalajs.react.util.DefaultEffects$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite from "./japgolly.scalajs.react.vdom.TagLite.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagMod from "./japgolly.scalajs.react.vdom.TagMod.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagOf$0024RefArg$0024 from "./japgolly.scalajs.react.vdom.TagOf$RefArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomElement$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode from "./japgolly.scalajs.react.vdom.VdomNode.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_org$002escalajs$002edom$002eHTMLInputElement from "./org.scalajs.dom.HTMLInputElement.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eCompat$0024 from "./scala.scalajs.runtime.Compat$.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$1__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline($thiz, s$2, e) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(s$2); + var ev$7 = r.value__O().apply__O__O(e.target.value); + return ev$7 === null ? null : ev$7.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$1__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline($thiz, __japgolly__hook2$4, e) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook2$4); + var ev$8 = r.value__O().apply__O__O(e.target.value); + return ev$8 === null ? null : ev$8.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$() { + var _s = $RefreshSig$(), + _s2 = $RefreshSig$(), + _s3 = $RefreshSig$(), + _s4 = $RefreshSig$(), + _s5 = $RefreshSig$(), + _s6 = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P_PC = null; + $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ = this; + + var rawComponent = props => { + _s(); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(props.a, __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var _$1 = props.a; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + + var v = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$()._toString__s_Product__T(_$1); + + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v); + })).rawNode__O(); + }; + + _s(rawComponent, "LqO7qddGnL/1O/Kyd3Xtp6x9iJE="); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$4.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); + + var rawComponent$2 = props$2 => { + _s2(); + + var __japgolly__hook1_raw = $i_react.useRef(100); + + var this$6 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook1 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook1_raw, this$6.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + var __japgolly__hook2_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(0)); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var props$1 = props$2.a; + + var __japgolly__render_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__render_state_raw$1 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$1); + + var $$x6 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var this$8 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x4 = this$8.Ljapgolly_scalajs_react_Reusability$__f_alwaysInstance; + var $$x3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().hooksUseRefF__F2(); + var $$x2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$9 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state$1 = $$x6.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx, __japgolly__render_state$1, $$x5.reusabilityP2__F2__F2__F2__F2($$x4, $$x3, $$x2.reusability__F2__F2(this$9.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$1.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var δ = __japgolly__render_deps_state$1.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + var ref = δ.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var s$1 = δ.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + var this$21 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$2 = "div"; + var $$x9 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v$1 = ref.Ljapgolly_scalajs_react_hooks_Hooks$UseRefF__f_raw.current | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x8 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v$1); + var this$16 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self = "button"; + var xs = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var f = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$2 => { + var _$2$1 = _$2 | 0; + + return 1 + _$2$1 | 0; + }); + var ev$2 = $j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF.$f_Ljapgolly_scalajs_react_NonEmptyRef$FullF__mod__F1__O(ref, f); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$2 === null ? null : ev$2.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var $$x7 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$16, self, xs); + var this$20 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$1 = "button"; + var xs$1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(s$1); + var ev$3 = r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$3 => { + var _$3$1 = _$3 | 0; + + return 1 + _$3$1 | 0; + })); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$3 === null ? null : ev$3.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var xs$2 = $$x9.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$$x8, $$x7, $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$20, self$1, xs$1)])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$21, self$2, xs$2); + })).rawNode__O(); + }; + + _s2(rawComponent$2, "N81TqRKjoN5vKcxkXvqCldke0YU="); + + var $$x10 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$22 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$2 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonN__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P = $$x10.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$22.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$2, s$2)); + + var rawComponent$3 = props$3 => { + _s3(); + + var __japgolly__hook1_raw$1 = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(20)); + + var __japgolly__hook1$1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw$1); + + var __japgolly__hook2_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var $$x11 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_f$1; + var optionalParams$proxy1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy7 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log("asd", ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy1)); + }); + + var __japgolly__hook2_jscb = $$x11.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy7)))); + + var __japgolly__hook2_raw$1 = $i_react.useCallback(__japgolly__hook2_jscb, []); + + var __japgolly__hook2$1 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_g$1.apply__O__O(__japgolly__hook2_raw$1); + + var __japgolly__hook3_state = $i_react.useState(0); + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().useForceUpdateRaw__sjs_js_Tuple2__Ljapgolly_scalajs_react_Reusable(__japgolly__hook3_state); + + var props$4 = props$3.a; + + var __japgolly__render_ctx$1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P3.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P3__O__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P3.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P3(), props$4, __japgolly__hook1$1, __japgolly__hook2$1, __japgolly__hook3); + + var __japgolly__render_state_raw$2 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$2); + + var $$x15 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x14 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var $$x13 = $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability; + var $$x12 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$27 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state$2 = $$x15.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx$1, __japgolly__render_state$2, $$x14.reusabilityP3__F2__F2__F2__F2__F2($$x13, $$x12.reusability__F2__F2(this$27.by_$eq$eq__F2()), $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2(), $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2())); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$2.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var p = props$3.a; + var this$41 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$5 = "div"; + var $$x19 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v$2 = "P=" + p + ", S=" + __japgolly__hook1$1.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0]; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x18 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v$2); + var this$35 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$3 = "button"; + var xs$3 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r$1 = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(__japgolly__hook1$1); + var ev$4 = r$1.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$4 => { + var _$4$1 = _$4 | 0; + + return 1 + _$4$1 | 0; + })); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$4 === null ? null : ev$4.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var $$x17 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$35, self$3, xs$3); + var this$40 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$4 = "button"; + var xs$4 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + + var ev$5 = __japgolly__hook2$1.value__O(); + + var ev$1 = ev$5 === null ? null : ev$5.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; + var $$x16 = $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$m_Ljapgolly_scalajs_react_callback_CallbackTo$(); + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + + var ev$6 = __japgolly__hook3.value__O(); + + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($$x16.$greater$greater$extension__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline(ev$1, ev$6 === null ? null : ev$6.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline)); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var xs$5 = $$x19.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$$x18, $$x17, $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$40, self$4, xs$4)])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$41, self$5, xs$5); + })).rawNode__O(); + }; + + _s3(rawComponent$3, "FfFcmS/xahfGPO7v/c1S2fZHBQE=", true); + + var $$x20 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$42 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$3 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P = $$x20.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$42.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$3, s$3)); + + var rawComponent$4 = props$4$1 => { + _s4(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props$4$1); + var props$5 = props$4$1.a; + + var __japgolly__render_ctx$2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC0.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$PC0__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC0.$c_Ljapgolly_scalajs_react_hooks_HookCtx$PC0(), props$5, children); + + var __japgolly__render_state_raw$3 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$3); + + var __japgolly__render_deps_state$3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx$2, __japgolly__render_state$3, $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$().reusabilityPC0__F2__F2__F2($j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2())); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$3.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var p$1 = props$4$1.a; + var this$51 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$6 = "div"; + var $$x21 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v$3 = "P=" + p$1; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var xs$6 = $$x21.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v$3), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children))])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$51, self$6, xs$6); + })).rawNode__O(); + }; + + _s4(rawComponent$4, "L1iPDI2WUeUZjh7Tn4FDlDqxBDc="); + + var $$x22 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$52 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$4 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P_PC = $$x22.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$52.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$4, s$4)); + + var rawComponent$5 = props$5$1 => { + _s5(); + + var children$1 = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props$5$1); + + var __japgolly__hook1_raw$2 = $i_react.useRef(null); + + var this$54 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw$2); + var ct = new $j_scala$002eArray$0024.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1$2 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$54, ct); + + var __japgolly__hook2_raw$2 = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x")); + + var __japgolly__hook2$2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw$2); + + var props$6 = props$5$1.a; + + var __japgolly__render_ctx$3 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$PC2(props$6, children$1, __japgolly__hook1$2, __japgolly__hook2$2); + + var __japgolly__render_state_raw$4 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$4 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$4); + + var $$x28 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x27 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var this$56 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x26 = this$56.Ljapgolly_scalajs_react_Reusability$__f_alwaysInstance; + var $$x25 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2(); + var $$x24 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().refFullF__F2(); + var $$x23 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$57 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state$4 = $$x28.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx$3, __japgolly__render_state$4, $$x27.reusabilityPC2__F2__F2__F2__F2__F2($$x26, $$x25, $$x24, $$x23.reusability__F2__F2(this$57.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$4.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var δ$1 = __japgolly__render_deps_state$4.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + var c = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$PC0__f_propsChildren; + var inputRef = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$PC1__f_hook1; + var s$5 = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$PC2__f_hook2; + var this$63 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$7 = "div"; + var xs$7 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf($j_japgolly$002escalajs$002ereact$002evdom$002eTagOf$0024RefArg$0024.$m_Ljapgolly_scalajs_react_vdom_TagOf$RefArg$().set__Ljapgolly_scalajs_react_Ref$SetF__s_Option(inputRef)).apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf($j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(s$5.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$1__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline(this, s$5, e))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]))), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(c))])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$63, self$7, xs$7); + })).rawNode__O(); + }; + + _s5(rawComponent$5, "Nb2f/gvbdXTWnKivh/RajIDKBbc="); + + var $$x29 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$64 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$6 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P_PC = $$x29.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$64.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$5, s$6)); + + var rawComponent$6 = props$6$1 => { + _s6(); + + var children$2 = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props$6$1); + + var __japgolly__hook1_raw$3 = $i_react.useRef(null); + + var this$66 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw$3); + var ct$1 = new $j_scala$002eArray$0024.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1$3 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$66, ct$1); + + var __japgolly__hook2_raw$3 = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x")); + + var __japgolly__hook2$3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw$3); + + var props$7 = props$6$1.a; + + var __japgolly__render_ctx$4 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$PC2(props$7, children$2, __japgolly__hook1$3, __japgolly__hook2$3); + + var __japgolly__render_state_raw$5 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$5); + + var $$x35 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x34 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var this$68 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x33 = this$68.Ljapgolly_scalajs_react_Reusability$__f_alwaysInstance; + var $$x32 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2(); + var $$x31 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().refFullF__F2(); + var $$x30 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$69 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state$5 = $$x35.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx$4, __japgolly__render_state$5, $$x34.reusabilityPC2__F2__F2__F2__F2__F2($$x33, $$x32, $$x31, $$x30.reusability__F2__F2(this$69.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$5.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + props$6$1.a; + var this$75 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$8 = "div"; + var xs$8 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf($j_japgolly$002escalajs$002ereact$002evdom$002eTagOf$0024RefArg$0024.$m_Ljapgolly_scalajs_react_vdom_TagOf$RefArg$().set__Ljapgolly_scalajs_react_Ref$SetF__s_Option(__japgolly__hook1$3)).apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf($j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(__japgolly__hook2$3.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e$1 => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__onChange$2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline(this, __japgolly__hook2$3, e$1))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]))), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(children$2))])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$75, self$8, xs$8); + })).rawNode__O(); + }; + + _s6(rawComponent$6, "Q2EthKS++vBhx2pAlqNww9Pvaec="); + + var $$x36 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$76 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$7 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P_PC = $$x36.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$76.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$6, s$7)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$; + +function $h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ }; +$h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.all__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot = function () { + return $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_ScalaFnComponent.apply__F1__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(p => { + var p$1 = p; + var this$33 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self = "div"; + var $$x6 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + var c = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P; + var this$5 = c.ctor__Ljapgolly_scalajs_react_CtorType(); + var u = this$5.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p$1, this$5.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n = u.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x5 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n); + var c$1 = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P; + var u$1 = c$1.ctor__Ljapgolly_scalajs_react_CtorType().apply__O(); + var n$1 = u$1.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x4 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$1); + var c$2 = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P; + var this$12 = c$2.ctor__Ljapgolly_scalajs_react_CtorType(); + var u$2 = this$12.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p$1, this$12.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n$2 = u$2.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x3 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$2); + var c$3 = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_P_PC; + var this$18 = c$3.ctor__Ljapgolly_scalajs_react_CtorType(); + var children = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode.$d_Ljapgolly_scalajs_react_vdom_VdomNode.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(1))])); + var u$3 = this$18.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_construct.apply__O__O__O__O(p$1, this$18.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_mods, children); + var n$3 = u$3.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x2 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$3); + var c$4 = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxObj_P_PC; + var this$24 = c$4.ctor__Ljapgolly_scalajs_react_CtorType(); + var children$1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode.$d_Ljapgolly_scalajs_react_vdom_VdomNode.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(2))])); + var u$4 = this$24.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$24.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$1); + var n$4 = u$4.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x1 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$4); + var c$5 = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$__f_CtxFn_P_PC; + var this$30 = c$5.ctor__Ljapgolly_scalajs_react_CtorType(); + var children$2 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode.$d_Ljapgolly_scalajs_react_vdom_VdomNode.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(3))])); + var u$5 = this$30.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$30.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$2); + var n$5 = u$5.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var xs = $$x6.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$$x5, $$x4, $$x3, $$x2, $$x1, new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$5)])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$33, self, xs); + }), $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null)); +}; + +var $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$: 0 +}, false, "japgolly.scalajs.react.test.emissions.RenderWithReuse$", { + Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$; +var $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$; + +function $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$) { + $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ = new $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuse$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuseBy-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuseBy-out2.js new file mode 100644 index 000000000..aaa9d5964 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuseBy-out2.js @@ -0,0 +1,501 @@ +'use strict'; + +var _s = $RefreshSig$(), + _s2 = $RefreshSig$(), + _s3 = $RefreshSig$(), + _s4 = $RefreshSig$(), + _s5 = $RefreshSig$(), + _s6 = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Children from "./japgolly.scalajs.react.CtorType$Children.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Nullary from "./japgolly.scalajs.react.CtorType$Nullary.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Props from "./japgolly.scalajs.react.CtorType$Props.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024PropsAndChildren from "./japgolly.scalajs.react.CtorType$PropsAndChildren.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF from "./japgolly.scalajs.react.NonEmptyRef$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren from "./japgolly.scalajs.react.PropsChildren.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024 from "./japgolly.scalajs.react.Ref$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024FullF from "./japgolly.scalajs.react.Ref$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusability from "./japgolly.scalajs.react.Reusability.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable from "./japgolly.scalajs.react.Reusable.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eGeneric$0024UnmountedRaw from "./japgolly.scalajs.react.component.Generic$UnmountedRaw.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024 from "./japgolly.scalajs.react.hooks.HookCtx$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P1 from "./japgolly.scalajs.react.hooks.HookCtx$P1.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC0 from "./japgolly.scalajs.react.hooks.HookCtx$PC0.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC1 from "./japgolly.scalajs.react.hooks.HookCtx$PC1.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC2 from "./japgolly.scalajs.react.hooks.HookCtx$PC2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseCallbackArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF from "./japgolly.scalajs.react.hooks.Hooks$UseRefF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseStateF$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024 from "./japgolly.scalajs.react.internal.ShouldComponentUpdateComponent$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI from "./japgolly.scalajs.react.test.emissions.PI.js"; +import * as $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI$0024 from "./japgolly.scalajs.react.test.emissions.PI$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024 from "./japgolly.scalajs.react.util.DefaultEffects$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomElement$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_org$002escalajs$002edom$002eHTMLInputElement from "./org.scalajs.dom.HTMLInputElement.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002eMatchError from "./scala.MatchError.js"; +import * as $j_scala$002eNone$0024 from "./scala.None$.js"; +import * as $j_scala$002eSome from "./scala.Some.js"; +import * as $j_scala$002eTuple4 from "./scala.Tuple4.js"; +import * as $j_scala$002ereflect$002eClassTag$0024GenericClassTag from "./scala.reflect.ClassTag$GenericClassTag.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eWrappedVarArgs from "./scala.scalajs.runtime.WrappedVarArgs.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$1__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline($thiz, e, s$3) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(s$3); + return r.value__O().apply__O__O(e.target.value).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$1__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$2__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline($thiz, e, s$4) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(s$4); + return r.value__O().apply__O__O(e.target.value).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$2__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$() { + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P_PC = null; + $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); + + var rawComponent$2 = arg1$2$1 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$CtxObj_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$1); + + var $$x2 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$2 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$1 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonN__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P = $$x2.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$2.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$2, s$1)); + + var rawComponent$3 = arg1$2$2 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$CtxFn_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$2); + + var $$x3 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$3 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$2 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P = $$x3.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$3.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$3, s$2)); + + var rawComponent$4 = arg1$2$3 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$3); + + var $$x4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$3 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P_PC = $$x4.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$4.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$4, s$3)); + + var rawComponent$5 = arg1$2$4 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$CtxObj_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$4); + + var $$x5 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$5 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$4 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P_PC = $$x5.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$5.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$5, s$4)); + + var rawComponent$6 = arg1$2$5 => $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$CtxFn_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2$5); + + var $$x6 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$5 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P_PC = $$x6.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$6.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$6, s$5)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$; + +function $h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ }; +$h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.all__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot = function () { + return $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_ScalaFnComponent.apply__F1__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(p$2 => { + var p = p$2; + var $$x6 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var c = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P; + var this$5 = c.ctor__Ljapgolly_scalajs_react_CtorType(); + var u = this$5.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p, this$5.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n = u.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x5 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n); + var c$1 = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P; + var u$1 = c$1.ctor__Ljapgolly_scalajs_react_CtorType().apply__O(); + var n$1 = u$1.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x4 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$1); + var c$2 = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P; + var this$12 = c$2.ctor__Ljapgolly_scalajs_react_CtorType(); + var u$2 = this$12.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p, this$12.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n$2 = u$2.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x3 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$2); + var c$3 = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P_PC; + var this$21 = c$3.ctor__Ljapgolly_scalajs_react_CtorType(); + var array = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(1))]; + var children = new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array); + var u$3 = this$21.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_construct.apply__O__O__O__O(p, this$21.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_mods, children); + var n$3 = u$3.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x2 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$3); + var c$4 = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P_PC; + var this$30 = c$4.ctor__Ljapgolly_scalajs_react_CtorType(); + var array$1 = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(2))]; + var children$1 = new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1); + var u$4 = this$30.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$30.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$1); + var n$4 = u$4.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x1 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$4); + var c$5 = $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$().Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P_PC; + var this$39 = c$5.ctor__Ljapgolly_scalajs_react_CtorType(); + var array$2 = [($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(3))]; + var children$2 = new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$2); + var u$5 = this$39.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$39.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$2); + var n$5 = u$5.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var array$3 = [$$x5, $$x4, $$x3, $$x2, $$x1, new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$5)]; + return $$x6.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$3)); + }), $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null))); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(props.a.$plus__I__Ljapgolly_scalajs_react_test_emissions_PI(1), __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI$0024.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = $j_java$002elang$002eObject.$dp_toString__T(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v); + })).rawNode__sjs_js_$bar(); +}, "M/diGxSdMncUUNsduOrYE4sj5Xs="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$CtxObj_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s2(function (props) { + _s2(); + + var __japgolly__hook1_raw = $i_react.useRef(100); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook1 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook1_raw, this$2.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + var __japgolly__hook2_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(0); + }); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var props$1 = props.a; + + var __japgolly__render_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var $$x5 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x4 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var this$5 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x3 = this$5.always__F2(); + var $$x2 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().hooksUseRefF__F2(); + var $$x1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state = $$x5.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx, __japgolly__render_state, $$x4.reusabilityP2__F2__F2__F2__F2($$x3, $$x2, $$x1.reusability__F2__F2(this$6.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var ref = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var s = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + var $$x10 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = ref.Ljapgolly_scalajs_react_hooks_Hooks$UseRefF__f_raw.current | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x9 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v); + var $$x8 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var f = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$3$2 => { + var x$3 = x$3$2 | 0; + return 1 + x$3 | 0; + }); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF.$f_Ljapgolly_scalajs_react_NonEmptyRef$FullF__mod__F1__O(ref, f).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var $$x7 = $$x8.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + var $$x6 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array$1 = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(s); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$4$2 => { + var x$4 = x$4$2 | 0; + return 1 + x$4 | 0; + })).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$2 = [$$x9, $$x7, $$x6.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1))]; + return $$x10.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$2)); + })).rawNode__sjs_js_$bar(); +}, "XQK4fClOIpcad1dd5v5cOG/c7eA="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$CtxFn_P$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s3(function (props) { + _s3(); + + var __japgolly__hook1_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(20); + }); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + + var __japgolly__hook2_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var __japgolly__hook2_jscb = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_f$1.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline("asd", $j_scala$002eArray$0024.$m_sci_Nil$()))); + + var $$x1 = $i_react; + var a = []; + + var __japgolly__hook2_raw = $$x1.useCallback(__japgolly__hook2_jscb, a); + + var __japgolly__hook2 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_g$1.apply__O__O(__japgolly__hook2_raw); + + var __japgolly__hook3_state = $i_react.useState(0); + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().useForceUpdateRaw__sjs_js_Tuple2__Ljapgolly_scalajs_react_Reusable(__japgolly__hook3_state); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var $$x6 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x5 = new $j_scala$002eTuple4.$c_T4(props.a, __japgolly__hook1, __japgolly__hook2, __japgolly__hook3); + var $$x4 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x3 = $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI$0024.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability; + var $$x2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$7 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state = $$x6.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState($$x5, __japgolly__render_state, $$x4.tuple4__F2__F2__F2__F2__F2($$x3, $$x2.reusability__F2__F2(this$7.by_$eq$eq__F2()), $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2(), $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2())); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var x1 = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + + if (x1 !== null) { + var p = x1.T4__f__1; + var s = x1.T4__f__2; + var incES = x1.T4__f__3; + var fu = x1.T4__f__4; + var $$x11 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = "P=" + p + ", S=" + s.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0]; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x10 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v); + var $$x9 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(s); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$9$2 => { + var x$9 = x$9$2 | 0; + return 1 + x$9 | 0; + })).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var $$x8 = $$x9.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + var $$x7 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var array$1 = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$m_Ljapgolly_scalajs_react_callback_CallbackTo$().$greater$greater$extension__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline(($j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(), incES.value__O()).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline, ($j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(), fu.value__O()).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$2 = [$$x10, $$x8, $$x7.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("button", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1))]; + return $$x11.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$2)); + } else { + throw new $j_scala$002eMatchError.$c_s_MatchError(x1); + } + })).rawNode__sjs_js_$bar(); +}, "HLTVBa/zcnDZFbxAbCazifbqnDc=", true); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s4(function (props) { + _s4(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var __japgolly__render_deps_state = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(new $j_scala$002eArray$0024.$c_T2(props.a, new $j_japgolly$002escalajs$002ereact$002ePropsChildren.$c_Ljapgolly_scalajs_react_PropsChildren(children)), __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().tuple2__F2__F2__F2($j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI$0024.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2())); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var x1 = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + + if (x1 !== null) { + var p = x1.T2__f__1; + var c = x1.T2__f__2.Ljapgolly_scalajs_react_PropsChildren__f_japgolly$scalajs$react$PropsChildren$$self; + var $$x1 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = "P=" + p; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var array = [new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(c))]; + return $$x1.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)); + } else { + throw new $j_scala$002eMatchError.$c_s_MatchError(x1); + } + })).rawNode__sjs_js_$bar(); +}, "M/diGxSdMncUUNsduOrYE4sj5Xs="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$CtxObj_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s5(function (props) { + _s5(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + + var __japgolly__hook1_raw = $i_react.useRef(null); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw); + var ct = new $j_scala$002ereflect$002eClassTag$0024GenericClassTag.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$2, ct); + + var __japgolly__hook2_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x"); + }); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var props$1 = props.a; + + var __japgolly__render_ctx = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$PC2(props$1, children, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var $$x6 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var this$5 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x4 = this$5.always__F2(); + var $$x3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2(); + var $$x2 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().refFullF__F2(); + var $$x1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state = $$x6.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx, __japgolly__render_state, $$x5.reusabilityPC2__F2__F2__F2__F2__F2($$x4, $$x3, $$x2, $$x1.reusability__F2__F2(this$6.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var c = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.Ljapgolly_scalajs_react_hooks_HookCtx$PC0__f_propsChildren; + var inputRef = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.Ljapgolly_scalajs_react_hooks_HookCtx$PC1__f_hook1; + var s = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value.Ljapgolly_scalajs_react_hooks_HookCtx$PC2__f_hook2; + var $$x8 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var $$x7 = $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002eSome.$c_s_Some(inputRef)); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(s.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e$2 => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$1__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline(this, e$2, s))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$1 = [$$x7.apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(c))]; + return $$x8.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1)); + })).rawNode__sjs_js_$bar(); +}, "e3d1mc74fVY6+swSg3Db4+d+pYA="); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.japgolly$scalajs$react$test$emissions$RenderWithReuseBy$$$anonfun$CtxFn_P_PC$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s6(function (props) { + _s6(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren.$m_Ljapgolly_scalajs_react_PropsChildren$().fromRawProps__sjs_js_Object__sjs_js_Any(props); + + var __japgolly__hook1_raw = $i_react.useRef(null); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw); + var ct = new $j_scala$002ereflect$002eClassTag$0024GenericClassTag.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$2, ct); + + var __japgolly__hook2_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x"); + }); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var $$x7 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x6 = new $j_scala$002eTuple4.$c_T4(props.a, new $j_japgolly$002escalajs$002ereact$002ePropsChildren.$c_Ljapgolly_scalajs_react_PropsChildren(children), __japgolly__hook1, __japgolly__hook2); + var $$x5 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var this$4 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x4 = this$4.always__F2(); + var $$x3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2(); + var $$x2 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().refFullF__F2(); + var $$x1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$5 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state = $$x7.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState($$x6, __japgolly__render_state, $$x5.tuple4__F2__F2__F2__F2__F2($$x4, $$x3, $$x2, $$x1.reusability__F2__F2(this$5.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var x1 = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + + if (x1 !== null) { + var c = x1.T4__f__2.Ljapgolly_scalajs_react_PropsChildren__f_japgolly$scalajs$react$PropsChildren$$self; + var inputRef = x1.T4__f__3; + var s = x1.T4__f__4; + var $$x9 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var $$x8 = $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002eSome.$c_s_Some(inputRef)); + var array = [$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(s.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e$2 => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$2__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_callback_Trampoline(this, e$2, s))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]; + var array$1 = [$$x8.apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array)), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(c))]; + return $$x9.apply$extension__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf("div", new $j_scala$002escalajs$002eruntime$002eWrappedVarArgs.$c_sjsr_WrappedVarArgs(array$1)); + } else { + throw new $j_scala$002eMatchError.$c_s_MatchError(x1); + } + })).rawNode__sjs_js_$bar(); +}, "e3d1mc74fVY6+swSg3Db4+d+pYA="); +var $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$: 0 +}, false, "japgolly.scalajs.react.test.emissions.RenderWithReuseBy$", { + Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$; +var $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$; + +function $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$) { + $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ = new $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuseBy-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuseBy-out3.js new file mode 100644 index 000000000..d3d2fa51b --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/RenderWithReuseBy-out3.js @@ -0,0 +1,536 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Children from "./japgolly.scalajs.react.CtorType$Children.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Nullary from "./japgolly.scalajs.react.CtorType$Nullary.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Props from "./japgolly.scalajs.react.CtorType$Props.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024PropsAndChildren from "./japgolly.scalajs.react.CtorType$PropsAndChildren.js"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF from "./japgolly.scalajs.react.NonEmptyRef$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024 from "./japgolly.scalajs.react.PropsChildren$package$PropsChildren$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024 from "./japgolly.scalajs.react.Ref$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024FullF from "./japgolly.scalajs.react.Ref$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusability from "./japgolly.scalajs.react.Reusability.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable from "./japgolly.scalajs.react.Reusable.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024 from "./japgolly.scalajs.react.callback.Trampoline$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay from "./japgolly.scalajs.react.callback.Trampoline$Delay.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eGeneric$0024UnmountedRaw from "./japgolly.scalajs.react.component.Generic$UnmountedRaw.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024 from "./japgolly.scalajs.react.hooks.HookCtx$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC2 from "./japgolly.scalajs.react.hooks.HookCtx$PC2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseCallbackArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF from "./japgolly.scalajs.react.hooks.Hooks$UseRefF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseStateF$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024 from "./japgolly.scalajs.react.internal.ShouldComponentUpdateComponent$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI from "./japgolly.scalajs.react.test.emissions.PI.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024 from "./japgolly.scalajs.react.util.DefaultEffects$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024 from "./japgolly.scalajs.react.vdom.Attr$EventCallback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024 from "./japgolly.scalajs.react.vdom.Exports$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024 from "./japgolly.scalajs.react.vdom.HtmlTagOf$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite from "./japgolly.scalajs.react.vdom.TagLite.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagMod from "./japgolly.scalajs.react.vdom.TagMod.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eTagOf$0024RefArg$0024 from "./japgolly.scalajs.react.vdom.TagOf$RefArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomElement$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode from "./japgolly.scalajs.react.vdom.VdomNode.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_org$002escalajs$002edom$002eHTMLInputElement from "./org.scalajs.dom.HTMLInputElement.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002eMatchError from "./scala.MatchError.js"; +import * as $j_scala$002eTuple4 from "./scala.Tuple4.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eCompat$0024 from "./scala.scalajs.runtime.Compat$.js"; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$1__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline($thiz, s$3, e) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(s$3); + var ev$7 = r.value__O().apply__O__O(e.target.value); + return ev$7 === null ? null : ev$7.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$1__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline($thiz, s$4, e) { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__setState__Ljapgolly_scalajs_react_Reusable(s$4); + var ev$8 = r.value__O().apply__O__O(e.target.value); + return ev$8 === null ? null : ev$8.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; +} + +export { $p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline }; + +function $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$() { + var _s = $RefreshSig$(), + _s2 = $RefreshSig$(), + _s3 = $RefreshSig$(), + _s4 = $RefreshSig$(), + _s5 = $RefreshSig$(), + _s6 = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P_PC = null; + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P_PC = null; + $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ = this; + + var rawComponent = props => { + _s(); + + var __japgolly__render_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var _$1 = props.a; + + var __japgolly__render_deps_state = $$x1.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(_$1.$plus__I__Ljapgolly_scalajs_react_test_emissions_PI(1), __japgolly__render_state, $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var _$2 = __japgolly__render_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + + var v = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$()._toString__s_Product__T(_$2); + + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v); + })).rawNode__O(); + }; + + _s(rawComponent, "LqO7qddGnL/1O/Kyd3Xtp6x9iJE="); + + var $$x2 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P = $$x2.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$4.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); + + var rawComponent$2 = props$2 => { + _s2(); + + var __japgolly__hook1_raw = $i_react.useRef(100); + + var this$6 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + + var __japgolly__hook1 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook1_raw, this$6.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + var __japgolly__hook2_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(0)); + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + + var props$1 = props$2.a; + + var __japgolly__render_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__render_state_raw$1 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$1); + + var $$x7 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x6 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var this$8 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x5 = this$8.Ljapgolly_scalajs_react_Reusability$__f_alwaysInstance; + var $$x4 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().hooksUseRefF__F2(); + var $$x3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$9 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state$1 = $$x7.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx, __japgolly__render_state$1, $$x6.reusabilityP2__F2__F2__F2__F2($$x5, $$x4, $$x3.reusability__F2__F2(this$9.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$1.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var δ = __japgolly__render_deps_state$1.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + var ref = δ.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var s$1 = δ.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + var this$21 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$2 = "div"; + var $$x10 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v$1 = ref.Ljapgolly_scalajs_react_hooks_Hooks$UseRefF__f_raw.current | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x9 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v$1); + var this$16 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self = "button"; + var xs = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var f = new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$3 => { + var _$3$1 = _$3 | 0; + + return 1 + _$3$1 | 0; + }); + var ev$2 = $j_japgolly$002escalajs$002ereact$002eNonEmptyRef$0024FullF.$f_Ljapgolly_scalajs_react_NonEmptyRef$FullF__mod__F1__O(ref, f); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$2 === null ? null : ev$2.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var $$x8 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$16, self, xs); + var this$20 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$1 = "button"; + var xs$1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(s$1); + var ev$3 = r.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$4 => { + var _$4$1 = _$4 | 0; + + return 1 + _$4$1 | 0; + })); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$3 === null ? null : ev$3.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var xs$2 = $$x10.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$$x9, $$x8, $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$20, self$1, xs$1)])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$21, self$2, xs$2); + })).rawNode__O(); + }; + + _s2(rawComponent$2, "N81TqRKjoN5vKcxkXvqCldke0YU="); + + var $$x11 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$22 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$2 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonN__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P = $$x11.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$22.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$2, s$2)); + + var rawComponent$3 = props$3 => { + _s3(); + + var __japgolly__hook1_raw$1 = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(20)); + + var __japgolly__hook1$1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw$1); + + var __japgolly__hook2_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var $$x12 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_f$1; + var optionalParams$proxy1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy7 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log("asd", ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy1)); + }); + + var __japgolly__hook2_jscb = $$x12.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy7)))); + + var __japgolly__hook2_raw$1 = $i_react.useCallback(__japgolly__hook2_jscb, []); + + var __japgolly__hook2$1 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_g$1.apply__O__O(__japgolly__hook2_raw$1); + + var __japgolly__hook3_state = $i_react.useState(0); + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$().useForceUpdateRaw__sjs_js_Tuple2__Ljapgolly_scalajs_react_Reusable(__japgolly__hook3_state); + + var __japgolly__render_state_raw$2 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$2); + + var $$x17 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var _$5 = props$3.a; + var $$x16 = new $j_scala$002eTuple4.$c_T4(_$5, __japgolly__hook1$1, __japgolly__hook2$1, __japgolly__hook3); + var $$x15 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x14 = $j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability; + var $$x13 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$27 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state$2 = $$x17.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState($$x16, __japgolly__render_state$2, $$x15.tuple4__F2__F2__F2__F2__F2($$x14, $$x13.reusability__F2__F2(this$27.by_$eq$eq__F2()), $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2(), $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$().reusableReusability__F2())); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$2.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var x$1 = __japgolly__render_deps_state$2.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + + if (x$1 !== null) { + var p = x$1.T4__f__1; + var s$3 = x$1.T4__f__2; + var incES = x$1.T4__f__3; + var fu = x$1.T4__f__4; + var this$41 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$5 = "div"; + var $$x21 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v$2 = "P=" + p + ", S=" + s$3.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0]; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var $$x20 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v$2); + var this$35 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$3 = "button"; + var xs$3 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var r$1 = $j_japgolly$002escalajs$002ereact$002eReusability.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__modState__Ljapgolly_scalajs_react_Reusable(s$3); + var ev$4 = r$1.value__O().apply__O__O(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$9 => { + var _$9$1 = _$9 | 0; + + return 1 + _$9$1 | 0; + })); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(ev$4 === null ? null : ev$4.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var $$x19 = $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$35, self$3, xs$3); + var this$40 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$4 = "button"; + var xs$4 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var ev$5 = incES.value__O(); + var ev$1 = ev$5 === null ? null : ev$5.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; + var $$x18 = $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$m_Ljapgolly_scalajs_react_callback_CallbackTo$(); + $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusable$(); + var ev$6 = fu.value__O(); + return new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($$x18.$greater$greater$extension__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline__Ljapgolly_scalajs_react_callback_Trampoline(ev$1, ev$6 === null ? null : ev$6.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline)); + }), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)])); + var xs$5 = $$x21.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$$x20, $$x19, $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$40, self$4, xs$4)])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$41, self$5, xs$5); + } + + ; + throw new $j_scala$002eMatchError.$c_s_MatchError(x$1); + })).rawNode__O(); + }; + + _s3(rawComponent$3, "FfFcmS/xahfGPO7v/c1S2fZHBQE=", true); + + var $$x22 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$42 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$4 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P = $$x22.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$42.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$3, s$4)); + + var rawComponent$4 = props$4 => { + _s4(); + + var children = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props$4); + + var __japgolly__render_state_raw$3 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$3); + + var $$x23 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var _$10 = props$4.a; + + var __japgolly__render_deps_state$3 = $$x23.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(new $j_scala$002eArray$0024.$c_T2(_$10, children), __japgolly__render_state$3, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().tuple2__F2__F2__F2($j_japgolly$002escalajs$002ereact$002etest$002eemissions$002ePI.$m_Ljapgolly_scalajs_react_test_emissions_PI$().Ljapgolly_scalajs_react_test_emissions_PI$__f_reusability, $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2())); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$3.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var x$1$1 = __japgolly__render_deps_state$3.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + + if (x$1$1 !== null) { + var p$1 = x$1$1.T2__f__1; + var c = x$1$1.T2__f__2; + var this$51 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$6 = "div"; + var $$x24 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v$3 = "P=" + p$1; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var xs$6 = $$x24.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v$3), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(c))])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$51, self$6, xs$6); + } + + ; + throw new $j_scala$002eMatchError.$c_s_MatchError(x$1$1); + })).rawNode__O(); + }; + + _s4(rawComponent$4, "L1iPDI2WUeUZjh7Tn4FDlDqxBDc="); + + var $$x25 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$52 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$5 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonPC__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P_PC = $$x25.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$52.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$4, s$5)); + + var rawComponent$5 = props$5 => { + _s5(); + + var children$1 = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props$5); + + var __japgolly__hook1_raw$2 = $i_react.useRef(null); + + var this$54 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw$2); + var ct = new $j_scala$002eArray$0024.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1$2 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$54, ct); + + var __japgolly__hook2_raw$2 = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x")); + + var __japgolly__hook2$2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw$2); + + var props$6 = props$5.a; + + var __japgolly__render_ctx$1 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024PC2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$PC2(props$6, children$1, __japgolly__hook1$2, __japgolly__hook2$2); + + var __japgolly__render_state_raw$4 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$4 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$4); + + var $$x31 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var $$x30 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024.$m_Ljapgolly_scalajs_react_hooks_HookCtx$(); + var this$56 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x29 = this$56.Ljapgolly_scalajs_react_Reusability$__f_alwaysInstance; + var $$x28 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2(); + var $$x27 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().refFullF__F2(); + var $$x26 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$57 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state$4 = $$x31.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__render_ctx$1, __japgolly__render_state$4, $$x30.reusabilityPC2__F2__F2__F2__F2__F2($$x29, $$x28, $$x27, $$x26.reusability__F2__F2(this$57.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$4.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var δ$1 = __japgolly__render_deps_state$4.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + var c$1 = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$PC0__f_propsChildren; + var inputRef = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$PC1__f_hook1; + var s$6 = δ$1.Ljapgolly_scalajs_react_hooks_HookCtx$PC2__f_hook2; + var this$63 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$7 = "div"; + var xs$7 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf($j_japgolly$002escalajs$002ereact$002evdom$002eTagOf$0024RefArg$0024.$m_Ljapgolly_scalajs_react_vdom_TagOf$RefArg$().set__Ljapgolly_scalajs_react_Ref$SetF__s_Option(inputRef)).apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf($j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(s$6.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$1__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline(this, s$6, e))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]))), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(c$1))])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$63, self$7, xs$7); + })).rawNode__O(); + }; + + _s5(rawComponent$5, "Nb2f/gvbdXTWnKivh/RajIDKBbc="); + + var $$x32 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$64 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$7 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P_PC = $$x32.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$64.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$5, s$7)); + + var rawComponent$6 = props$6$1 => { + _s6(); + + var children$2 = $j_japgolly$002escalajs$002ereact$002ePropsChildren$0024package$0024PropsChildren$0024.$m_Ljapgolly_scalajs_react_PropsChildren$package$PropsChildren$().fromRawProps__sjs_js_Object__O(props$6$1); + + var __japgolly__hook1_raw$3 = $i_react.useRef(null); + + var this$66 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook1_raw$3); + var ct$1 = new $j_scala$002eArray$0024.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + + var __japgolly__hook1$3 = $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$66, ct$1); + + var __japgolly__hook2_raw$3 = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box("x")); + + var __japgolly__hook2$3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw$3); + + var __japgolly__render_state_raw$5 = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__render_state$5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__render_state_raw$5); + + var $$x39 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var _$12 = props$6$1.a; + var $$x38 = new $j_scala$002eTuple4.$c_T4(_$12, children$2, __japgolly__hook1$3, __japgolly__hook2$3); + var $$x37 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var this$68 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var $$x36 = this$68.Ljapgolly_scalajs_react_Reusability$__f_alwaysInstance; + var $$x35 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().propsChildren__F2(); + var $$x34 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$().refFullF__F2(); + var $$x33 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$(); + var this$69 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__render_deps_state$5 = $$x39.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState($$x38, __japgolly__render_state$5, $$x37.tuple4__F2__F2__F2__F2__F2($$x36, $$x35, $$x34, $$x33.reusability__F2__F2(this$69.by_$eq$eq__F2()))); + + return $j_japgolly$002escalajs$002ereact$002einternal$002eShouldComponentUpdateComponent$0024.$m_Ljapgolly_scalajs_react_internal_ShouldComponentUpdateComponent$().apply__I__F0__Ljapgolly_scalajs_react_vdom_VdomNode(__japgolly__render_deps_state$5.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev, new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + var x$1$2 = __japgolly__render_deps_state$5.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + + if (x$1$2 !== null) { + var c$2 = x$1$2.T4__f__2; + var inputRef$1 = x$1$2.T4__f__3; + var s$8 = x$1$2.T4__f__4; + var this$75 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self$8 = "div"; + var xs$8 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$less.input__Ljapgolly_scalajs_react_vdom_HtmlTags$input$().Ljapgolly_scalajs_react_vdom_HtmlTags$input$__f_text.withRef__s_Option__Ljapgolly_scalajs_react_vdom_TagOf($j_japgolly$002escalajs$002ereact$002evdom$002eTagOf$0024RefArg$0024.$m_Ljapgolly_scalajs_react_vdom_TagOf$RefArg$().set__Ljapgolly_scalajs_react_Ref$SetF__s_Option(inputRef$1)).apply__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf($j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_value.$colon$eq__O__F2__Ljapgolly_scalajs_react_vdom_TagMod(s$8.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0], $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_PackageBase__f_vdomAttrVtString), $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$().Ljapgolly_scalajs_react_vdom_html_$less$up$__f_$up.Ljapgolly_scalajs_react_vdom_HtmlAttrAndStyles$__f_onChange.$eq$eq$greater__F1__F1__Ljapgolly_scalajs_react_vdom_TagMod(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(e$1 => new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($p_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__onChange$2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__Ljapgolly_scalajs_react_facade_SyntheticEvent__Ljapgolly_scalajs_react_callback_Trampoline(this, s$8, e$1))), $j_japgolly$002escalajs$002ereact$002evdom$002eAttr$0024EventCallback$0024.$m_Ljapgolly_scalajs_react_vdom_Attr$EventCallback$().Ljapgolly_scalajs_react_vdom_Attr$EventCallback$__f_defaultSync)]))), ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(c$2))])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$75, self$8, xs$8); + } + + ; + throw new $j_scala$002eMatchError.$c_s_MatchError(x$1$2); + })).rawNode__O(); + }; + + _s6(rawComponent$6, "Q2EthKS++vBhx2pAlqNww9Pvaec="); + + var $$x40 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$76 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s$9 = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonC__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_BoxUnit); + this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P_PC = $$x40.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$76.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent$6, s$9)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$; + +function $h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ }; +$h_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.all__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot = function () { + return $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_ScalaFnComponent.apply__F1__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(p => { + var p$1 = p; + var this$33 = $j_japgolly$002escalajs$002ereact$002evdom$002eHtmlTagOf$0024.$m_Ljapgolly_scalajs_react_vdom_HtmlTagOf$(); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eExports$0024.$m_Ljapgolly_scalajs_react_vdom_Exports$(); + var self = "div"; + var $$x6 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$(); + var c = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P; + var this$5 = c.ctor__Ljapgolly_scalajs_react_CtorType(); + var u = this$5.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p$1, this$5.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n = u.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x5 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n); + var c$1 = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P; + var u$1 = c$1.ctor__Ljapgolly_scalajs_react_CtorType().apply__O(); + var n$1 = u$1.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x4 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$1); + var c$2 = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P; + var this$12 = c$2.ctor__Ljapgolly_scalajs_react_CtorType(); + var u$2 = this$12.Ljapgolly_scalajs_react_CtorType$Props__f_construct.apply__O__O__O(p$1, this$12.Ljapgolly_scalajs_react_CtorType$Props__f_mods); + var n$2 = u$2.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x3 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$2); + var c$3 = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_P_PC; + var this$18 = c$3.ctor__Ljapgolly_scalajs_react_CtorType(); + var children = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode.$d_Ljapgolly_scalajs_react_vdom_VdomNode.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(1))])); + var u$3 = this$18.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_construct.apply__O__O__O__O(p$1, this$18.Ljapgolly_scalajs_react_CtorType$PropsAndChildren__f_mods, children); + var n$3 = u$3.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x2 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$3); + var c$4 = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxObj_P_PC; + var this$24 = c$4.ctor__Ljapgolly_scalajs_react_CtorType(); + var children$1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode.$d_Ljapgolly_scalajs_react_vdom_VdomNode.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(2))])); + var u$4 = this$24.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$24.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$1); + var n$4 = u$4.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var $$x1 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$4); + var c$5 = this.Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$__f_CtxFn_P_PC; + var this$30 = c$5.ctor__Ljapgolly_scalajs_react_CtorType(); + var children$2 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode.$d_Ljapgolly_scalajs_react_vdom_VdomNode.getArrayOf().constr)([($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(3))])); + var u$5 = this$30.Ljapgolly_scalajs_react_CtorType$Children__f_construct.apply__O__O__O(this$30.Ljapgolly_scalajs_react_CtorType$Children__f_mods, children$2); + var n$5 = u$5.raw__Ljapgolly_scalajs_react_facade_React$ComponentElement(); + var xs = $$x6.wrapRefArray__AO__sci_ArraySeq(new ($j_japgolly$002escalajs$002ereact$002evdom$002eTagMod.$d_Ljapgolly_scalajs_react_vdom_TagMod.getArrayOf().constr)([$$x5, $$x4, $$x3, $$x2, $$x1, new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomElement$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomElement$$anon$1(n$5)])); + return $j_japgolly$002escalajs$002ereact$002evdom$002eTagLite.$f_Ljapgolly_scalajs_react_vdom_TagLite__apply__T__sci_Seq__Ljapgolly_scalajs_react_vdom_TagOf(this$33, self, xs); + }), $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null)); +}; + +var $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$: 0 +}, false, "japgolly.scalajs.react.test.emissions.RenderWithReuseBy$", { + Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ }; +$c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$; +var $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$; + +function $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$) { + $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ = new $c_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_RenderWithReuseBy$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/UseCallback-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseCallback-out2.js new file mode 100644 index 000000000..260a5c2d0 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseCallback-out2.js @@ -0,0 +1,111 @@ +'use strict'; + +var _s = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable from "./japgolly.scalajs.react.Reusable.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024 from "./japgolly.scalajs.react.callback.Trampoline$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseCallbackArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseCallback$() { + this.Ljapgolly_scalajs_react_test_emissions_UseCallback$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_UseCallback$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_UseCallback$().japgolly$scalajs$react$test$emissions$UseCallback$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_UseCallback$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseCallback$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseCallback$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_UseCallback$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseCallback$; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseCallback$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseCallback$ }; +$h_Ljapgolly_scalajs_react_test_emissions_UseCallback$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseCallback$.prototype; +$c_Ljapgolly_scalajs_react_test_emissions_UseCallback$.prototype.japgolly$scalajs$react$test$emissions$UseCallback$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var __japgolly__hook1_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var __japgolly__hook1_jscb = __japgolly__hook1_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_f$1.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline("aaaaaaaaaaaaaa", $j_scala$002eArray$0024.$m_sci_Nil$()))); + + var $$x1 = $i_react; + var a = []; + + var __japgolly__hook1_raw = $$x1.useCallback(__japgolly__hook1_jscb, a); + + var __japgolly__hook1 = __japgolly__hook1_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_g$1.apply__O__O(__japgolly__hook1_raw); + + var props$1 = props.a; + + var __japgolly__hook2_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var __japgolly__hook2_jscb = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_f$1.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline("bbbbbbbbbbbbbb" + props$1, $j_scala$002eArray$0024.$m_sci_Nil$()))); + + var $$x2 = $i_react; + var a$1 = []; + + var __japgolly__hook2_raw = $$x2.useCallback(__japgolly__hook2_jscb, a$1); + + var __japgolly__hook2 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_g$1.apply__O__O(__japgolly__hook2_raw); + + var __japgolly__hook3_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var __japgolly__hook3_jscb = __japgolly__hook3_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_f$1.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline("cccccccccccccc" + props.a, $j_scala$002eArray$0024.$m_sci_Nil$()))); + + var $$x3 = $i_react; + var a$2 = []; + + var __japgolly__hook3_raw = $$x3.useCallback(__japgolly__hook3_jscb, a$2); + + var __japgolly__hook3 = __japgolly__hook3_arg.Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$$anon$1__f_g$1.apply__O__O(__japgolly__hook3_raw); + + var this$ = ($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook1.value__O()).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline; + $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$().run__Ljapgolly_scalajs_react_callback_Trampoline__O(this$); + var this$$1 = ($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook2.value__O()).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline; + $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$().run__Ljapgolly_scalajs_react_callback_Trampoline__O(this$$1); + var this$$2 = ($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook3.value__O()).Ljapgolly_scalajs_react_callback_CallbackTo__f_japgolly$scalajs$react$callback$CallbackTo$$trampoline; + $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$().run__Ljapgolly_scalajs_react_callback_Trampoline__O(this$$2); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = props.a | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; +}, "iraUe4+KkOLn6ddQAIouaX7EXxE="); +var $d_Ljapgolly_scalajs_react_test_emissions_UseCallback$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseCallback$: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseCallback$", { + Ljapgolly_scalajs_react_test_emissions_UseCallback$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseCallback$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseCallback$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseCallback$; +var $n_Ljapgolly_scalajs_react_test_emissions_UseCallback$; + +function $m_Ljapgolly_scalajs_react_test_emissions_UseCallback$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_UseCallback$) { + $n_Ljapgolly_scalajs_react_test_emissions_UseCallback$ = new $c_Ljapgolly_scalajs_react_test_emissions_UseCallback$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_UseCallback$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_UseCallback$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/UseCallback-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseCallback-out3.js new file mode 100644 index 000000000..00d31888a --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseCallback-out3.js @@ -0,0 +1,135 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable from "./japgolly.scalajs.react.Reusable.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024 from "./japgolly.scalajs.react.callback.Trampoline$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay from "./japgolly.scalajs.react.callback.Trampoline$Delay.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseCallbackArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eCompat$0024 from "./scala.scalajs.runtime.Compat$.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseCallback$() { + var _s = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_UseCallback$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_UseCallback$ = this; + + var rawComponent = props => { + _s(); + + var __japgolly__hook1_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var $$x1 = __japgolly__hook1_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_f$1; + var optionalParams$proxy1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy3 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log("aaaaaaaaaaaaaa", ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy1)); + }); + + var __japgolly__hook1_jscb = $$x1.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy3)))); + + var __japgolly__hook1_raw = $i_react.useCallback(__japgolly__hook1_jscb, []); + + var __japgolly__hook1 = __japgolly__hook1_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_g$1.apply__O__O(__japgolly__hook1_raw); + + var props$1 = props.a; + + var __japgolly__hook2_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var $$x2 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_f$1; + var message$proxy1 = "bbbbbbbbbbbbbb" + props$1; + var optionalParams$proxy2 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy6 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log(message$proxy1, ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy2)); + }); + + var __japgolly__hook2_jscb = $$x2.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy6)))); + + var __japgolly__hook2_raw = $i_react.useCallback(__japgolly__hook2_jscb, []); + + var __japgolly__hook2 = __japgolly__hook2_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_g$1.apply__O__O(__japgolly__hook2_raw); + + var __japgolly__hook3_arg = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseCallbackArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg$().callback__Ljapgolly_scalajs_react_util_Effect$Dispatch__Ljapgolly_scalajs_react_hooks_Hooks$UseCallbackArg($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var $$x3 = __japgolly__hook3_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_f$1; + var p = props.a | 0; + var message$proxy2 = "cccccccccccccc" + p; + var optionalParams$proxy3 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy9 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log(message$proxy2, ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy3)); + }); + + var __japgolly__hook3_jscb = $$x3.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy9)))); + + var __japgolly__hook3_raw = $i_react.useCallback(__japgolly__hook3_jscb, []); + + var __japgolly__hook3 = __japgolly__hook3_arg.Ljapgolly_scalajs_react_hooks_Hooks$$anon$1__f_g$1.apply__O__O(__japgolly__hook3_raw); + + var p$2 = props.a | 0; + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + + var ev$1 = __japgolly__hook1.value__O(); + + var CallbackTo_this = ev$1 === null ? null : ev$1.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; + $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$().run__Ljapgolly_scalajs_react_callback_Trampoline__O(CallbackTo_this); + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + + var ev$2 = __japgolly__hook2.value__O(); + + var CallbackTo_this$2 = ev$2 === null ? null : ev$2.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; + $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$().run__Ljapgolly_scalajs_react_callback_Trampoline__O(CallbackTo_this$2); + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + + var ev$3 = __japgolly__hook3.value__O(); + + var CallbackTo_this$3 = ev$3 === null ? null : ev$3.Ljapgolly_scalajs_react_callback_CallbackTo__f_trampoline; + $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$().run__Ljapgolly_scalajs_react_callback_Trampoline__O(CallbackTo_this$3); + return ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(p$2)).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; + }; + + _s(rawComponent, "iraUe4+KkOLn6ddQAIouaX7EXxE="); + + var $$x4 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$20 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_UseCallback$__f_Component = $$x4.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$20.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseCallback$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseCallback$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_UseCallback$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseCallback$; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseCallback$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseCallback$ }; +$h_Ljapgolly_scalajs_react_test_emissions_UseCallback$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseCallback$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_UseCallback$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseCallback$: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseCallback$", { + Ljapgolly_scalajs_react_test_emissions_UseCallback$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseCallback$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseCallback$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseCallback$; +var $n_Ljapgolly_scalajs_react_test_emissions_UseCallback$; + +function $m_Ljapgolly_scalajs_react_test_emissions_UseCallback$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_UseCallback$) { + $n_Ljapgolly_scalajs_react_test_emissions_UseCallback$ = new $c_Ljapgolly_scalajs_react_test_emissions_UseCallback$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_UseCallback$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_UseCallback$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/UseEffect-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseEffect-out2.js new file mode 100644 index 000000000..5584bdba1 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseEffect-out2.js @@ -0,0 +1,101 @@ +'use strict'; + +var _s = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseEffectArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseEffect$() { + this.Ljapgolly_scalajs_react_test_emissions_UseEffect$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_UseEffect$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_UseEffect$().japgolly$scalajs$react$test$emissions$UseEffect$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_UseEffect$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseEffect$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseEffect$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_UseEffect$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseEffect$; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseEffect$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseEffect$ }; +$h_Ljapgolly_scalajs_react_test_emissions_UseEffect$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseEffect$.prototype; +$c_Ljapgolly_scalajs_react_test_emissions_UseEffect$.prototype.japgolly$scalajs$react$test$emissions$UseEffect$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + $i_react.useEffect($j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.Ljapgolly_scalajs_react_callback_Callback$__f_empty)), void 0); + var $$x2 = $i_react; + var $$x1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.Ljapgolly_scalajs_react_callback_Callback$__f_empty)); + var a = []; + $$x2.useEffect($$x1, a); + $i_react.useLayoutEffect($j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.Ljapgolly_scalajs_react_callback_Callback$__f_empty)), void 0); + var $$x4 = $i_react; + var $$x3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.Ljapgolly_scalajs_react_callback_Callback$__f_empty)); + var a$1 = []; + $$x4.useLayoutEffect($$x3, a$1); + $i_react.useEffect($j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline(props.a, $j_scala$002eArray$0024.$m_sci_Nil$()))), void 0); + var $$x6 = $i_react; + var $$x5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline(props.a, $j_scala$002eArray$0024.$m_sci_Nil$()))); + var a$2 = []; + $$x6.useEffect($$x5, a$2); + $i_react.useLayoutEffect($j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline(props.a, $j_scala$002eArray$0024.$m_sci_Nil$()))), void 0); + var $$x8 = $i_react; + var $$x7 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline(props.a, $j_scala$002eArray$0024.$m_sci_Nil$()))); + var a$3 = []; + $$x8.useLayoutEffect($$x7, a$3); + var props$1 = props.a; + $i_react.useEffect($j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline(props$1, $j_scala$002eArray$0024.$m_sci_Nil$()))), void 0); + var props$2 = props.a; + var $$x10 = $i_react; + var $$x9 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline(props$2, $j_scala$002eArray$0024.$m_sci_Nil$()))); + var a$4 = []; + $$x10.useEffect($$x9, a$4); + var props$3 = props.a; + $i_react.useLayoutEffect($j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline(props$3, $j_scala$002eArray$0024.$m_sci_Nil$()))), void 0); + var props$4 = props.a; + var $$x12 = $i_react; + var $$x11 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.log__O__sci_Seq__Ljapgolly_scalajs_react_callback_Trampoline(props$4, $j_scala$002eArray$0024.$m_sci_Nil$()))); + var a$5 = []; + $$x12.useLayoutEffect($$x11, a$5); + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + var v = props.a | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(v).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; +}, "k1mMCyODKidP5cenhTaO0cNn/yI="); +var $d_Ljapgolly_scalajs_react_test_emissions_UseEffect$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseEffect$: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseEffect$", { + Ljapgolly_scalajs_react_test_emissions_UseEffect$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseEffect$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseEffect$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseEffect$; +var $n_Ljapgolly_scalajs_react_test_emissions_UseEffect$; + +function $m_Ljapgolly_scalajs_react_test_emissions_UseEffect$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_UseEffect$) { + $n_Ljapgolly_scalajs_react_test_emissions_UseEffect$ = new $c_Ljapgolly_scalajs_react_test_emissions_UseEffect$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_UseEffect$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_UseEffect$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/UseEffect-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseEffect-out3.js new file mode 100644 index 000000000..db0794ef9 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseEffect-out3.js @@ -0,0 +1,158 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo from "./japgolly.scalajs.react.callback.CallbackTo.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024 from "./japgolly.scalajs.react.callback.Trampoline$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay from "./japgolly.scalajs.react.callback.Trampoline$Delay.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P1 from "./japgolly.scalajs.react.hooks.HookCtx$P1.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseEffectArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024 from "./japgolly.scalajs.react.util.EffectCallback$callback$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002escalajs$002eruntime$002eAnonFunction0 from "./scala.scalajs.runtime.AnonFunction0.js"; +import * as $j_scala$002escalajs$002eruntime$002eCompat$0024 from "./scala.scalajs.runtime.Compat$.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseEffect$() { + var _s = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_UseEffect$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_UseEffect$ = this; + + var rawComponent = props => { + _s(); + + $i_react.useEffect($j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.Ljapgolly_scalajs_react_callback_Callback$package$Callback$__f_empty)), void 0); + $i_react.useEffect($j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.Ljapgolly_scalajs_react_callback_Callback$package$Callback$__f_empty)), []); + $i_react.useLayoutEffect($j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.Ljapgolly_scalajs_react_callback_Callback$package$Callback$__f_empty)), void 0); + $i_react.useLayoutEffect($j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()).apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo($j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_package$__f_Callback.Ljapgolly_scalajs_react_callback_Callback$package$Callback$__f_empty)), []); + var $$x2 = $i_react; + var $$x1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var _$1 = props.a | 0; + + var optionalParams$proxy1 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy3 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log(_$1, ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy1)); + }); + $$x2.useEffect($$x1.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy3)))), void 0); + var $$x4 = $i_react; + var $$x3 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var _$2 = props.a | 0; + + var optionalParams$proxy2 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy6 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log(_$2, ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy2)); + }); + $$x4.useEffect($$x3.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy6)))), []); + var $$x6 = $i_react; + var $$x5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var _$3 = props.a | 0; + + var optionalParams$proxy3 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy9 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log(_$3, ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy3)); + }); + $$x6.useLayoutEffect($$x5.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy9)))), void 0); + var $$x8 = $i_react; + var $$x7 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + + var _$4 = props.a | 0; + + var optionalParams$proxy4 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy12 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log(_$4, ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy4)); + }); + $$x8.useLayoutEffect($$x7.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy12)))), []); + var props$1 = props.a; + + var __japgolly__hook10_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P1.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P1__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P1.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P1(), props$1, 0); + + var $$x10 = $i_react; + var $$x9 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + var optionalParams$proxy5 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy15 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log(__japgolly__hook10_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props, ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy5)); + }); + $$x10.useEffect($$x9.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy15)))), void 0); + var props$2 = props.a; + + var __japgolly__hook11_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P1.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P1__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P1.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P1(), props$2, 0); + + var $$x12 = $i_react; + var $$x11 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + var optionalParams$proxy6 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy18 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log(__japgolly__hook11_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props, ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy6)); + }); + $$x12.useEffect($$x11.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy18)))), []); + var props$3 = props.a; + + var __japgolly__hook12_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P1.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P1__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P1.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P1(), props$3, 0); + + var $$x14 = $i_react; + var $$x13 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + var optionalParams$proxy7 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy21 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log(__japgolly__hook12_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props, ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy7)); + }); + $$x14.useLayoutEffect($$x13.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy21)))), void 0); + var props$4 = props.a; + + var __japgolly__hook13_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P1.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P1__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P1.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P1(), props$4, 0); + + var $$x16 = $i_react; + var $$x15 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseEffectArg$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseEffectArg$().unit__Ljapgolly_scalajs_react_util_Effect$Dispatch__F1($j_japgolly$002escalajs$002ereact$002eutil$002eEffectCallback$0024callback$0024.$m_Ljapgolly_scalajs_react_util_EffectCallback$callback$()); + var optionalParams$proxy8 = $j_scala$002eArray$0024.$m_sr_ScalaRunTime$().genericWrapArray__O__sci_ArraySeq(new $j_java$002elang$002eObject.$ac_O([])); + var f$proxy24 = new $j_scala$002escalajs$002eruntime$002eAnonFunction0.$c_sjsr_AnonFunction0(() => { + console.log(__japgolly__hook13_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props, ...$j_scala$002escalajs$002eruntime$002eCompat$0024.$m_sjsr_Compat$().toJSVarArgsImpl__sci_Seq__sjs_js_Array(optionalParams$proxy8)); + }); + $$x16.useLayoutEffect($$x15.apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecallback$002eCallbackTo.$c_Ljapgolly_scalajs_react_callback_CallbackTo(($j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024.$m_Ljapgolly_scalajs_react_callback_Trampoline$(), new $j_japgolly$002escalajs$002ereact$002ecallback$002eTrampoline$0024Delay.$c_Ljapgolly_scalajs_react_callback_Trampoline$Delay(f$proxy24)))), []); + var p = props.a | 0; + return ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(p)).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; + }; + + _s(rawComponent, "k1mMCyODKidP5cenhTaO0cNn/yI="); + + var $$x17 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$36 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_UseEffect$__f_Component = $$x17.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$36.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseEffect$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseEffect$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_UseEffect$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseEffect$; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseEffect$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseEffect$ }; +$h_Ljapgolly_scalajs_react_test_emissions_UseEffect$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseEffect$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_UseEffect$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseEffect$: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseEffect$", { + Ljapgolly_scalajs_react_test_emissions_UseEffect$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseEffect$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseEffect$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseEffect$; +var $n_Ljapgolly_scalajs_react_test_emissions_UseEffect$; + +function $m_Ljapgolly_scalajs_react_test_emissions_UseEffect$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_UseEffect$) { + $n_Ljapgolly_scalajs_react_test_emissions_UseEffect$ = new $c_Ljapgolly_scalajs_react_test_emissions_UseEffect$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_UseEffect$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_UseEffect$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/UseMemo-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseMemo-out2.js new file mode 100644 index 000000000..354322c3d --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseMemo-out2.js @@ -0,0 +1,255 @@ +'use strict'; + +var _s = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusability from "./japgolly.scalajs.react.Reusability.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable from "./japgolly.scalajs.react.Reusable.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024 from "./japgolly.scalajs.react.hooks.CustomHook$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002eNone$0024 from "./scala.None$.js"; +import * as $j_scala$002eSome from "./scala.Some.js"; +import * as $j_scala$002ereflect$002eManifestFactory$0024IntManifest$0024 from "./scala.reflect.ManifestFactory$IntManifest$.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseMemo$() { + this.Ljapgolly_scalajs_react_test_emissions_UseMemo$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_UseMemo$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_UseMemo$().japgolly$scalajs$react$test$emissions$UseMemo$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_UseMemo$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseMemo$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseMemo$; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseMemo$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseMemo$ }; +$h_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype.japgolly$scalajs$react$test$emissions$UseMemo$$$anonfun$Component$2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__I = function (__japgolly__hook1_deps_state$1) { + var arg1 = __japgolly__hook1_deps_state$1.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + var x$1 = arg1; + return x$1.length | 0; +}; + +$c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype.japgolly$scalajs$react$test$emissions$UseMemo$$$anonfun$Component$4__Ljapgolly_scalajs_react_internal_Box__Ljapgolly_scalajs_react_Reusable__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__I = function (props$1, __japgolly__hook1$1, __japgolly__hook2_deps_state$1) { + var arg1 = __japgolly__hook2_deps_state$1.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + var x$2 = arg1; + return ((x$2.length | 0) + (props$1.a | 0) | 0) + (($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook1$1.value__O()) | 0) | 0; +}; + +$c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype.japgolly$scalajs$react$test$emissions$UseMemo$$$anonfun$Component$6__Ljapgolly_scalajs_react_hooks_HookCtx$P2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__I = function (__japgolly__hook3_ctx$1, __japgolly__hook3_deps_state$1) { + var arg1 = __japgolly__hook3_deps_state$1.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + var x$3 = arg1; + var $$x3 = x$3.length; + var $$x2 = __japgolly__hook3_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r = __japgolly__hook3_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var $$x1 = r.value__O(); + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r$1 = __japgolly__hook3_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + return ((($$x3 | 0) + ($$x2 | 0) | 0) + ($$x1 | 0) | 0) + (r$1.value__O() | 0) | 0; +}; + +$c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype.japgolly$scalajs$react$test$emissions$UseMemo$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var __japgolly__hook1_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__hook1_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_state_raw); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__hook1_deps_state = $$x1.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState("blah", __japgolly__hook1_state, this$1.by_$eq$eq__F2()); + + var $$x3 = $i_react; + var a = [__japgolly__hook1_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev]; + var $$x2 = $$x3.useMemo(() => $m_Ljapgolly_scalajs_react_test_emissions_UseMemo$().japgolly$scalajs$react$test$emissions$UseMemo$$$anonfun$Component$2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__I(__japgolly__hook1_deps_state), a); + + var __japgolly__hook1_val = $$x2 | 0; + + var this$9 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var a$1 = __japgolly__hook1_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev; + $j_scala$002ereflect$002eManifestFactory$0024IntManifest$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var this$8 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var evidence$3 = this$8.by_$eq$eq__F2(); + var e = new $j_japgolly$002escalajs$002ereact$002eReusability.$c_Ljapgolly_scalajs_react_Reusability(evidence$3); + var r = e.Ljapgolly_scalajs_react_Reusability__f_test; + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$p_Ljapgolly_scalajs_react_Reusable$__root__O__F1__Ljapgolly_scalajs_react_Reusable(this$9, a$1, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$6$2 => { + var x$6 = x$6$2; + var x1 = x$6.Ljapgolly_scalajs_react_Reusable__f_japgolly$scalajs$react$Reusable$$root; + + if (x1 !== null) { + if ($j_java$002elang$002eObject.$isInt(x1)) { + var x2 = x1 | 0; + var o9 = new $j_scala$002eSome.$c_s_Some(x2); + } else { + var o9 = $j_scala$002eNone$0024.$m_s_None$(); + } + + ; + + if (!o9.isEmpty__Z() && o9.get__O() !== null) { + return !!r.apply__O__O__O(a$1, x1); + } + } + + ; + return false; + })).withValue__O__Ljapgolly_scalajs_react_Reusable(__japgolly__hook1_val); + + var __japgolly__hook2_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__hook2_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_state_raw); + + var this$12 = (props.a | 0) + (($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook1.value__O()) | 0) | 0; + + var __japgolly__hook2_deps = "" + this$12; + + var $$x4 = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var this$14 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__hook2_deps_state = $$x4.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__hook2_deps, __japgolly__hook2_state, this$14.by_$eq$eq__F2()); + + var $$x6 = $i_react; + var a$2 = [__japgolly__hook2_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev]; + var $$x5 = $$x6.useMemo(() => $m_Ljapgolly_scalajs_react_test_emissions_UseMemo$().japgolly$scalajs$react$test$emissions$UseMemo$$$anonfun$Component$4__Ljapgolly_scalajs_react_internal_Box__Ljapgolly_scalajs_react_Reusable__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__I(props, __japgolly__hook1, __japgolly__hook2_deps_state), a$2); + + var __japgolly__hook2_val = $$x5 | 0; + + var this$22 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var a$3 = __japgolly__hook2_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev; + $j_scala$002ereflect$002eManifestFactory$0024IntManifest$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var this$21 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var evidence$3$1 = this$21.by_$eq$eq__F2(); + var e$1 = new $j_japgolly$002escalajs$002ereact$002eReusability.$c_Ljapgolly_scalajs_react_Reusability(evidence$3$1); + var r$1 = e$1.Ljapgolly_scalajs_react_Reusability__f_test; + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$p_Ljapgolly_scalajs_react_Reusable$__root__O__F1__Ljapgolly_scalajs_react_Reusable(this$22, a$3, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$6$2$1 => { + var x$6$1 = x$6$2$1; + var x1$1 = x$6$1.Ljapgolly_scalajs_react_Reusable__f_japgolly$scalajs$react$Reusable$$root; + + if (x1$1 !== null) { + if ($j_java$002elang$002eObject.$isInt(x1$1)) { + var x2$1 = x1$1 | 0; + var o9$1 = new $j_scala$002eSome.$c_s_Some(x2$1); + } else { + var o9$1 = $j_scala$002eNone$0024.$m_s_None$(); + } + + ; + + if (!o9$1.isEmpty__Z() && o9$1.get__O() !== null) { + return !!r$1.apply__O__O__O(a$3, x1$1); + } + } + + ; + return false; + })).withValue__O__Ljapgolly_scalajs_react_Reusable(__japgolly__hook2_val); + + var props$1 = props.a; + + var __japgolly__hook3_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__hook3_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eNone$0024.$m_s_None$())); + + var __japgolly__hook3_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook3_state_raw); + + var $$x8 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r$2 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var $$x7 = r$2.value__O(); + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r$3 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + var this$27 = (($$x8 | 0) + ($$x7 | 0) | 0) + (r$3.value__O() | 0) | 0; + + var __japgolly__hook3_deps = "" + this$27; + + var $$x9 = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var this$29 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__hook3_deps_state = $$x9.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__hook3_deps, __japgolly__hook3_state, this$29.by_$eq$eq__F2()); + + var $$x11 = $i_react; + var a$4 = [__japgolly__hook3_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev]; + var $$x10 = $$x11.useMemo(() => $m_Ljapgolly_scalajs_react_test_emissions_UseMemo$().japgolly$scalajs$react$test$emissions$UseMemo$$$anonfun$Component$6__Ljapgolly_scalajs_react_hooks_HookCtx$P2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__I(__japgolly__hook3_ctx, __japgolly__hook3_deps_state), a$4); + + var __japgolly__hook3_val = $$x10 | 0; + + var this$37 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var a$5 = __japgolly__hook3_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev; + $j_scala$002ereflect$002eManifestFactory$0024IntManifest$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var this$36 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var evidence$3$2 = this$36.by_$eq$eq__F2(); + var e$2 = new $j_japgolly$002escalajs$002ereact$002eReusability.$c_Ljapgolly_scalajs_react_Reusability(evidence$3$2); + var r$4 = e$2.Ljapgolly_scalajs_react_Reusability__f_test; + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$p_Ljapgolly_scalajs_react_Reusable$__root__O__F1__Ljapgolly_scalajs_react_Reusable(this$37, a$5, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$6$2$2 => { + var x$6$3 = x$6$2$2; + var x1$2 = x$6$3.Ljapgolly_scalajs_react_Reusable__f_japgolly$scalajs$react$Reusable$$root; + + if (x1$2 !== null) { + if ($j_java$002elang$002eObject.$isInt(x1$2)) { + var x2$2 = x1$2 | 0; + var o9$2 = new $j_scala$002eSome.$c_s_Some(x2$2); + } else { + var o9$2 = $j_scala$002eNone$0024.$m_s_None$(); + } + + ; + + if (!o9$2.isEmpty__Z() && o9$2.get__O() !== null) { + return !!r$4.apply__O__O__O(a$5, x1$2); + } + } + + ; + return false; + })).withValue__O__Ljapgolly_scalajs_react_Reusable(__japgolly__hook3_val); + + var sum = (((props.a | 0) + (($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook1.value__O()) | 0) | 0) + (($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook2.value__O()) | 0) | 0) + (($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook3.value__O()) | 0) | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; +}, "J4XpZjXPN1qb/ON5Jb4ROPMKBxQ="); +var $d_Ljapgolly_scalajs_react_test_emissions_UseMemo$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseMemo$: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseMemo$", { + Ljapgolly_scalajs_react_test_emissions_UseMemo$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseMemo$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseMemo$; +var $n_Ljapgolly_scalajs_react_test_emissions_UseMemo$; + +function $m_Ljapgolly_scalajs_react_test_emissions_UseMemo$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_UseMemo$) { + $n_Ljapgolly_scalajs_react_test_emissions_UseMemo$ = new $c_Ljapgolly_scalajs_react_test_emissions_UseMemo$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_UseMemo$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_UseMemo$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/UseMemo-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseMemo-out3.js new file mode 100644 index 000000000..859cac184 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseMemo-out3.js @@ -0,0 +1,235 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusability from "./japgolly.scalajs.react.Reusability.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable from "./japgolly.scalajs.react.Reusable.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024 from "./japgolly.scalajs.react.hooks.CustomHook$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseMemo$() { + var _s = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_UseMemo$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_UseMemo$ = this; + + var rawComponent = props => { + _s(); + + var __japgolly__hook1_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__hook1_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_state_raw); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var this$2 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__hook1_deps_state = $$x1.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState("blah", __japgolly__hook1_state, this$2.by_$eq$eq__F2()); + + var __japgolly__hook1_val = $i_react.useMemo(() => { + var _$1$proxy1 = __japgolly__hook1_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + return _$1$proxy1.length | 0; + }, [__japgolly__hook1_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev]) | 0; + + var this$7 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var a = __japgolly__hook1_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev; + $j_scala$002eArray$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var this$6 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var evidence$3 = this$6.by_$eq$eq__F2(); + var e = new $j_japgolly$002escalajs$002ereact$002eReusability.$c_Ljapgolly_scalajs_react_Reusability(evidence$3); + var r = e.Ljapgolly_scalajs_react_Reusability__f_test; + + var __japgolly__hook1 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$p_Ljapgolly_scalajs_react_Reusable$__root__O__F1__Ljapgolly_scalajs_react_Reusable(this$7, a, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$6 => { + var _$6$1 = _$6; + var x1 = _$6$1.Ljapgolly_scalajs_react_Reusable__f_root; + + if (x1 !== null) { + if ($j_java$002elang$002eObject.$isInt(x1)) { + var x2 = x1 | 0; + var x2$1 = new $j_scala$002eArray$0024.$c_s_Some(x2); + } else { + var x2$1 = $j_scala$002eArray$0024.$m_s_None$(); + } + + ; + + if (!x2$1.isEmpty__Z()) { + var x3 = x2$1.get__O(); + return !!r.apply__O__O__O(a, x3); + } + } + + ; + return false; + })).withValue__O__Ljapgolly_scalajs_react_Reusable(__japgolly__hook1_val); + + var __japgolly__hook2_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__hook2_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_state_raw); + + var p = props.a | 0; + var this$10 = p + (($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook1.value__O()) | 0) | 0; + + var __japgolly__hook2_deps = "" + this$10; + + var $$x2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var this$12 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__hook2_deps_state = $$x2.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__hook2_deps, __japgolly__hook2_state, this$12.by_$eq$eq__F2()); + + var __japgolly__hook2_val = $i_react.useMemo(() => { + var p$1 = props.a | 0; + var _$2 = __japgolly__hook2_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + return ((_$2.length | 0) + p$1 | 0) + (($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook1.value__O()) | 0) | 0; + }, [__japgolly__hook2_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev]) | 0; + + var this$18 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var a$1 = __japgolly__hook2_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev; + $j_scala$002eArray$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var this$17 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var evidence$3$1 = this$17.by_$eq$eq__F2(); + var e$1 = new $j_japgolly$002escalajs$002ereact$002eReusability.$c_Ljapgolly_scalajs_react_Reusability(evidence$3$1); + var r$1 = e$1.Ljapgolly_scalajs_react_Reusability__f_test; + + var __japgolly__hook2 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$p_Ljapgolly_scalajs_react_Reusable$__root__O__F1__Ljapgolly_scalajs_react_Reusable(this$18, a$1, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$6$2 => { + var _$6$3 = _$6$2; + var x1$1 = _$6$3.Ljapgolly_scalajs_react_Reusable__f_root; + + if (x1$1 !== null) { + if ($j_java$002elang$002eObject.$isInt(x1$1)) { + var x2$2 = x1$1 | 0; + var x2$3 = new $j_scala$002eArray$0024.$c_s_Some(x2$2); + } else { + var x2$3 = $j_scala$002eArray$0024.$m_s_None$(); + } + + ; + + if (!x2$3.isEmpty__Z()) { + var x3$1 = x2$3.get__O(); + return !!r$1.apply__O__O__O(a$1, x3$1); + } + } + + ; + return false; + })).withValue__O__Ljapgolly_scalajs_react_Reusable(__japgolly__hook2_val); + + var props$1 = props.a; + + var __japgolly__hook3_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__hook3_state_raw = $i_react.useState($j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box($j_scala$002eArray$0024.$m_s_None$())); + + var __japgolly__hook3_state = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook3_state_raw); + + var $$x4 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r$2 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var $$x3 = r$2.value__O(); + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r$3 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + var this$23 = (($$x4 | 0) + ($$x3 | 0) | 0) + (r$3.value__O() | 0) | 0; + + var __japgolly__hook3_deps = "" + this$23; + + var $$x5 = $j_japgolly$002escalajs$002ereact$002ehooks$002eCustomHook$0024.$m_Ljapgolly_scalajs_react_hooks_CustomHook$(); + var this$25 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + + var __japgolly__hook3_deps_state = $$x5.reusableDepsLogic__O__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__F2__Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState(__japgolly__hook3_deps, __japgolly__hook3_state, this$25.by_$eq$eq__F2()); + + var __japgolly__hook3_val = $i_react.useMemo(() => { + var _$3$proxy1 = __japgolly__hook3_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_value; + var $$x8 = _$3$proxy1.length; + var $$x7 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r$4 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var $$x6 = r$4.value__O(); + $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var r$5 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + return ((($$x8 | 0) + ($$x7 | 0) | 0) + ($$x6 | 0) | 0) + (r$5.value__O() | 0) | 0; + }, [__japgolly__hook3_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev]) | 0; + + var this$32 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(); + var a$2 = __japgolly__hook3_deps_state.Ljapgolly_scalajs_react_hooks_CustomHook$ReusableDepState__f_rev; + $j_scala$002eArray$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var this$31 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var evidence$3$2 = this$31.by_$eq$eq__F2(); + var e$2 = new $j_japgolly$002escalajs$002ereact$002eReusability.$c_Ljapgolly_scalajs_react_Reusability(evidence$3$2); + var r$6 = e$2.Ljapgolly_scalajs_react_Reusability__f_test; + + var __japgolly__hook3 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$p_Ljapgolly_scalajs_react_Reusable$__root__O__F1__Ljapgolly_scalajs_react_Reusable(this$32, a$2, new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$6$4 => { + var _$6$5 = _$6$4; + var x1$2 = _$6$5.Ljapgolly_scalajs_react_Reusable__f_root; + + if (x1$2 !== null) { + if ($j_java$002elang$002eObject.$isInt(x1$2)) { + var x2$4 = x1$2 | 0; + var x2$5 = new $j_scala$002eArray$0024.$c_s_Some(x2$4); + } else { + var x2$5 = $j_scala$002eArray$0024.$m_s_None$(); + } + + ; + + if (!x2$5.isEmpty__Z()) { + var x3$2 = x2$5.get__O(); + return !!r$6.apply__O__O__O(a$2, x3$2); + } + } + + ; + return false; + })).withValue__O__Ljapgolly_scalajs_react_Reusable(__japgolly__hook3_val); + + var p$2 = props.a | 0; + var sum = ((p$2 + (($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook1.value__O()) | 0) | 0) + (($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook2.value__O()) | 0) | 0) + (($j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$(), __japgolly__hook3.value__O()) | 0) | 0; + return ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; + }; + + _s(rawComponent, "B9FCBR48dreDSEq0T/BcBc3hpN0="); + + var $$x9 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$39 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_UseMemo$__f_Component = $$x9.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$39.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseMemo$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseMemo$; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseMemo$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseMemo$ }; +$h_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_UseMemo$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseMemo$: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseMemo$", { + Ljapgolly_scalajs_react_test_emissions_UseMemo$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseMemo$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseMemo$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseMemo$; +var $n_Ljapgolly_scalajs_react_test_emissions_UseMemo$; + +function $m_Ljapgolly_scalajs_react_test_emissions_UseMemo$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_UseMemo$) { + $n_Ljapgolly_scalajs_react_test_emissions_UseMemo$ = new $c_Ljapgolly_scalajs_react_test_emissions_UseMemo$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_UseMemo$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_UseMemo$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/UseRef-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseRef-out2.js new file mode 100644 index 000000000..fd0ca5160 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseRef-out2.js @@ -0,0 +1,138 @@ +'use strict'; + +var _s = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024 from "./japgolly.scalajs.react.Ref$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024FullF from "./japgolly.scalajs.react.Ref$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024ToComponent$0024 from "./japgolly.scalajs.react.Ref$ToComponent$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024WithJsComponentArg$0024 from "./japgolly.scalajs.react.Ref$WithJsComponentArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJs$0024$0024anon$00243 from "./japgolly.scalajs.react.component.Js$$anon$3.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScala$0024MountedWithRoot from "./japgolly.scalajs.react.component.Scala$MountedWithRoot.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eComponentBuilder$0024Step1 from "./japgolly.scalajs.react.component.builder.ComponentBuilder$Step1.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eComponentBuilder$0024Step2 from "./japgolly.scalajs.react.component.builder.ComponentBuilder$Step2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eInitState$0024Stateless$0024 from "./japgolly.scalajs.react.component.builder.InitState$Stateless$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eAbstractHookMacros$0024 from "./japgolly.scalajs.react.hooks.AbstractHookMacros$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF from "./japgolly.scalajs.react.hooks.Hooks$UseRefF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024 from "./japgolly.scalajs.react.util.DefaultEffects$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_org$002escalajs$002edom$002eHTMLInputElement from "./org.scalajs.dom.HTMLInputElement.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; +import * as $j_scala$002ereflect$002eClassTag$0024GenericClassTag from "./scala.reflect.ClassTag$GenericClassTag.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseRef$() { + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_jsComp = null; + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_scalaComp = null; + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_UseRef$ = this; + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_jsComp = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_JsComponent.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(null, $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonN__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_Null)); + var b = new $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eComponentBuilder$0024Step1.$c_Ljapgolly_scalajs_react_component_builder_ComponentBuilder$Step1("japgolly.scalajs.react.test.emissions.UseRef"); + var b$1 = b.Ljapgolly_scalajs_react_component_builder_ComponentBuilder$Step1__f_japgolly$scalajs$react$component$builder$ComponentBuilder$Step1$$name; + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_scalaComp = new $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eComponentBuilder$0024Step2.$c_Ljapgolly_scalajs_react_component_builder_ComponentBuilder$Step2(b$1, $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eInitState$0024Stateless$0024.$m_Ljapgolly_scalajs_react_component_builder_InitState$Stateless$()).noBackend__Ljapgolly_scalajs_react_component_builder_ComponentBuilder$Step3().render_P__F1__Ljapgolly_scalajs_react_component_builder_ComponentBuilder$LastStep(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$2 => { + var x = x$2 | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(x); + })).build__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot($j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null))); + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_UseRef$().japgolly$scalajs$react$test$emissions$UseRef$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$8 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$8.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseRef$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseRef$; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseRef$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseRef$ }; +$h_Ljapgolly_scalajs_react_test_emissions_UseRef$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseRef$.prototype; +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$.prototype.japgolly$scalajs$react$test$emissions$UseRef$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var __japgolly__hook1_raw = $i_react.useRef(100); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook1_raw, this$2.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + var __japgolly__hook2_raw = $i_react.useRef(props.a); + + var this$4 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook2_raw, this$4.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + var props$1 = props.a; + + var __japgolly__hook3_raw = $i_react.useRef(props$1); + + var this$7 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook3_raw, this$7.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + var __japgolly__hook4_raw = $i_react.useRef(null); + + var this$9 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook4_raw); + var ct = new $j_scala$002ereflect$002eClassTag$0024GenericClassTag.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$9, ct); + + var __japgolly__hook5_raw = $i_react.useRef(null); + + $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook5_raw); + + var __japgolly__hook6_raw = $i_react.useRef(null); + + $j_japgolly$002escalajs$002ereact$002ehooks$002eAbstractHookMacros$0024.$m_Ljapgolly_scalajs_react_hooks_AbstractHookMacros$().helperRefToJsComponent__Ljapgolly_scalajs_react_Ref$FullF__F1__Ljapgolly_scalajs_react_Ref$ToComponentF($j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook6_raw), $j_japgolly$002escalajs$002ereact$002eRef$0024WithJsComponentArg$0024.$m_Ljapgolly_scalajs_react_Ref$WithJsComponentArg$().effectId__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__F1($m_Ljapgolly_scalajs_react_test_emissions_UseRef$().Ljapgolly_scalajs_react_test_emissions_UseRef$__f_jsComp)); + + var __japgolly__hook7_raw = $i_react.useRef(null); + + $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook7_raw).map__F1__Ljapgolly_scalajs_react_Ref$FullF(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$1$2 => new $j_japgolly$002escalajs$002ereact$002ecomponent$002eJs$0024$0024anon$00243.$c_Ljapgolly_scalajs_react_component_Js$$anon$3(x$1$2))); + + var __japgolly__hook8_raw = $i_react.useRef(null); + + $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook8_raw).map__F1__Ljapgolly_scalajs_react_Ref$FullF(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$2$2 => { + $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$(); + var this$13 = new $j_japgolly$002escalajs$002ereact$002ecomponent$002eJs$0024$0024anon$00243.$c_Ljapgolly_scalajs_react_component_Js$$anon$3(x$2$2); + return this$13; + })); + + var __japgolly__hook9_raw = $i_react.useRef(null); + + var c = $m_Ljapgolly_scalajs_react_test_emissions_UseRef$().Ljapgolly_scalajs_react_test_emissions_UseRef$__f_scalaComp; + var r = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook9_raw).map__F1__Ljapgolly_scalajs_react_Ref$FullF(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$3$2 => x$3$2.mountedImpure)); + $j_japgolly$002escalajs$002ereact$002eRef$0024ToComponent$0024.$m_Ljapgolly_scalajs_react_Ref$ToComponent$().inject__Ljapgolly_scalajs_react_CtorType__Ljapgolly_scalajs_react_Ref$FullF__Ljapgolly_scalajs_react_Ref$ToComponentF(c.ctor__Ljapgolly_scalajs_react_CtorType(), r); + + var __japgolly__hook10_raw = $i_react.useRef(null); + + $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook10_raw).map__F1__Ljapgolly_scalajs_react_Ref$FullF(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x$4$2 => x$4$2.mountedImpure)); + props.a; + return ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(123)).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; +}, "4YAVp10giPdDWy5crWN+hQ8h7yo="); +var $d_Ljapgolly_scalajs_react_test_emissions_UseRef$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseRef$: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseRef$", { + Ljapgolly_scalajs_react_test_emissions_UseRef$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseRef$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseRef$; +var $n_Ljapgolly_scalajs_react_test_emissions_UseRef$; + +function $m_Ljapgolly_scalajs_react_test_emissions_UseRef$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_UseRef$) { + $n_Ljapgolly_scalajs_react_test_emissions_UseRef$ = new $c_Ljapgolly_scalajs_react_test_emissions_UseRef$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_UseRef$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_UseRef$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/UseRef-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseRef-out3.js new file mode 100644 index 000000000..57a29d593 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseRef-out3.js @@ -0,0 +1,198 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024 from "./japgolly.scalajs.react.Ref$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024FullF from "./japgolly.scalajs.react.Ref$FullF.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024ToComponent$0024 from "./japgolly.scalajs.react.Ref$ToComponent$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eRef$0024WithJsComponentArg$0024 from "./japgolly.scalajs.react.Ref$WithJsComponentArg$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJs$0024$0024anon$00243 from "./japgolly.scalajs.react.component.Js$$anon$3.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScala$0024MountedWithRoot from "./japgolly.scalajs.react.component.Scala$MountedWithRoot.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eComponentBuilder$0024Step1 from "./japgolly.scalajs.react.component.builder.ComponentBuilder$Step1.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eComponentBuilder$0024Step2 from "./japgolly.scalajs.react.component.builder.ComponentBuilder$Step2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eComponentBuilder$0024Step3 from "./japgolly.scalajs.react.component.builder.ComponentBuilder$Step3.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eInitState$0024Stateless$0024 from "./japgolly.scalajs.react.component.builder.InitState$Stateless$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eAbstractHookMacros$0024 from "./japgolly.scalajs.react.hooks.AbstractHookMacros$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF from "./japgolly.scalajs.react.hooks.Hooks$UseRefF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002epackage$0024 from "./japgolly.scalajs.react.package$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024 from "./japgolly.scalajs.react.util.DefaultEffects$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_org$002escalajs$002edom$002eHTMLInputElement from "./org.scalajs.dom.HTMLInputElement.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; +import * as $j_scala$002eConversion from "./scala.Conversion.js"; +import * as $j_scala$002eFunction1 from "./scala.Function1.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseRef$() { + var _s = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_jsComp = null; + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_scalaComp = null; + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_UseRef$ = this; + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_jsComp = $j_japgolly$002escalajs$002ereact$002epackage$0024.$m_Ljapgolly_scalajs_react_package$().Ljapgolly_scalajs_react_internal_CoreGeneralF__f_JsComponent.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(null, $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonN__Ljapgolly_scalajs_react_internal_Singleton__Ljapgolly_scalajs_react_CtorType$Summoner($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$().Ljapgolly_scalajs_react_internal_Singleton$__f_Null)); + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_scalaComp = new $c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2().apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eComponentBuilder$0024Step1.$c_Ljapgolly_scalajs_react_component_builder_ComponentBuilder$Step1("japgolly.scalajs.react.test.emissions.UseRef")).render_P__F1__Ljapgolly_scalajs_react_component_builder_ComponentBuilder$LastStep(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(x => { + var x$1 = x | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + var x$2 = new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(x$1); + return x$2; + })).build__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot($j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null)); + + var rawComponent = props => { + _s(); + + var __japgolly__hook1_raw = $i_react.useRef(100); + + var this$6 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook1_raw, this$6.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + var $$x1 = $i_react; + var p = props.a | 0; + + var __japgolly__hook2_raw = $$x1.useRef(p); + + var this$8 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook2_raw, this$8.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + var props$1 = props.a; + + var __japgolly__hook3_raw = $i_react.useRef(props$1); + + var this$11 = $j_japgolly$002escalajs$002ereact$002eutil$002eDefaultEffects$0024.$m_Ljapgolly_scalajs_react_util_DefaultEffects$(); + new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseRefF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseRefF(__japgolly__hook3_raw, this$11.Ljapgolly_scalajs_react_util_DefaultEffects$__f_Sync); + + var __japgolly__hook4_raw = $i_react.useRef(null); + + var this$13 = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook4_raw); + var ct = new $j_scala$002eArray$0024.$c_s_reflect_ClassTag$GenericClassTag($j_org$002escalajs$002edom$002eHTMLInputElement.$d_Lorg_scalajs_dom_HTMLInputElement.getClassOf()); + $j_japgolly$002escalajs$002ereact$002eRef$0024FullF.$f_Ljapgolly_scalajs_react_Ref$FullF__narrowOption__s_reflect_ClassTag__Ljapgolly_scalajs_react_Ref$FullF(this$13, ct); + + var __japgolly__hook5_raw = $i_react.useRef(null); + + $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook5_raw); + + var __japgolly__hook6_raw = $i_react.useRef(null); + + $j_japgolly$002escalajs$002ereact$002ehooks$002eAbstractHookMacros$0024.$m_Ljapgolly_scalajs_react_hooks_AbstractHookMacros$().helperRefToJsComponent__Ljapgolly_scalajs_react_Ref$FullF__F1__Ljapgolly_scalajs_react_Ref$ToComponentF($j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook6_raw), $j_japgolly$002escalajs$002ereact$002eRef$0024WithJsComponentArg$0024.$m_Ljapgolly_scalajs_react_Ref$WithJsComponentArg$().effectId__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__F1(this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_jsComp)); + + var __japgolly__hook7_raw = $i_react.useRef(null); + + $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook7_raw).map__F1__Ljapgolly_scalajs_react_Ref$FullF(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$20 => new $j_japgolly$002escalajs$002ereact$002ecomponent$002eJs$0024$0024anon$00243.$c_Ljapgolly_scalajs_react_component_Js$$anon$3(_$20))); + + var __japgolly__hook8_raw = $i_react.useRef(null); + + $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook8_raw).map__F1__Ljapgolly_scalajs_react_Ref$FullF(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$21 => { + var this$16 = new $j_japgolly$002escalajs$002ereact$002ecomponent$002eJs$0024$0024anon$00243.$c_Ljapgolly_scalajs_react_component_Js$$anon$3(_$21); + return this$16; + })); + + var __japgolly__hook9_raw = $i_react.useRef(null); + + var c = this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_scalaComp; + var r = $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook9_raw).map__F1__Ljapgolly_scalajs_react_Ref$FullF(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$22 => _$22.mountedImpure)); + $j_japgolly$002escalajs$002ereact$002eRef$0024ToComponent$0024.$m_Ljapgolly_scalajs_react_Ref$ToComponent$().inject__Ljapgolly_scalajs_react_CtorType__Ljapgolly_scalajs_react_Ref$FullF__Ljapgolly_scalajs_react_Ref$ToComponentF(c.ctor__Ljapgolly_scalajs_react_CtorType(), r); + + var __japgolly__hook10_raw = $i_react.useRef(null); + + $j_japgolly$002escalajs$002ereact$002eRef$0024.$m_Ljapgolly_scalajs_react_Ref$().fromJs__Ljapgolly_scalajs_react_facade_React$RefHandle__Ljapgolly_scalajs_react_Ref$FullF(__japgolly__hook10_raw).map__F1__Ljapgolly_scalajs_react_Ref$FullF(new $j_scala$002eFunction1.$c_sjsr_AnonFunction1(_$22$2 => _$22$2.mountedImpure)); + props.a; + return ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(123)).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; + }; + + _s(rawComponent, "4YAVp10giPdDWy5crWN+hQ8h7yo="); + + var $$x2 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$22 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_UseRef$__f_Component = $$x2.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$22.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseRef$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseRef$; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseRef$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseRef$ }; +$h_Ljapgolly_scalajs_react_test_emissions_UseRef$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseRef$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_UseRef$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseRef$: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseRef$", { + Ljapgolly_scalajs_react_test_emissions_UseRef$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseRef$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseRef$; +var $n_Ljapgolly_scalajs_react_test_emissions_UseRef$; + +function $m_Ljapgolly_scalajs_react_test_emissions_UseRef$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_UseRef$) { + $n_Ljapgolly_scalajs_react_test_emissions_UseRef$ = new $c_Ljapgolly_scalajs_react_test_emissions_UseRef$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_UseRef$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_UseRef$ }; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1() {} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1 }; +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1.prototype = new $j_scala$002eConversion.$h_s_Conversion(); +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1 }; +$h_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1.prototype.apply__O__O = function (x) { + var _$1 = x === null ? null : x.Ljapgolly_scalajs_react_component_builder_ComponentBuilder$Step1__f_name; + + $m_Ljapgolly_scalajs_react_test_emissions_UseRef$(); + return new $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eComponentBuilder$0024Step2.$c_Ljapgolly_scalajs_react_component_builder_ComponentBuilder$Step2(_$1, $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eInitState$0024Stateless$0024.$m_Ljapgolly_scalajs_react_component_builder_InitState$Stateless$()); +}; + +var $d_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1 = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseRef$$anon$1", { + Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1: 1, + s_Conversion: 1, + O: 1, + F1: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1 }; +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2() {} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2 }; +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2.prototype = new $j_scala$002eConversion.$h_s_Conversion(); +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2 }; +$h_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2.prototype.apply__O__O = function (x) { + var x$1 = x === null ? null : x.Ljapgolly_scalajs_react_component_builder_ComponentBuilder$Step1__f_name; + $m_Ljapgolly_scalajs_react_test_emissions_UseRef$(); + return new $c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$1().apply__O__O(new $j_japgolly$002escalajs$002ereact$002ecomponent$002ebuilder$002eComponentBuilder$0024Step1.$c_Ljapgolly_scalajs_react_component_builder_ComponentBuilder$Step1(x$1)).noBackend__Ljapgolly_scalajs_react_component_builder_ComponentBuilder$Step3(); +}; + +var $d_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2 = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseRef$$anon$2", { + Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2: 1, + s_Conversion: 1, + O: 1, + F1: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2 }; +$c_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseRef$$anon$2; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/UseStateWithReuse-out2.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseStateWithReuse-out2.js new file mode 100644 index 000000000..22a3f7e58 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseStateWithReuse-out2.js @@ -0,0 +1,135 @@ +'use strict'; + +var _s = $RefreshSig$(); + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusability from "./japgolly.scalajs.react.Reusability.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF from "./japgolly.scalajs.react.hooks.Hooks$UseStateF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateWithReuseF from "./japgolly.scalajs.react.hooks.Hooks$UseStateWithReuseF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024 from "./japgolly.scalajs.react.internal.Singleton$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002ereflect$002eManifestFactory$0024IntManifest$0024 from "./scala.reflect.ManifestFactory$IntManifest$.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$() { + this.Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ = this; + + var rawComponent = arg1$2 => $m_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$().japgolly$scalajs$react$test$emissions$UseStateWithReuse$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar(arg1$2); + + var $$x1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$1 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(($j_japgolly$002escalajs$002ereact$002einternal$002eSingleton$0024.$m_Ljapgolly_scalajs_react_internal_Singleton$(), null)); + this.Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$__f_Component = $$x1.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$1.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ }; +$h_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype; + +$c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype.japgolly$scalajs$react$test$emissions$UseStateWithReuse$$$anonfun$Component$3__Ljapgolly_scalajs_react_internal_Box__Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__Ljapgolly_scalajs_react_internal_Box = function (props$1, __japgolly__hook1$1) { + var $$x2 = $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$(); + var $$x1 = props$1.a; + var this$1 = __japgolly__hook1$1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + return $$x2.apply__O__Ljapgolly_scalajs_react_internal_Box(($$x1 | 0) + (this$1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype.japgolly$scalajs$react$test$emissions$UseStateWithReuse$$$anonfun$Component$4__Ljapgolly_scalajs_react_hooks_HookCtx$P2__Ljapgolly_scalajs_react_internal_Box = function (__japgolly__hook3_ctx$1) { + var $$x3 = $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$(); + var $$x2 = __japgolly__hook3_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + var this$1 = __japgolly__hook3_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var this$2 = this$1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + var $$x1 = this$2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0]; + var this$3 = __japgolly__hook3_ctx$1.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + var this$4 = this$3.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + return $$x3.apply__O__Ljapgolly_scalajs_react_internal_Box((($$x2 | 0) + ($$x1 | 0) | 0) + (this$4.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0); +}; + +$c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype.japgolly$scalajs$react$test$emissions$UseStateWithReuse$$$anonfun$Component$1__Ljapgolly_scalajs_react_internal_Box__sjs_js_$bar = _s(function (props) { + _s(); + + var __japgolly__hook1_raw = $i_react.useState(() => { + $m_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$(); + return $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(123); + }); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var r = this$2.by_$eq$eq__F2(); + var ct = $j_scala$002ereflect$002eManifestFactory$0024IntManifest$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var rr = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$().reusabilityInstance__F2__Ljapgolly_scalajs_react_Reusable(r); + var this$6 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + var us = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__withReusability__F2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(this$6, r); + + var __japgolly__hook1 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateWithReuseF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF(us, rr, ct); + + var __japgolly__hook2_raw = $i_react.useState(() => $m_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$().japgolly$scalajs$react$test$emissions$UseStateWithReuse$$$anonfun$Component$3__Ljapgolly_scalajs_react_internal_Box__Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__Ljapgolly_scalajs_react_internal_Box(props, __japgolly__hook1)); + + var this$7 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var r$1 = this$7.by_$eq$eq__F2(); + var ct$1 = $j_scala$002ereflect$002eManifestFactory$0024IntManifest$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var rr$1 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$().reusabilityInstance__F2__Ljapgolly_scalajs_react_Reusable(r$1); + var this$11 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + var us$1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__withReusability__F2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(this$11, r$1); + + var __japgolly__hook2 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateWithReuseF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF(us$1, rr$1, ct$1); + + var props$1 = props.a; + + var __japgolly__hook3_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__hook3_raw = $i_react.useState(() => $m_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$().japgolly$scalajs$react$test$emissions$UseStateWithReuse$$$anonfun$Component$4__Ljapgolly_scalajs_react_hooks_HookCtx$P2__Ljapgolly_scalajs_react_internal_Box(__japgolly__hook3_ctx)); + + var this$13 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var r$2 = this$13.by_$eq$eq__F2(); + var ct$2 = $j_scala$002ereflect$002eManifestFactory$0024IntManifest$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var rr$2 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$().reusabilityInstance__F2__Ljapgolly_scalajs_react_Reusable(r$2); + var this$17 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook3_raw); + var us$2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__withReusability__F2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(this$17, r$2); + + var __japgolly__hook3 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateWithReuseF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF(us$2, rr$2, ct$2); + + props.a; + var this$19 = __japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + var $$x2 = this$19.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0]; + var this$20 = __japgolly__hook2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + var $$x1 = this$20.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0]; + var this$21 = __japgolly__hook3.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + var sum = (($$x2 | 0) + ($$x1 | 0) | 0) + (this$21.Ljapgolly_scalajs_react_hooks_Hooks$UseStateF$$anon$2__f_raw[0] | 0) | 0; + $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(); + $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(); + return new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; +}, "Xkkr0EQe1HWs2USGiA0+nJEiGtA="); +var $d_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseStateWithReuse$", { + Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$; +var $n_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$; + +function $m_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$) { + $n_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ = new $c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ }; diff --git a/library/testEmissions/jvm/src/test/resources/rr-sjr/UseStateWithReuse-out3.js b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseStateWithReuse-out3.js new file mode 100644 index 000000000..f68930184 --- /dev/null +++ b/library/testEmissions/jvm/src/test/resources/rr-sjr/UseStateWithReuse-out3.js @@ -0,0 +1,125 @@ +'use strict'; + +import * as $i_react from "react"; +import * as $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024 from "./japgolly.scalajs.react.CtorType$Summoner$.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusability from "./japgolly.scalajs.react.Reusability.js"; +import * as $j_japgolly$002escalajs$002ereact$002eReusable$0024 from "./japgolly.scalajs.react.Reusable$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024 from "./japgolly.scalajs.react.component.JsFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024 from "./japgolly.scalajs.react.component.ScalaFn$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2 from "./japgolly.scalajs.react.hooks.HookCtx$P2.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024 from "./japgolly.scalajs.react.hooks.Hooks$UseState$.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF from "./japgolly.scalajs.react.hooks.Hooks$UseStateF.js"; +import * as $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateWithReuseF from "./japgolly.scalajs.react.hooks.Hooks$UseStateWithReuseF.js"; +import * as $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024 from "./japgolly.scalajs.react.internal.Box$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024 from "./japgolly.scalajs.react.vdom.VdomNode$.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241 from "./japgolly.scalajs.react.vdom.VdomNode$$anon$1.js"; +import * as $j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024 from "./japgolly.scalajs.react.vdom.html_$less$up$.js"; +import * as $j_java$002elang$002eObject from "./java.lang.Object.js"; +import * as $j_scala$002eArray$0024 from "./scala.Array$.js"; + +function $c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$() { + var _s = $RefreshSig$(); + + this.Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$__f_Component = null; + $n_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ = this; + + var rawComponent = props => { + _s(); + + var __japgolly__hook1_raw = $i_react.useState(() => $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$().apply__O__Ljapgolly_scalajs_react_internal_Box(123)); + + var this$2 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var r = this$2.by_$eq$eq__F2(); + var ct = $j_scala$002eArray$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var rr = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$().reusabilityInstance__F2__Ljapgolly_scalajs_react_Reusable(r); + var this$7 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook1_raw); + var us = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__withReusability__F2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(this$7, r); + + var __japgolly__hook1 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateWithReuseF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF(us, rr, ct); + + var __japgolly__hook2_raw = $i_react.useState(() => { + var $$x1 = $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$(); + var p = props.a | 0; + var this$9 = __japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + return $$x1.apply__O__Ljapgolly_scalajs_react_internal_Box(p + (this$9.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0); + }); + + var this$10 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var r$1 = this$10.by_$eq$eq__F2(); + var ct$1 = $j_scala$002eArray$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var rr$1 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$().reusabilityInstance__F2__Ljapgolly_scalajs_react_Reusable(r$1); + var this$15 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook2_raw); + var us$1 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__withReusability__F2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(this$15, r$1); + + var __japgolly__hook2 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateWithReuseF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF(us$1, rr$1, ct$1); + + var props$1 = props.a; + + var __japgolly__hook3_ctx = $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$ct_Ljapgolly_scalajs_react_hooks_HookCtx$P2__O__O__O__(new $j_japgolly$002escalajs$002ereact$002ehooks$002eHookCtx$0024P2.$c_Ljapgolly_scalajs_react_hooks_HookCtx$P2(), props$1, __japgolly__hook1, __japgolly__hook2); + + var __japgolly__hook3_raw = $i_react.useState(() => { + var $$x4 = $j_japgolly$002escalajs$002ereact$002einternal$002eBox$0024.$m_Ljapgolly_scalajs_react_internal_Box$(); + var $$x3 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P0__f_props; + var this$18 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P1__f_hook1; + var this$19 = this$18.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + var $$x2 = this$19.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0]; + var this$20 = __japgolly__hook3_ctx.Ljapgolly_scalajs_react_hooks_HookCtx$P2__f_hook2; + var this$21 = this$20.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + return $$x4.apply__O__Ljapgolly_scalajs_react_internal_Box((($$x3 | 0) + ($$x2 | 0) | 0) + (this$21.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0); + }); + + var this$22 = $j_japgolly$002escalajs$002ereact$002eReusability.$m_Ljapgolly_scalajs_react_Reusability$(); + var r$2 = this$22.by_$eq$eq__F2(); + var ct$2 = $j_scala$002eArray$0024.$m_s_reflect_ManifestFactory$IntManifest$(); + var rr$2 = $j_japgolly$002escalajs$002ereact$002eReusable$0024.$m_Ljapgolly_scalajs_react_Reusable$().reusabilityInstance__F2__Ljapgolly_scalajs_react_Reusable(r$2); + var this$27 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseState$0024.$m_Ljapgolly_scalajs_react_hooks_Hooks$UseState$().fromJsBoxed__sjs_js_Tuple2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(__japgolly__hook3_raw); + var us$2 = $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateF.$f_Ljapgolly_scalajs_react_hooks_Hooks$UseStateF__withReusability__F2__Ljapgolly_scalajs_react_hooks_Hooks$UseStateF(this$27, r$2); + + var __japgolly__hook3 = new $j_japgolly$002escalajs$002ereact$002ehooks$002eHooks$0024UseStateWithReuseF.$c_Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF(us$2, rr$2, ct$2); + + props.a; + var this$30 = __japgolly__hook1.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + var $$x6 = this$30.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0]; + var this$31 = __japgolly__hook2.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + var $$x5 = this$31.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0]; + var this$32 = __japgolly__hook3.Ljapgolly_scalajs_react_hooks_Hooks$UseStateWithReuseF__f_withoutReuse; + var sum = (($$x6 | 0) + ($$x5 | 0) | 0) + (this$32.Ljapgolly_scalajs_react_hooks_Hooks$$anon$2__f_raw[0] | 0) | 0; + return ($j_japgolly$002escalajs$002ereact$002evdom$002ehtml$005f$0024less$0024up$0024.$m_Ljapgolly_scalajs_react_vdom_html_$less$up$(), $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024.$m_Ljapgolly_scalajs_react_vdom_VdomNode$(), new $j_japgolly$002escalajs$002ereact$002evdom$002eVdomNode$0024$0024anon$00241.$c_Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1(sum)).Ljapgolly_scalajs_react_vdom_VdomNode$$anon$1__f_n$1; + }; + + _s(rawComponent, "b1UXCkgOshr0vZNsvKdc+rQU/BM="); + + var $$x7 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eScalaFn$0024.$m_Ljapgolly_scalajs_react_component_ScalaFn$(); + var this$35 = $j_japgolly$002escalajs$002ereact$002ecomponent$002eJsFn$0024.$m_Ljapgolly_scalajs_react_component_JsFn$(); + var s = $j_japgolly$002escalajs$002ereact$002eCtorType$0024Summoner$0024.$m_Ljapgolly_scalajs_react_CtorType$Summoner$().summonP__Ljapgolly_scalajs_react_internal_Singleton$Not__Ljapgolly_scalajs_react_CtorType$Summoner(null); + this.Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$__f_Component = $$x7.fromBoxed__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(this$35.force__O__Ljapgolly_scalajs_react_CtorType$Summoner__Ljapgolly_scalajs_react_component_JsBaseComponentTemplate$ComponentWithRoot(rawComponent, s)); +} + +export { $c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype = new $j_java$002elang$002eObject.$h_O(); +$c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype.constructor = $c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$; + +function $h_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$() {} + +export { $h_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ }; +$h_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype = $c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype; +var $d_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ = new $j_java$002elang$002eObject.$TypeData().initClass({ + Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$: 0 +}, false, "japgolly.scalajs.react.test.emissions.UseStateWithReuse$", { + Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$: 1, + O: 1 +}); +export { $d_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ }; +$c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$.prototype.$classData = $d_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$; +var $n_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$; + +function $m_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$() { + if (!$n_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$) { + $n_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ = new $c_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$(); + } + + ; + return $n_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$; +} + +export { $m_Ljapgolly_scalajs_react_test_emissions_UseStateWithReuse$ }; diff --git a/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/EmissionTest.scala b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/EmissionTest.scala new file mode 100644 index 000000000..b7355a189 --- /dev/null +++ b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/EmissionTest.scala @@ -0,0 +1,79 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.microlibs.testutil.TestUtil._ +import japgolly.scalajs.react.test.emissions.util._ +import utest._ +import utest.framework.TestPath + +object EmissionTest extends TestSuite { + + override def tests = Tests { + + // "UseState" - testScala(hack = TestJs.Hack { _ + // .dropLinesUntil(_ endsWith " = function (props) {") + // .takeLinesTo(_ == "};") + // }.disable, golden = false) + + } + + // =================================================================================================================== + + /** Load scalajs-react output JS, and confirm the result. */ + protected def testScala(showResult : Boolean = false, + golden : Boolean = true, + normalise : Boolean = true, + hack : TestJs.Hack = null, + onCmp : TestJs.Hack = TestJs.Hack.forComparison, + expectedFrags: Seq[String] = Seq.empty) + (implicit tp : TestPath) = { + + val pkg = Props.rootPkg + val name = tp.value.last + val actualFilename = s"${Props.jsOutputDir}/$pkg.$name" + "$.js" + val tempFilename = s"${Props.tempDir}/$name.js" + val expectFilename = s"${Props.testResDir}/${Props.resSubdirScala}/$name-out${Props.scalaMajorVer}.js" + var utestOutput = () : Any + + val actual = { + + val filename = + if (normalise) { + Babel.normaliseToFile(actualFilename, tempFilename) + tempFilename + } else + actualFilename + + val js = new TestJs(name = name, filename = filename) + + // Make output much more readable, we're not testing the validity of SJS here + if (normalise) + TestJs.Hack.humanReadable.run(js) + + if (hack ne null) + hack.run(js) + + js.content + } + + try { + assertContainsAll(actual, expectedFrags: _*) + + if (golden) + Util.readOrCreateFile(expectFilename, actual) match { + case None => utestOutput = s"Created $expectFilename" + case Some(e) => + val actual2 = onCmp.runAs(name, actual).content + val expect2 = onCmp.runAs(name, e).content + assertMultiline(actual2, expect2) + } + + } finally { + val didNothing = !golden && expectedFrags.isEmpty + if (showResult || didNothing) + Util.debugShowContent(s"$name.scala JS", actual, "\u001b[107;30m", rrFlags = false) + } + + utestOutput + } + +} diff --git a/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/ReactRefreshTest.scala b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/ReactRefreshTest.scala new file mode 100644 index 000000000..c16447240 --- /dev/null +++ b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/ReactRefreshTest.scala @@ -0,0 +1,232 @@ +package japgolly.scalajs.react.test.emissions + +import japgolly.microlibs.testutil.TestUtil._ +import japgolly.microlibs.utils.FileUtils +import japgolly.scalajs.react.test.emissions.util._ +import java.lang.{Boolean => JBoolean} +import scala.Console._ +import scala.annotation.nowarn +import scala.util.Try +import utest._ +import utest.framework.TestPath + +object ReactRefreshTest extends TestSuite { + + override def tests = Tests { + + "js" - { + "fn" - testJs() + "hooks" - testJs() + "custom_hooks" - testJs() + // "temp" - testJs() + } + + "sjr" - { + "CustomHooks" - testScala(assertRR = false) // TODO: + "HooksPrimative" - testScala(assertRR = false) // TODO: + "HooksTrivial" - testScala() + "HooksWithChildrenCtxFn" - testScala() + "HooksWithChildrenCtxObj" - testScala() + "HooksWithJsFns" - testScala() + "HooksWithScalaFns" - testScala() + "JustPropsChildrenViaHookApi" - testScala(assertRR = false) // TODO: + "JustPropsViaHookApi" - testScala(assertRR = false) // TODO: + "RenderReusable" - testScala(expectedInstalls = 6) + "RenderWithReuse" - testScala(expectedInstalls = 6) + "RenderWithReuseBy" - testScala(expectedInstalls = 6) + "UseCallback" - testScala() + "UseEffect" - testScala() + "UseMemo" - testScala() + "UseRef" - testScala() + "UseStateWithReuse" - testScala() + } + + "version" - validateReactRefreshVersion() + } + + // =================================================================================================================== + + private var globalFailure = Option.empty[RuntimeException] + + private def ignoreReactRefreshUpdate(ver: String): Boolean = { + val ignore = Set[String]() + ignore.contains(ver) + } + + private def validateReactRefreshVersion(): Any = { + val r = Node.run("npm", "outdated") + r.exitStatus match { + case 0 => + // everything is up to date + case 1 => + r.out.linesIterator.find(_ startsWith "react-refresh ") match { + case None => + // react-refresh is up to date + case Some(line) => + val latest = line.split("\\s+")(3) + val msg = s"react-refresh is out-of-date. Latest version is $YELLOW_B$latest$RESET" + if (ignoreReactRefreshUpdate(latest)) + msg // render as test output + else { + val e = new RuntimeException(msg) + globalFailure = Some(e) + throw e + } + } + case _ => + r.assertExitStatus() + } + } + + private def preTest(): Unit = + globalFailure.foreach(throw _) + + /** Load a JS file in /resources/, run ReactRefresh transforms over it, and confirm the result. */ + protected def testJs()(implicit tp: TestPath) = { + preTest() + + val dir = Props.resSubdirJsRR + val name = tp.value.last + val base = s"${Props.testResDir}/$dir/$name" + val inFilename = s"$base-in.js" + val expectFilename = s"$base-out.js" + val tempFilename = s"${Props.tempDir}/$dir-$name-in.js" + val babel = Babel.dev(inFilename, tempFilename) + + // For temp code, just show the output on screen + if (name.matches(""".*\bte?mp\b.*""")) { + Util.debugShowContent(s"$inFilename ", babel.after, "\u001b[106;30m") + () + } else + babel.assertOrSaveOutput(expectFilename) match { + case () => testOutputFromSig(babel.after, null) + case r => r + } + } + + /** Load scalajs-react output JS, run ReactRefresh transforms over it, and confirm the result. */ + @nowarn("cat=unused") + protected def showScala(assertRR : JBoolean = null, + assertBabelChanges: JBoolean = null, + showPreBabel : Boolean = false, + showResult : Boolean = true, + showDiff : Boolean = true, + golden : Boolean = false, + hack : TestJs.Hack = null, + onCmp : TestJs.Hack = TestJs.Hack.forComparison, + onShow : TestJs.Hack = TestJs.Hack.humanReadable, + expectedInstalls : Int = 1, + expectedFrags : Seq[String] = Seq.empty) + (implicit tp : TestPath) = + testScala( + assertRR = null, + assertBabelChanges = null, + showPreBabel = showPreBabel, + showResult = showResult, + showDiff = showDiff, + golden = false, + hack = hack, + onCmp = onCmp, + onShow = onShow, + expectedInstalls = expectedInstalls, + expectedFrags = expectedFrags, + ) + + /** Load scalajs-react output JS, run ReactRefresh transforms over it, and confirm the result. */ + protected def testScala(assertRR : JBoolean = true, + assertBabelChanges: JBoolean = null, + showPreBabel : Boolean = false, + showResult : Boolean = false, + showDiff : Boolean = false, + golden : Boolean = true, + hack : TestJs.Hack = null, + onCmp : TestJs.Hack = TestJs.Hack.forComparison, + onShow : TestJs.Hack = TestJs.Hack.humanReadable, + expectedInstalls : Int = 1, + expectedFrags : Seq[String] = Seq.empty) + (implicit tp : TestPath) = { + preTest() + + val pkg = Props.rootPkg + val name = tp.value.last + val actualFilename = s"${Props.jsOutputDir}/$pkg.$name" + "$.js" + val tempFilename = s"${Props.tempDir}/$name.js" + val expectFilename = s"${Props.testResDir}/${Props.resSubdirScalaRR}/$name-out${Props.scalaMajorVer}.js" + var utestOutput = () : Any + + Babel.normaliseToFile(actualFilename, tempFilename) + + if (hack ne null) { + val js = new TestJs(name = name, filename = tempFilename) + hack.run(js) + if (js.changed()) + FileUtils.write(js.filename, js.content) + } + + val babel = + try + Babel.dev(tempFilename) + catch { + case t: Throwable => + Try { + val content = Util.needFileContent(tempFilename) + Util.debugShowContent(s"$name.scala JS pre-babel error", content, "\u001b[107;30m") + } + throw t + } + + try { + if (assertBabelChanges || (assertBabelChanges == null && assertRR)) + babel.assertChanged() + + if (assertRR) + babel.assertRR(true, expectedInstalls) + + if (assertRR == false) + babel.assertRR(false) + + babel.assertOutputContains(expectedFrags: _*) + + if (golden) + utestOutput = babel.assertOrSaveOutput(expectFilename, onCmp) + + if (utestOutput == ()) + utestOutput = testOutputFromSig(babel.after, assertRR) + + } finally { + def show(s: String): String = onShow.runAs(name, s).content + lazy val before = show(babel.before) + lazy val after = show(babel.after) + if (showPreBabel) + Util.debugShowContent(s"$name.scala JS pre-babel", before, "\u001b[107;30m", rrFlags = false) + if (showResult) + Util.debugShowContent(s"$name.scala JS post-babel", after, "\u001b[107;30m") + if (showDiff && (before !=* after)) + Util.debugShowDiff(before, after) + } + + utestOutput + } + + private val rrSigRegex = """^.*(?:_s.*|},) "([a-zA-Z0-9/+]{27}=)"(?:, .+|\);)?$""".r + + private def reactRefreshSignature(js: String): Option[String] = { + val all: String = + js.linesIterator.flatMap { + case rrSigRegex(h) => Some(h) + case _ => None + }.mkString(" / ") + + Option.when(all.nonEmpty)(all) + } + + private def testOutputFromSig(js: String, expect: JBoolean): Any = + if (expect == false) + // "react-refresh not installed" + "-" + else + reactRefreshSignature(js) match { + case Some(sig) => sig + case None => if (expect) "Failed to find the RefreshSig state id" else () + } +} diff --git a/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Babel.scala b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Babel.scala new file mode 100644 index 000000000..f282b4e75 --- /dev/null +++ b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Babel.scala @@ -0,0 +1,98 @@ +package japgolly.scalajs.react.test.emissions.util + +import japgolly.microlibs.testutil.TestUtil._ +import sourcecode.Line + +final case class Babel(before : String, + beforeFilename: String, + after : String) { + + def assertChanged()(implicit l: Line): Unit = + if (before ==* after) { + Util.debugShowContent(beforeFilename, before, "\u001b[43;30m") + fail("React Refresh Babel plugin didn't make any changes") + } + + def assertRR(expectInstalled: Boolean = true, expectedInstallations: Int = 1)(implicit l: Line): Unit = { + + // Presense + locally { + val actual = Util.containsRR(after) + if (actual !=* expectInstalled) { + showBadOutput() + assertEq("RR installed?", actual, expectInstalled) + } + } + + // Count installations + locally { + val actual = Util.countRR(after) + val expect = if (expectInstalled) expectedInstallations else 0 + if (actual !=* expect) { + showBadOutput() + assertEq("RR installations", actual, expect) + } + } + } + + def assertOutput(expect: String)(implicit l: Line): Unit = { + val name = beforeFilename.replaceFirst("^.+/(.+)\\.js$", "$1") + Util.assertJs(name, after, expect) + } + + def assertOutputContains(frags: String*)(implicit l: Line): Unit = + for (frag <- frags) + if (!after.contains(frag)) { + showBadOutput() + fail("Output doesn't contain: " + frag) + } + + private def showBadOutput(): Unit = + Util.debugShowContent(s"$beforeFilename ", after, "\u001b[43;30m") + + def assertOrSaveOutput(filename: String)(implicit l: Line): Any = + Util.readOrCreateFile(filename, after) match { + case None => s"Created $filename" + case Some(s) => assertOutput(s) + } + + def assertOrSaveOutput(filename: String, preCmpHack: TestJs.Hack)(implicit l: Line): Any = + Util.readOrCreateFile(filename, after) match { + case None => s"Created $filename" + case Some(e) => + val name = filename.replaceFirst("^.+/(.+?)(-out[23]?)?\\.js$", "$1") + Util.assertJs(name, after, e, preCmpHack) + } +} + +object Babel { + + def dev(origFilename: String, tempFilename: String): Babel = { + normaliseToFile(origFilename, tempFilename) + dev(tempFilename) + } + + def dev(filename: String): Babel = { + val before = Util.needFileContent(filename) + val after = Node.babel(filename, "--config-file=./babel.dev.json") + Babel( + before = before, + beforeFilename = filename, + after = after, + ) + } + + private def useCfgNorm = "--config-file=./babel.norm.json" + + def normaliseToStr(srcFilename: String): String = + if (Util.exists(srcFilename)) + Node.babel(srcFilename, useCfgNorm) + else + throw new RuntimeException("File not found: " + srcFilename) + + def normaliseToFile(srcFilename: String, tgtFilename: String): Unit = + if (Util.exists(srcFilename)) + Node.babel(srcFilename, useCfgNorm, "-o", tgtFilename) + else + throw new RuntimeException("File not found: " + srcFilename) +} diff --git a/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/MutableVirtualFile.scala b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/MutableVirtualFile.scala new file mode 100644 index 000000000..0f8e861cc --- /dev/null +++ b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/MutableVirtualFile.scala @@ -0,0 +1,132 @@ +package japgolly.scalajs.react.test.emissions.util + +import japgolly.microlibs.utils.FileUtils +import japgolly.univeq._ +import java.util.regex.Pattern +import scala.util.matching.Regex + +class MutableVirtualFile(val filenameOption: Option[String], val originalContent: String) { + import MutableVirtualFile.{LineTarget, StringFilterDsl} + + var content = originalContent + + def changed(): Boolean = + content !=* originalContent + + def set(newContent: String): this.type = { + content = newContent + this + } + + def modify(f: String => String): this.type = + set(f(content)) + + def modifyLines(f: String => String): this.type = + modifyLinesIterator(_.map(f)) + + def modifyLinesIterator(f: Iterator[String] => Iterator[String]): this.type = + set(f(content.linesIterator).mkString("\n") + "\n") + + def prepend(prefix: String): this.type = + set(prefix + content) + + def prependLine(newLine: String): this.type = + set(newLine + "\n" + content) + + def +=(newLine: String): this.type = + set(content + "\n" + newLine) + + def addLine(newLine: String, where: LineTarget): this.type = + where match { + case LineTarget.Start => prependLine(newLine) + case LineTarget.End => this += newLine + case LineTarget.Both => prependLine(newLine) += newLine + } + + def dropLines(n: Int): this.type = + modifyLinesIterator(_.drop(n)) + + def dropLinesTo: StringFilterDsl[this.type] = + StringFilterDsl(f => modifyLinesIterator(_.dropWhile(f))) + + def dropLinesUntil: StringFilterDsl[this.type] = + StringFilterDsl(f => modifyLinesIterator(_.dropWhile(!f(_)))) + + def dropLinesWhile: StringFilterDsl[this.type] = + StringFilterDsl(f => modifyLinesIterator(_.dropWhile(f))) + + def filter: StringFilterDsl[this.type] = + StringFilterDsl(f => modifyLinesIterator(_.filter(f))) + + def filterNot: StringFilterDsl[this.type] = + StringFilterDsl(f => modifyLinesIterator(_.filterNot(f))) + + def takeLines(n: Int): this.type = + modifyLinesIterator(_.take(n)) + + def takeLinesTo: StringFilterDsl[this.type] = + StringFilterDsl(f => modifyLinesIterator(_.takeWhile(delayMatchBy1(f)))) + + def takeLinesUntil: StringFilterDsl[this.type] = + StringFilterDsl(f => modifyLinesIterator(_.takeWhile(!f(_)))) + + def takeLinesWhile: StringFilterDsl[this.type] = + StringFilterDsl(f => modifyLinesIterator(_.takeWhile(f))) + + private def delayMatchBy1[A](f: A => Boolean): A => Boolean = { + var allow = true + a => { + if (allow && f(a)) { + allow = false + true + } else + allow + } + } + + def reset(): Unit = + content = originalContent + + def trim(): Unit = + set(content.trim + "\n") + + def descSize(): String = { + val total = content.linesIterator.size + val nonblank = content.linesIterator.count(_.trim.nonEmpty) + val blank = total - nonblank + s"$nonblank non-blank lines, $blank blank lines, $total total" + } +} + +object MutableVirtualFile { + + class FromFile(val filename: String, originalContent: String) extends MutableVirtualFile(Some(filename), originalContent) { + def this(filename: String) = + this(filename, Util.needFileContent(filename)) + + def writeFile(): Unit = + FileUtils.write(filename, content) + + def writeFileIfChanged(): Unit = + if (changed()) writeFile() + } + + final case class StringFilterDsl[A](private val run: (String => Boolean) => A) { + + def apply(f: String => Boolean): A = + run(f) + + def apply(r: Regex): A = + apply(r.pattern) + + def apply(p: Pattern): A = + apply(p.matcher(_).matches()) + } + + sealed trait LineTarget + object LineTarget { + case object Start extends LineTarget + case object End extends LineTarget + case object Both extends LineTarget + } +} diff --git a/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Node.scala b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Node.scala new file mode 100644 index 000000000..3522f976c --- /dev/null +++ b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Node.scala @@ -0,0 +1,31 @@ +package japgolly.scalajs.react.test.emissions.util + +import java.io.File +import scala.sys.process.Process +import scala.util.Try + +object Node { + private val dir = new File(Props.testRootDir + "/node") + + private val init = Try { + val cmd = Seq("npm", "install", "--no-audit", "--no-fund") + print(cmd.mkString("> ", " ", "")) + + val code = Process(cmd, dir).! + println() + + if (code != 0) + throw new ExceptionInInitializerError(s"`${cmd.mkString(" ")}` exited with $code") + } + + def run(cmd: String*): ProcessResult = { + val _ = init + ProcessResult(cmd, dir) + } + + def babel(args: String*): String = { + val res = run(("./node_modules/.bin/babel" +: args): _*) + res.assertExitStatus() + res.out + } +} diff --git a/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/ProcessResult.scala b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/ProcessResult.scala new file mode 100644 index 000000000..78ab83329 --- /dev/null +++ b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/ProcessResult.scala @@ -0,0 +1,47 @@ +package japgolly.scalajs.react.test.emissions.util + +import java.io.File +import scala.sys.process._ + +final case class ProcessResult(cmd: Seq[String], exitStatus: Int, out: String, err: String) { + + def assertExitStatus(is: Int = 0): Unit = + if (exitStatus != is) { + System.out.println(out) + System.out.flush() + System.err.println(err) + System.err.flush() + throw new RuntimeException(s"`${cmd.mkString(" ")}` exited with $exitStatus") + } +} + +object ProcessResult { + + def apply(cmd: Seq[String], cwd: File): ProcessResult = { + val p = Process(cmd, cwd) + val output = new Output + val code = p ! output.catpure + ProcessResult(cmd, code, output.out.value(), output.err.value()) + } + + private final class Output { + val out = new OutputStream + val err = new OutputStream + def catpure = ProcessLogger(out.capture, err.capture) + } + + private final class OutputStream { + private var sb: java.lang.StringBuilder = null + + def capture: String => Unit = line => { + if (sb eq null) + sb = new java.lang.StringBuilder + else + sb.append('\n') + sb.append(line) + } + + def value(): String = + if (sb eq null) "" else sb.toString() + } +} diff --git a/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Props.scala b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Props.scala new file mode 100644 index 000000000..d5d358921 --- /dev/null +++ b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Props.scala @@ -0,0 +1,37 @@ +package japgolly.scalajs.react.test.emissions.util + +object Props { + + def rootPkg = "japgolly.scalajs.react.test.emissions" + def moduleName = "testEmissions" + def resSubdirJsRR = "rr-js" + def resSubdirScala = "sjr" + def resSubdirScalaRR = "rr-sjr" + + val CI = Prop.get("CI").contains("1") + val jsOutputDir = Prop.need("jsOutputDir") + val scalaVer = Prop.need("scalaVer") + val tempDir = Prop.need("tempDir") + val testResDir = Prop.need("testResDir") + val testRootDir = Prop.need("testRootDir") + + val scalaMajorVer = scalaVer.takeWhile(_.isDigit).toInt + + // ------------------------------------------------------------------------------------------------------------------- + + private object Prop { + import scala.Console._ + + def get(property: String): Option[String] = { + val o = Option(System.getProperty(property)) + println(s"$CYAN[$moduleName] $property$RESET = $YELLOW${o.getOrElse("")}$RESET") + o + } + + def get(property: String, default: String): String = + get(property).getOrElse(default) + + def need(property: String): String = + get(property).getOrElse(throw new RuntimeException("Property not defined: " + property)) + } +} diff --git a/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/TestJs.scala b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/TestJs.scala new file mode 100644 index 000000000..148ced008 --- /dev/null +++ b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/TestJs.scala @@ -0,0 +1,114 @@ +package japgolly.scalajs.react.test.emissions.util + +import japgolly.scalajs.react.test.emissions.util.MutableVirtualFile.LineTarget + +// We're gonna inherit like it's 1999 baby! 🥳 +class TestJs(val name: String, val filename: String, originalContent: String) + extends MutableVirtualFile(Some(filename), originalContent) { + + def this(name: String, filename: String) = + this(name, filename, Util.needFileContent(filename)) + + def run(h: TestJs.Hack): Unit = + h.run(this) + + trim() +} + +object TestJs { + + case class Hack(run: TestJs => Unit) { + def >> (next: Hack) : Hack = Hack { js => run(js); next.run(js) } + def when (b: Boolean) : Hack = when(_ => b) + def when (f: TestJs => Boolean): Hack = Hack { js => if (f(js)) run(js) } + def unless(b: Boolean) : Hack = unless(_ => b) + def unless(f: TestJs => Boolean): Hack = when(!f(_)) + def disable : Hack = Hack.none + + def runAnon(jsContent: String): TestJs = + runAs("", "anon.js", jsContent) + + def runAs(name: String, jsContent: String): TestJs = + runAs(name, if (name.endsWith(".js")) name else name + ".js", jsContent) + + def runAs(name: String, filename: String, jsContent: String): TestJs = { + val js = new TestJs(name, filename, jsContent) + run(js) + js + } + } + + object Hack { + def none: Hack = + apply(_ => ()) + + // Make much more readable for human eyes. (Note: breaks the validity of the JS) + val humanReadable: Hack = { + + // Lines that simply initialise object singletons + val objectInit = """^ *(?:\$j_[a-zA-Z0-9_]+\$?\.)?\$m_[a-zA-Z0-9_]+\$\(\); *$""".r + + apply(_ + .modifyLines(_ + .replace("_", "_") + .replace("$0024", "$") + .replace("$002e", "_") // "." + .replace("$005f", "_") + .replace("$less$up", "") + .replace("japgolly_scalajs_react_", "sjr_") + .replace("japgolly$scalajs$react$", "sjr$") + .replaceAll("(\\$(?:\\$x)?)\\d+", "$10") // change `this$24` etc into just `this$0` + .replaceAll("scala_scalajs_runtime_(?=AnonFunction|WrappedVarArgs)", "") + ) + .filterNot(objectInit) + ) + } + + def addName(where: LineTarget): Hack = + apply { js => + if (js.name.nonEmpty) + js.addLine(s"// Name: ${js.name}", where) + } + + def addSizeDetails(where: LineTarget): Hack = + apply(js => js.addLine(s"// ${js.descSize()}", where)) + + private val comparisonHacks: Hack = + apply(_ + .filterNot(_ startsWith "import ") + .modify(_ + // Not sure why SJS sometimes emits one or the other of the following + + .replace("PropsChildren$", "PropsChildren") + + // Scala 3 only for some reason + .replace("$FirstStep.$", "$First.$") + + // idk if it's a Scala.js bug/undefined-behaviour or what, but there are often strange differences like the + // following for the same source code: + // + // $j_java_lang_Character$.$m_s_reflect_ManifestFactory$IntManifest$() + // $j_scala_reflect_ManifestFactory$IntManifest$.$m_s_reflect_ManifestFactory$IntManifest$() + // + // $j_sjr_Reusability.$m_Lsjr_Reusable$() + // $j_sjr_Reusable$.$m_Lsjr_Reusable$() + // + // etc + .replaceAll( + """\$j_[a-zA-Z_$]+\.(\$[mfp]_)""", + "$1" + ) + ) + ) + + // Hacks to apply before comparison so that + // 1) tests consitently pass + // 2) lots of irrelevant noise is filtered out when presenting failures + val forComparison: Hack = ( + humanReadable + >> comparisonHacks + >> addSizeDetails(LineTarget.End) + >> addName(LineTarget.End) + ) + } +} diff --git a/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Util.scala b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Util.scala new file mode 100644 index 000000000..f56e319e2 --- /dev/null +++ b/library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/Util.scala @@ -0,0 +1,250 @@ +package japgolly.scalajs.react.test.emissions.util + +import japgolly.microlibs.testutil.TestUtil._ +import japgolly.microlibs.utils.FileUtils +import java.io.{File, FileNotFoundException} +import java.nio.file.Files +import scala.annotation._ +import scala.io.Source +import scala.sys.process._ +import scala.util.Try +import sourcecode.Line + +object Util { + + def assertJs(actual: String, expect: String)(implicit l: Line): Unit = + assertJs("", actual, expect) + + def assertJs(name: String, actual: String, expect: String)(implicit l: Line): Unit = + assertJs(name, actual, expect, TestJs.Hack.forComparison) + + def assertJs(actual: String, expect: String, preCmpHack: TestJs.Hack)(implicit l: Line): Unit = + assertJs("", actual, expect, preCmpHack) + + def assertJs(name: String, actual: String, expect: String, preCmpHack: TestJs.Hack)(implicit l: Line): Unit = { + val a = preCmpHack.runAs(name, actual).content + val e = preCmpHack.runAs(name, expect).content + assertMultiline(name, actual = a, expect = e) + } + + // TODO: Update microlibs + // private def assertMultiline(actual: String, expect: String)(implicit q: Line): Unit = + // _assertMultiline(None, actual, expect) + + private def assertMultiline(name: => String, actual: String, expect: String)(implicit q: Line): Unit = + _assertMultiline(Some(name), actual, expect) + + private def _assertMultiline(name: => Option[String], actual: String, expect: String)(implicit q: Line): Unit = + if (actual != expect) withAtomicOutput { +import scala.io.AnsiColor._ +import japgolly.microlibs.testutil.TestUtilInternals._ +import japgolly.microlibs.testutil.LineDiff + println() + val EA = List(expect, actual).map(_.split("\n")) + val List(es, as) = EA : @nowarn + val lim = es.length max as.length + val List(maxAllE,_) = EA.map(x => (0 :: x.iterator.map(_.length).toList).max) : @nowarn + // val mismtachingLines = (es.iterator.zip(as.iterator)).filter { case (e,a) => e !=* a }.toList + // val maxDiffE = (0 :: mismtachingLines.map(_._1.length)).max + // val maxLimitE = 80 + // val maxE = if (maxAllE <= maxLimitE) maxAllE else if (maxLimitE >= maxDiffE) maxLimitE else maxDiffE + val maxLimitE = 114 // TODO: Make configurable by moving into config class + // TODO: Make colours configurable by moving into config class + // TODO: Make diffing logic configurable by moving into config class + // TODO: Now I now why I keep finding the colours confusing! diff:red=del,green=add, assert:red=bad,green=good + val maxE = maxAllE min maxLimitE + val maxL = lim.toString.length + if (maxL == 0 || maxE == 0) + assertEqO(name, actual, expect) + else { + val nameSuffix = name.fold(RESET)(s":$RESET " + _) + val fmtWSE = GREEN_B + BLACK + val fmtWSA = RED_B + BLACK + val fmtKOE = BLACK_B + BOLD_BRIGHT_GREEN + val fmtKOA = BLACK_B + BOLD_BRIGHT_RED + val cmp = if (as.length == es.length) "|" else if (es.length > as.length) ">" else "<" + println(s"${BRIGHT_YELLOW}assertMultiline$nameSuffix (${fmtKOE}expect$RESET $cmp ${fmtKOA}actual$RESET)") + + if (as.length == es.length) { + val fmtOK = s"${BRIGHT_BLACK}%${maxL}d: %-${maxE}s | | %s${RESET}\n" + val fmtWS = s"${WHITE}%${maxL}d: ${fmtWSE}%-${maxE}s${RESET}${WHITE} |≈| ${fmtWSA}%s${RESET}\n" + val fmtKO = s"${WHITE}%${maxL}d: ${fmtKOE}%-${maxE}s${RESET}${WHITE} |≠| ${fmtKOA}%s${RESET}\n" + def removeWhitespace(s: String) = s.filterNot(_.isWhitespace) + for (i <- 0 until lim) { + val List(e, a) = EA.map(s => if (i >= s.length) "" else s(i)) : @nowarn + + // val (fmt, a2, e2) = + // if (a == e) + // (fmtOK, a.take(maxA), e.take(maxA)) + // else if (removeWhitespace(a) == removeWhitespace(e)) + // (fmtWS, a.take(maxA), e.take(maxA)) + // else + // (fmtKO, a, e) + // printf(fmt, i + 1, a2, e2) + + val (fmt, truncate) = + if (a == e) + (fmtOK, true) // TODO: Make `true` configurable by moving into config class + else if (removeWhitespace(a) == removeWhitespace(e)) + (fmtWS, true) // TODO: Make `true` configurable by moving into config class + else + (fmtKO, false) // TODO: Make `true` configurable by moving into config class + + val l = i + 1 + val w = maxE + @tailrec def go(x: String, y: String, fmt2: Option[String]): Unit = { + fmt2 match { + case None => printf(fmt, l, x.take(w), y.take(w)) + case Some(f) => printf(f, x.take(w), y.take(w)) + } + val hasMore = (x.length max y.length) > w + if (hasMore && !truncate) { + def newFmt = fmt.replace(s"%${maxL}d:", " " * (maxL + 1)) + go(x.drop(w), y.drop(w), fmt2.orElse(Some(newFmt))) + } + } + go(e, a, None) + } + } else { + println(LineDiff(expect, actual).expectActualColoured) + println(BRIGHT_YELLOW + ("-" * 120) + RESET) + } + println() + fail("assertMultiline failed.") + } + } + + def containsRR(content: String): Boolean = + content.contains("$RefreshSig$") || content.contains("$RefreshReg$") + + def countRR(content: String): Int = + countSubstringOccurances(content, "$RefreshSig$()") + + def countSubstringOccurances(str: String, substr: String): Int = { + @tailrec + def go(s: String, n: Int): Int = { + val i = s.indexOf(substr) + if (i >= 0) + go(s.drop(i + substr.length), n + 1) + else + n + } + go(str, 0) + } + + def debugShowContent(name: String, content: String, colour: String, rrFlags: Boolean = true): Unit = { + val batPath = "/usr/bin/bat" + var useBat = exists(batPath) + + val rrDesc = + if (rrFlags) { + val rr = containsRR(content) + val flags = if (rr) "\u001b[102;30m[RR:Y]" else "\u001b[101;97m[RR:N]" + flags + Console.RESET + " " + } else + "" + + val sep = "=" * (name.length + (if (rrFlags) 7 else 0)) + + val content2 = { + val sb = new java.lang.StringBuilder + val ignore = """^(?:['"]use strict|import ).*""".r + var showBlanks = false + var show = false + for (line <- content.trim.linesIterator) { + show = true + + if (line.trim.isEmpty) + show = showBlanks + else if (ignore.matches(line)) + show = false + + if (show) { + sb.append(line) + sb.append('\n') + showBlanks = true + } + } + sb.toString() + } + + println(sep) + println(rrDesc + colour + name + Console.RESET) + println(sep) + if (useBat) { + val f = writeToTempFile(".js")(content2) + val t = Try { Seq(batPath, "-pp", "--color=always", f).! } + if (!t.toOption.contains(0)) + useBat = false + } + if (!useBat) { + print(colour) + println(content2) + } + println(Console.RESET + sep) + println() + } + + def debugShowDiff(content1: String, content2: String): Unit = { + var diffPath = "/usr/bin/colordiff" + if (!exists(diffPath)) + diffPath = "diff" + + val file1 = writeToTempFile("")(content1) + val file2 = writeToTempFile("")(content2) + + val sep = Console.YELLOW_B + Console.BLACK + ("=" * 120) + Console.RESET + println(sep) + Seq(diffPath, "-uw", file1, file2).#|(Seq("tail", "+3")).! + println(sep) + } + + def exists(filename: String): Boolean = + (new File(filename)).exists() + + def getFileContent(path: String): Option[String] = { + val f = new File(path) + Option.when(f.exists())(readSource(Source.fromFile(f))) + } + + def needFileContent(path: String): String = + readSource(Source.fromFile(new File(path))) + + def needResourceContent(path: String): String = { + getClass.getResourceAsStream(path) match { + case null => throw new FileNotFoundException("cp:" + path) + case is => try readSource(Source.fromInputStream(is)) finally is.close() + } + } + + def readOrCreateFile[A](filename: String, create: => String): Option[String] = + getFileContent(filename) match { + + // If no file exists, create it + case None => + if (Props.CI) + throw new RuntimeException(s"File not found: $filename. This file should've been checked in to git.") + println(s"File not found, creating: $filename") + FileUtils.write(filename, create) + None + + // File exists + case s@ Some(_) => + s + } + + private def readSource(src: => Source): String = { + val s = src + try s.mkString finally s.close() + } + + def writeToTempFile(fileSuffix: String)(content: String): String = { + val p = Files.createTempFile("sjr-emissions-", fileSuffix) + val f = p.toFile() + val d = f.getAbsolutePath() + FileUtils.write(d, content) + f.deleteOnExit() + d + } + +} diff --git a/library/tests/src/test/scala-2/japgolly/scalajs/react/core/ScalaSpecificHooksTest.scala b/library/tests/src/test/scala-2/japgolly/scalajs/react/core/ScalaSpecificHooksTest.scala index 8e9fbc3d2..fbf9e53a9 100644 --- a/library/tests/src/test/scala-2/japgolly/scalajs/react/core/ScalaSpecificHooksTest.scala +++ b/library/tests/src/test/scala-2/japgolly/scalajs/react/core/ScalaSpecificHooksTest.scala @@ -11,7 +11,6 @@ object ScalaSpecificHooksTest { // This is the original version def testCustomHook(): Unit = { val counter = new Counter - val hookS = CustomHook[Int].useStateBy(identity).buildReturning(_.hook1) val hookE = CustomHook[Int].useEffectBy(counter.incCB(_)).build @@ -39,4 +38,34 @@ object ScalaSpecificHooksTest { } } + // Copy of above but using renderRR + def testCustomHookRR(): Unit = { + val counter = new Counter + val hookS = CustomHook[Int].useStateBy(identity).buildReturning(_.hook1) + val hookE = CustomHook[Int].useEffectBy(counter.incCB(_)).build + + val comp = ScalaFnComponent.withHooks[PI] + .custom(hookE(10)) + .custom(hookS(3)) // <--------------------------------------- s1 + .custom(hookS.contramap[PI](_.pi)) // <---------------------- s2 + .customBy((p, s, _) => hookE(p.pi + s.value)) + .customBy($ => hookS($.props.pi + $.hook1.value + 1)) // <--- s3 + .customBy($ => hookE($.props.pi + $.hook1.value + 1)) + .renderRR((_, s1, s2, s3) => + <.div( + s"${s1.value}:${s2.value}:${s3.value}", + <.button(^.onClick --> s1.modState(_ + 1)) + ) + ) + + test(comp(PI(5))) { t => + t.assertText("3:5:9") + assertEq(counter.value, 10 + (5+3) + (5+3+1)) + counter.value = 0 + t.clickButton() + t.assertText("4:5:9") + assertEq(counter.value, 10 + (5+4) + (5+4+1)) + } + } + } diff --git a/library/tests/src/test/scala-3/japgolly/scalajs/react/core/ScalaSpecificHooksTest.scala b/library/tests/src/test/scala-3/japgolly/scalajs/react/core/ScalaSpecificHooksTest.scala index 6ca6215d6..c804ddc12 100644 --- a/library/tests/src/test/scala-3/japgolly/scalajs/react/core/ScalaSpecificHooksTest.scala +++ b/library/tests/src/test/scala-3/japgolly/scalajs/react/core/ScalaSpecificHooksTest.scala @@ -11,7 +11,6 @@ object ScalaSpecificHooksTest { // I swapped the order of the last two hooks to avoid use of a CtxFn after a DynamicNextStep. def testCustomHook(): Unit = { val counter = new Counter - val hookS = CustomHook[Int].useStateBy(identity).buildReturning(_.hook1) val hookE = CustomHook[Int].useEffectBy(counter.incCB(_)).build @@ -39,4 +38,35 @@ object ScalaSpecificHooksTest { } } + + // Copy of above but using renderRR + def testCustomHookRR(): Unit = { + val counter = new Counter + val hookS = CustomHook[Int].useStateBy(identity).buildReturning(_.hook1) + val hookE = CustomHook[Int].useEffectBy(counter.incCB(_)).build + + val comp = ScalaFnComponent.withHooks[PI] + .custom(hookE(10)) + .custom(hookS(3)) // <--------------------------------------- s1 + .custom(hookS.contramap[PI](_.pi)) // <---------------------- s2 + .customBy((p, s, _) => hookE(p.pi + s.value)) + .customBy($ => hookE($.props.pi + $.hook1.value + 1)) + .customBy($ => hookS($.props.pi + $.hook1.value + 1)) // <--- s3 + .renderRR((_, s1, s2, s3) => + <.div( + s"${s1.value}:${s2.value}:${s3.value}", + <.button(^.onClick --> s1.modState(_ + 1)) + ) + ) + + test(comp(PI(5))) { t => + t.assertText("3:5:9") + assertEq(counter.value, 10 + (5+3) + (5+3+1)) + counter.value = 0 + t.clickButton() + t.assertText("4:5:9") + assertEq(counter.value, 10 + (5+4) + (5+4+1)) + } + } + } diff --git a/library/tests/src/test/scala/japgolly/scalajs/react/core/HooksRRTest.scala b/library/tests/src/test/scala/japgolly/scalajs/react/core/HooksRRTest.scala new file mode 100644 index 000000000..08b72f7d3 --- /dev/null +++ b/library/tests/src/test/scala/japgolly/scalajs/react/core/HooksRRTest.scala @@ -0,0 +1,1728 @@ +package japgolly.scalajs.react.core + +import japgolly.scalajs.react.Hooks.UseEffectArg +import japgolly.scalajs.react._ +import japgolly.scalajs.react.extra._ +import japgolly.scalajs.react.test.DomTester +import japgolly.scalajs.react.test.ReactTestUtils._ +import japgolly.scalajs.react.test.TestUtil._ +import japgolly.scalajs.react.vdom.html_<^._ +import scala.annotation._ +import scala.scalajs.js +import org.scalajs.dom.Node +import org.scalajs.dom.html.Input +import utest._ + + +// Based off of HooksTest but +// - uses renderRR +// - includes compilation tests for trivial useRef hooks missing from HooksTest +object HooksRRTest extends TestSuite { + + // TODO: https://github.com/lampepfl/dotty/issues/12663 + // Should be private ↓ + def test[M, A](u: Unmounted[M])(f: DomTester => A): A = + withRenderedIntoBody(u).withParent(root => f(new DomTester(root))) + + private val incBy1 = Reusable.byRef((_: Int) + 1) + private val incBy5 = Reusable.byRef((_: Int) + 5) + + // TODO: https://github.com/lampepfl/dotty/issues/12663 + // Should be private or moved elsewhere ↓ + final class Counter { + var value = 0 + def inc(by: Int = 1): Int = { + value += by + value + } + def incCB : Callback = incCB(1) + def incCB(by: Int): Callback = Callback{ inc(by); () } + } + + private final class Recorder[A] { + var values = Vector.empty[A] + def add(as: A*): Unit = values ++= as + def addCB(as: A*): Callback = {val x = as.toList; Callback(add(x: _*))} + } + + // TODO: https://github.com/lampepfl/dotty/issues/12663 + // Should be private ↓ + final case class PI(pi: Int) { + def unary_- : PI = PI(-pi) + def *(n: Int): PI = PI(pi * n) + def +(n: Int): PI = PI(pi + n) + def +(n: PI): PI = PI(pi + n.pi) + } + + private final class ReusableSetIntComponent { + private var renders = 0 + def render(f: Reusable[Int => Callback]) = { + renders += 1 + <.div(renders, + <.button(^.onClick --> f(1)), + <.button(^.onClick --> f(2)), + ) + } + } + private val ReusableSetIntComponent = + ScalaComponent.builder[Reusable[Int => Callback]] + .renderBackend[ReusableSetIntComponent] + .configure(Reusability.shouldComponentUpdate) + .build + + private final class ReusableModIntComponent { + private var renders = 0 + def render(f: Reusable[(Int => Int) => Callback]) = { + renders += 1 + <.div(renders, + <.button(^.onClick --> f(_ + 1)), + <.button(^.onClick --> f(_ + 10)), + ) + } + } + private val ReusableModIntComponent = + ScalaComponent.builder[Reusable[(Int => Int) => Callback]] + .renderBackend[ReusableModIntComponent] + .configure(Reusability.shouldComponentUpdate) + .build + + private final class ReusableCallbackComponent { + private var renders = 0 + def render(p: Reusable[Callback]) = { + renders += 1 + <.div(renders, <.button(^.onClick --> p)) + } + } + private val ReusableCallbackComponent = + ScalaComponent.builder[Reusable[Callback]] + .renderBackend[ReusableCallbackComponent] + .configure(Reusability.shouldComponentUpdate) + .build + + private final class ReusableStateSnapshotComponent { + private var renders = 0 + def render(s: StateSnapshot[Int]) = { + renders += 1 + <.div(s"${s.value}:$renders", + <.button(^.onClick --> s.modState(_ + 1)), + <.button(^.onClick --> s.modState(_ + 10)), + ) + } + } + private val ReusableStateSnapshotComponent = + ScalaComponent.builder[StateSnapshot[Int]] + .renderBackend[ReusableStateSnapshotComponent] + .configure(Reusability.shouldComponentUpdate) + .build + + // =================================================================================================================== + + private def testProps(): Unit = { + val comp = ScalaFnComponent.withHooks[Int] + .renderRR(_ + 1) + + test(comp(3))(_ assertText "4") + } + + private def testPropsChildren(): Unit = { + val inner = ScalaFnComponent.withHooks[Int] + .withPropsChildren + .renderRR((p, c) => <.div(p + 1, " | ", c)) + + val comp = ScalaFnComponent[Int] { p => inner(p * 10)(<.p("yo!")) } + + test(comp(3))(_ assertText "31 | yo!") + } + + private def testCustomHook(): Unit = { + // TODO: https://github.com/lampepfl/dotty/issues/12663 + ScalaSpecificHooksTest.testCustomHookRR() + + // val counter = new Counter + + // val hookS = CustomHook[Int].useStateBy(identity).buildReturning(_.hook1) + // val hookE = CustomHook[Int].useEffectBy(counter.incCB(_)).build + + // val comp = ScalaFnComponent.withHooks[PI] + // .custom(hookE(10)) + // .custom(hookS(3)) // <--------------------------------------- s1 + // .custom(hookS.contramap[PI](_.pi)) // <---------------------- s2 + // .customBy((p, s, _) => hookE(p.pi + s.value)) + // .customBy($ => hookS($.props.pi + $.hook1.value + 1)) // <--- s3 + // .customBy($ => hookE($.props.pi + $.hook1.value + 1)) + // .renderRR((p, s1, s2, s3) => + // <.div( + // s"${s1.value}:${s2.value}:${s3.value}", + // <.button(^.onClick --> s1.modState(_ + 1)) + // ) + // ) + + // test(comp(PI(5))) { t => + // t.assertText("3:5:9") + // assertEq(counter.value, 10 + (5+3) + (5+3+1)) + // counter.value = 0 + // t.clickButton() + // t.assertText("4:5:9") + // assertEq(counter.value, 10 + (5+4) + (5+4+1)) + // } + } + + private def testCustomHookComposition(): Unit = { + locally { + type LL = CustomHook[Long, Long] + type II = CustomHook[Int, Int] + type IU = CustomHook[Int, Unit] + type UI = CustomHook[Unit, Int] + type UU = CustomHook[Unit, Unit] + type TF = CustomHook[3, 4] + type FT = CustomHook[4, 3] + + assertType[(II, LL)].map(h => h._1 ++ h._2).is[CustomHook[(Int, Long), (Int, Long)]] + assertType[(II, TF)].map(h => h._1 ++ h._2).is[CustomHook[(Int, 3), (Int, 4)]] + assertType[(II, II)].map(h => h._1 ++ h._2).is[CustomHook[Int, (Int, Int)]] + assertType[(II, IU)].map(h => h._1 ++ h._2).is[CustomHook[Int, Int]] + assertType[(II, UI)].map(h => h._1 ++ h._2).is[CustomHook[Int, (Int, Int)]] + assertType[(II, UU)].map(h => h._1 ++ h._2).is[CustomHook[Int, Int]] + + assertType[(IU, LL)].map(h => h._1 ++ h._2).is[CustomHook[(Int, Long), Long]] + assertType[(IU, TF)].map(h => h._1 ++ h._2).is[CustomHook[(Int, 3), 4]] + assertType[(IU, II)].map(h => h._1 ++ h._2).is[CustomHook[Int, Int]] + assertType[(IU, IU)].map(h => h._1 ++ h._2).is[CustomHook[Int, Unit]] + assertType[(IU, UI)].map(h => h._1 ++ h._2).is[CustomHook[Int, Int]] + assertType[(IU, UU)].map(h => h._1 ++ h._2).is[CustomHook[Int, Unit]] + + assertType[(UI, LL)].map(h => h._1 ++ h._2).is[CustomHook[Long, (Int, Long)]] + assertType[(UI, TF)].map(h => h._1 ++ h._2).is[CustomHook[3, (Int, 4)]] + assertType[(UI, II)].map(h => h._1 ++ h._2).is[CustomHook[Int, (Int, Int)]] + assertType[(UI, IU)].map(h => h._1 ++ h._2).is[CustomHook[Int, Int]] + assertType[(UI, UI)].map(h => h._1 ++ h._2).is[CustomHook[Unit, (Int, Int)]] + assertType[(UI, UU)].map(h => h._1 ++ h._2).is[CustomHook[Unit, Int]] + + assertType[(UU, LL)].map(h => h._1 ++ h._2).is[CustomHook[Long, Long]] + assertType[(UU, TF)].map(h => h._1 ++ h._2).is[CustomHook[3, 4]] + assertType[(UU, II)].map(h => h._1 ++ h._2).is[CustomHook[Int, Int]] + assertType[(UU, IU)].map(h => h._1 ++ h._2).is[CustomHook[Int, Unit]] + assertType[(UU, UI)].map(h => h._1 ++ h._2).is[CustomHook[Unit, Int]] + assertType[(UU, UU)].map(h => h._1 ++ h._2).is[CustomHook[Unit, Unit]] + + assertType[(LL, LL)].map(h => h._1 ++ h._2).is[CustomHook[Long, (Long, Long)]] + assertType[(LL, II)].map(h => h._1 ++ h._2).is[CustomHook[(Long, Int), (Long, Int)]] + assertType[(LL, IU)].map(h => h._1 ++ h._2).is[CustomHook[(Long, Int), Long]] + assertType[(LL, UI)].map(h => h._1 ++ h._2).is[CustomHook[Long, (Long, Int)]] + assertType[(LL, UU)].map(h => h._1 ++ h._2).is[CustomHook[Long, Long]] + + assertType[(TF, FT)].map(h => h._1 ++ h._2).is[CustomHook[(3, 4), (4, 3)]] + assertType[(TF, II)].map(h => h._1 ++ h._2).is[CustomHook[(3, Int), (4, Int)]] + assertType[(TF, IU)].map(h => h._1 ++ h._2).is[CustomHook[(3, Int), 4]] + assertType[(TF, LL)].map(h => h._1 ++ h._2).is[CustomHook[(3, Long), (4, Long)]] + assertType[(TF, TF)].map(h => h._1 ++ h._2).is[CustomHook[3, 4]] + assertType[(TF, UI)].map(h => h._1 ++ h._2).is[CustomHook[3, (4, Int)]] + assertType[(TF, UU)].map(h => h._1 ++ h._2).is[CustomHook[3, 4]] + + assertType[(FT, FT)].map(h => h._1 ++ h._2).is[CustomHook[4, 3]] + assertType[(FT, II)].map(h => h._1 ++ h._2).is[CustomHook[(4, Int), (3, Int)]] + assertType[(FT, IU)].map(h => h._1 ++ h._2).is[CustomHook[(4, Int), 3]] + assertType[(FT, LL)].map(h => h._1 ++ h._2).is[CustomHook[(4, Long), (3, Long)]] + assertType[(FT, TF)].map(h => h._1 ++ h._2).is[CustomHook[(4, 3), (3, 4)]] + assertType[(FT, UI)].map(h => h._1 ++ h._2).is[CustomHook[4, (3, Int)]] + assertType[(FT, UU)].map(h => h._1 ++ h._2).is[CustomHook[4, 3]] + } + + val ints = new Recorder[Int] + + val addII = CustomHook[Int].useEffectBy(ints.addCB(_)).buildReturning(identity) + val addI_ = addII.map(_ => ()).contramap[Int](_ * 10) + val add_S = CustomHook[Unit].useEffect(ints.addCB(100)).buildReturning(_ => "ah") + + val hook = addII ++ addI_ ++ add_S + val _ : CustomHook[Int, (Int, String)] = hook + + val comp = ScalaFnComponent.withHooks[PI] + .customBy(p => hook(p.pi)) + .renderRR((_, h) => h.toString) + + test(comp(PI(3))) { t => + t.assertText("(3,ah)") + } + assertEq(ints.values, Vector(3, 30, 100)) + } + + private def testLazyVal(): Unit = { + val counter = new Counter + val comp = ScalaFnComponent.withHooks[PI] + .localLazyVal(counter.inc()) + .localLazyValBy((p, _) => p.pi + counter.inc()) + .localLazyValBy($ => $.props.pi + counter.inc()) + .useState(123) + .renderRR { (p, f1, f2, f3, s) => + val v3 = f3() + val v2 = f2() + val v1 = f1() + <.div( + <.div(s"P=$p, v1=$v1, v2=$v2, v3=$v3"), + <.button(^.onClick --> s.modState(_ + 1))) + } + + test(comp(PI(10))) { t => + t.assertText("P=PI(10), v1=3, v2=12, v3=11") + t.clickButton(); t.assertText("P=PI(10), v1=6, v2=15, v3=14") + } + } + + private def testVal(): Unit = { + val counter = new Counter + val comp = ScalaFnComponent.withHooks[PI] + .localVal(counter.inc()) + .localValBy((p, _) => p.pi + counter.inc()) + .localValBy($ => $.props.pi + counter.inc()) + .useState(123) + .renderRR { (p, v1, v2, v3, s) => + <.div( + <.div(s"P=$p, v1=$v1, v2=$v2, v3=$v3"), + <.button(^.onClick --> s.modState(_ + 1))) + } + + test(comp(PI(10))) { t => + t.assertText("P=PI(10), v1=1, v2=12, v3=13") + t.clickButton(); t.assertText("P=PI(10), v1=4, v2=15, v3=16") + } + } + + private def testVar(): Unit = { + val counter = new Counter + val comp = ScalaFnComponent.withHooks[PI] + .localVar(counter.inc()) + .localVarBy((p, _) => p.pi + counter.inc()) + .localVarBy($ => $.props.pi + counter.inc()) + .useState(123) + .renderRR { (p, v1, v2, v3, s) => + v1.value += 100 + v2.value += 100 + v3.value += 100 + <.div( + <.div(s"P=$p, v1=${v1.value}, v2=${v2.value}, v3=${v3.value}"), + <.button(^.onClick --> s.modState(_ + 1))) + } + + test(comp(PI(10))) { t => + t.assertText("P=PI(10), v1=101, v2=112, v3=113") + t.clickButton(); t.assertText("P=PI(10), v1=104, v2=115, v3=116") + } + } + + private def testUnchecked(): Unit = { + val counterE = new Counter + val counterS = new Counter + + val comp = ScalaFnComponent.withHooks[PI] + .unchecked{counterE.inc(10); ()} + .unchecked(counterS.inc(3)) + .uncheckedBy((p, _) => counterS.inc(p.pi)) + .uncheckedBy((p, s, _) => {counterE.inc(p.pi + s); ()}) + .uncheckedBy($ => counterS.inc($.props.pi + $.hook1 + 1)) + .uncheckedBy($ => {counterE.inc($.props.pi + $.hook1 + 1); ()}) + .useState(0) + .renderRR((_, s1, s2, s3, x) => + <.div( + s"$s1:$s2:$s3", + <.button(^.onClick --> x.modState(_ + 1)) + ) + ) + + test(comp(PI(5))) { t => + t.assertText("3:8:17") + assertEq(counterE.value, 10 + (5+3) + (5+3+1)) + counterE.value = 0 + t.clickButton() + t.assertText("20:25:51") // +3 : +5 : +(5+20+1) + assertEq(counterE.value, 10 + (5+20) + (5+20+1)) + } + } + + private def testUseCallback(): Unit = { + val counter = new Counter + val comp = ScalaFnComponent.withHooks[Unit] + .useCallback(counter.incCB(9)) + .useCallback((i: Int) => counter.incCB(i)) + .useState(0) + .renderRR((_, c1, c2, s) => + <.div( + "S=", counter.value, + ", R1=", ReusableCallbackComponent(c1), + ", R2=", ReusableSetIntComponent(c2), + <.button(^.onClick --> s.modState(_ + 1)) + ) + ) + + val inc9 = 1 + val inc1 = 2 + val inc2 = 3 + val rndr = 4 + + test(comp()) { t => + assertEq(counter.value, 0); t.assertText("S=0, R1=1, R2=1") + t.clickButton(inc1); assertEq(counter.value, 1); t.assertText("S=0, R1=1, R2=1") + t.clickButton(inc9); assertEq(counter.value, 10); t.assertText("S=0, R1=1, R2=1") + t.clickButton(inc2); assertEq(counter.value, 12); t.assertText("S=0, R1=1, R2=1") + t.clickButton(rndr); assertEq(counter.value, 12); t.assertText("S=12, R1=1, R2=1") + } + } + + private def testUseCallbackBy(): Unit = { + val counter = new Counter + val comp = ScalaFnComponent.withHooks[PI] + .useCallbackBy(p => counter.incCB(p.pi)) + .useCallbackBy((_, c1) => (i: Int) => c1 >> counter.incCB(i)) + .useCallbackBy($ => (i: Int) => $.hook1 >> counter.incCB(2 + i)) + .useState(0) + .renderRR((_, c1, c2, c3, s) => + <.div( + "S=", counter.value, + ", R1=", ReusableCallbackComponent(c1), + ", R2=", ReusableSetIntComponent(c2), + ", R3=", ReusableSetIntComponent(c3), + <.button(^.onClick --> s.modState(_ + 1)) + ) + ) + + val inc7 = 1 + val inc8 = 2 // 7 + 1 + val inc9 = 3 // 7 + 2 + val inc10 = 4 // 7 + 2 + 1 + val inc11 = 5 // 7 + 2 + 2 + val rndr = 6 + + test(comp(PI(7))) { t => + assertEq(counter.value, 0); t.assertText("S=0, R1=1, R2=1, R3=1") + t.clickButton(inc9); assertEq(counter.value, 9); t.assertText("S=0, R1=1, R2=1, R3=1") + t.clickButton(inc11); assertEq(counter.value, 20); t.assertText("S=0, R1=1, R2=1, R3=1") + t.clickButton(inc10); assertEq(counter.value, 30); t.assertText("S=0, R1=1, R2=1, R3=1") + t.clickButton(inc8); assertEq(counter.value, 38); t.assertText("S=0, R1=1, R2=1, R3=1") + t.clickButton(inc7); assertEq(counter.value, 45); t.assertText("S=0, R1=1, R2=1, R3=1") + t.clickButton(rndr); assertEq(counter.value, 45); t.assertText("S=45, R1=1, R2=1, R3=1") + } + } + + private def testUseCallbackWithDeps(): Unit = { + val depA = new Counter + val depB = new Counter + val counter = new Counter + val comp = ScalaFnComponent.withHooks[Unit] + .useCallbackWithDeps(depA.value)(_ => counter.incCB(depA.value)) + .useCallbackWithDeps(depB.value)(_ => (i: Int) => counter.incCB(depB.value + i - 1)) + .useState(0) + .renderRR((_, c1, c2, s) => + <.div( + "S=", counter.value, + ", R1=", ReusableCallbackComponent(c1), + ", R2=", ReusableSetIntComponent(c2), + <.button(^.onClick --> s.modState(_ + 1)) + ) + ) + + val incA = 1 + val incB0 = 2 + val incB1 = 3 + val rndr = 4 + + depA.value = 10 + depB.value = 20 + test(comp()) { t => + assertEq(counter.value, 0); t.assertText("S=0, R1=1, R2=1") + t.clickButton(incA); assertEq(counter.value, 10); t.assertText("S=0, R1=1, R2=1") + t.clickButton(incB0); assertEq(counter.value, 30); t.assertText("S=0, R1=1, R2=1") + t.clickButton(incB1); assertEq(counter.value, 51); t.assertText("S=0, R1=1, R2=1") + t.clickButton(rndr); assertEq(counter.value, 51); t.assertText("S=51, R1=1, R2=1") + depA.value = 100; t.clickButton(rndr); assertEq(counter.value, 51); t.assertText("S=51, R1=2, R2=1") + t.clickButton(incA); assertEq(counter.value, 151); t.assertText("S=51, R1=2, R2=1") + t.clickButton(incB0); assertEq(counter.value, 171); t.assertText("S=51, R1=2, R2=1") + depB.value = 200; t.clickButton(rndr); assertEq(counter.value, 171); t.assertText("S=171, R1=2, R2=2") + t.clickButton(incB1); assertEq(counter.value, 372); t.assertText("S=171, R1=2, R2=2") + } + } + + private def testUseCallbackWithDepsBy(): Unit = { + val counter = new Counter + val comp = ScalaFnComponent.withHooks[PI] + .useCallbackWithDepsBy(_.pi)(p => _ => counter.incCB(p.pi)) // hook1 + .useState(10) // hook2: dep1 + .useState(20) // hook3: dep2 + .useCallbackWithDepsBy((_, _, d1, _) => d1.value)((_, _, _, _) => counter.incCB) // hook4 + .useCallbackWithDepsBy(_.hook3.value)($ => _ => (i: Int) => counter.incCB($.hook3.value + i - 1)) // hook5 + .renderRR((_, c0, d1, d2, c1, c2) => + <.div( + "S=", counter.value, + ", C0=", ReusableCallbackComponent(c0), + ", C1=", ReusableCallbackComponent(c1), + ", C2=", ReusableSetIntComponent(c2), + <.button(^.onClick --> d1.modState(_ + 100)), + <.button(^.onClick --> d2.modState(_ + 100)), + ) + ) + + val c0 = 1 // s += 3 + val c1 = 2 // s += d1 + val c2a = 3 // s += d2 + val c2b = 4 // s += d2+1 + val d1 = 5 // d1 += 100 + val d2 = 6 // d2 += 100 + + test(comp(PI(3))) { t => + assertEq(counter.value, 0); t.assertText("S=0, C0=1, C1=1, C2=1") + t.clickButton(c1); assertEq(counter.value, 10); t.assertText("S=0, C0=1, C1=1, C2=1") + t.clickButton(c0); assertEq(counter.value, 13); t.assertText("S=0, C0=1, C1=1, C2=1") + t.clickButton(c2b); assertEq(counter.value, 34); t.assertText("S=0, C0=1, C1=1, C2=1") + t.clickButton(c2a); assertEq(counter.value, 54); t.assertText("S=0, C0=1, C1=1, C2=1") + t.clickButton(d2); assertEq(counter.value, 54); t.assertText("S=54, C0=1, C1=1, C2=2") // d2=120 + t.clickButton(c2a); assertEq(counter.value, 174); t.assertText("S=54, C0=1, C1=1, C2=2") + t.clickButton(c0); assertEq(counter.value, 177); t.assertText("S=54, C0=1, C1=1, C2=2") + t.clickButton(c1); assertEq(counter.value, 187); t.assertText("S=54, C0=1, C1=1, C2=2") + t.clickButton(d1); assertEq(counter.value, 187); t.assertText("S=187, C0=1, C1=2, C2=2") // d1=110 + t.clickButton(c2a); assertEq(counter.value, 307); t.assertText("S=187, C0=1, C1=2, C2=2") + t.clickButton(c1); assertEq(counter.value, 417); t.assertText("S=187, C0=1, C1=2, C2=2") + t.clickButton(d1); assertEq(counter.value, 417); t.assertText("S=417, C0=1, C1=3, C2=2") // d1=210 + t.clickButton(d1); assertEq(counter.value, 417); t.assertText("S=417, C0=1, C1=4, C2=2") // d1=310 + t.clickButton(c1); assertEq(counter.value, 727); t.assertText("S=417, C0=1, C1=4, C2=2") + } + } + + private def testUseContext(): Unit = { + val ctx = React.createContext(100) + + val compC = ScalaFnComponent.withHooks[Unit] + .useContext(ctx) + .renderRR((_, c) => c) + + val comp = ScalaFnComponent[Unit] { _ => + <.div( + compC(), + ":", + ctx.provide(123)(compC()), + ) + } + + test(comp()) { t => + t.assertText("100:123") + } + } + + // Can't really observe this but can at least confirm that usage doesn't throw + // private def testUseDebugValue(): Unit = { + // val comp = ScalaFnComponent.withHooks[PI] + // .useDebugValue("hehe") + // .useDebugValueBy(_.pi) + // .useState(0) + // .useDebugValueBy($ => $.props.pi + $.hook1.value) + // .renderRR($ => <.div($.props.pi)) + + // test(comp(PI(3))) { t => + // t.assertText("3") + // } + // } + + trait X_UseEffect_Primary[Ctx, Step <: HooksApi.AbstractStep] { + def X_useEffect[A](effect: A)(implicit a: UseEffectArg[A], step: Step): step.Self + def X_useEffectBy[A](init: Ctx => A)(implicit a: UseEffectArg[A], step: Step): step.Self + def X_useEffectOnMount[A](effect: A)(implicit a: UseEffectArg[A], step: Step): step.Self + def X_useEffectOnMountBy[A](effect: Ctx => A)(implicit a: UseEffectArg[A], step: Step): step.Self + def X_useEffectWithDeps[D, A](deps: => D)(effect: D => A)(implicit a: UseEffectArg[A], r: Reusability[D], step: Step): step.Self + def X_useEffectWithDepsBy[D, A](deps: Ctx => D)(effect: Ctx => D => A)(implicit a: UseEffectArg[A], r: Reusability[D], step: Step): step.Self + } + trait X_UseEffect_Secondary[Ctx, CtxFn[_], Step <: HooksApi.SubsequentStep[Ctx, CtxFn]] extends X_UseEffect_Primary[Ctx, Step] { + def X_useEffectBy[A](init: CtxFn[A])(implicit a: UseEffectArg[A], step: Step): step.Self + def X_useEffectOnMountBy[A](effect: CtxFn[A])(implicit a: UseEffectArg[A], step: Step): step.Self + def X_useEffectWithDepsBy[D, A](deps: CtxFn[D])(effect: CtxFn[D => A])(implicit a: UseEffectArg[A], r: Reusability[D], step: Step): step.Self + } + + private object UseEffect extends UseEffectTests { + override protected implicit def hooksExt1[Ctx, Step <: HooksApi.AbstractStep](api: HooksApi.Primary[Ctx, Step]) = + new Primary(api) + override protected implicit def hooksExt2[Ctx, CtxFn[_], Step <: HooksApi.SubsequentStep[Ctx, CtxFn]](api: HooksApi.Secondary[Ctx, CtxFn, Step]) = + new Secondary(api) + protected class Primary[Ctx, Step <: HooksApi.AbstractStep](api: HooksApi.Primary[Ctx, Step]) extends X_UseEffect_Primary[Ctx, Step] { + override def X_useEffect[A](effect: A)(implicit a: UseEffectArg[A], step: Step) = + api.useEffect(effect) + override def X_useEffectBy[A](init: Ctx => A)(implicit a: UseEffectArg[A], step: Step) = + api.useEffectBy(init) + override def X_useEffectOnMount[A](effect: A)(implicit a: UseEffectArg[A], step: Step) = + api.useEffectOnMount(effect) + override def X_useEffectOnMountBy[A](effect: Ctx => A)(implicit a: UseEffectArg[A], step: Step) = + api.useEffectOnMountBy(effect) + override def X_useEffectWithDeps[D, A](deps: => D)(effect: D => A)(implicit a: UseEffectArg[A], r: Reusability[D], step: Step) = + api.useEffectWithDeps(deps)(effect) + override def X_useEffectWithDepsBy[D, A](deps: Ctx => D)(effect: Ctx => D => A)(implicit a: UseEffectArg[A], r: Reusability[D], step: Step) = + api.useEffectWithDepsBy(deps)(effect) + } + protected class Secondary[Ctx, CtxFn[_], Step <: HooksApi.SubsequentStep[Ctx, CtxFn]](api: HooksApi.Secondary[Ctx, CtxFn, Step]) extends Primary(api) with X_UseEffect_Secondary[Ctx, CtxFn, Step] { + override def X_useEffectBy[A](init: CtxFn[A])(implicit a: UseEffectArg[A], step: Step): step.Self = + api.useEffectBy(init) + override def X_useEffectOnMountBy[A](effect: CtxFn[A])(implicit a: UseEffectArg[A], step: Step): step.Self = + api.useEffectOnMountBy(effect) + override def X_useEffectWithDepsBy[D, A](deps: CtxFn[D])(effect: CtxFn[D => A])(implicit a: UseEffectArg[A], r: Reusability[D], step: Step): step.Self = + api.useEffectWithDepsBy(deps)(effect) + } + } + + private object UseLayoutEffect extends UseEffectTests { + override protected implicit def hooksExt1[Ctx, Step <: HooksApi.AbstractStep](api: HooksApi.Primary[Ctx, Step]) = + new Primary(api) + override protected implicit def hooksExt2[Ctx, CtxFn[_], Step <: HooksApi.SubsequentStep[Ctx, CtxFn]](api: HooksApi.Secondary[Ctx, CtxFn, Step]) = + new Secondary(api) + protected class Primary[Ctx, Step <: HooksApi.AbstractStep](api: HooksApi.Primary[Ctx, Step]) extends X_UseEffect_Primary[Ctx, Step] { + override def X_useEffect[A](effect: A)(implicit a: UseEffectArg[A], step: Step) = + api.useLayoutEffect(effect) + override def X_useEffectBy[A](init: Ctx => A)(implicit a: UseEffectArg[A], step: Step) = + api.useLayoutEffectBy(init) + override def X_useEffectOnMount[A](effect: A)(implicit a: UseEffectArg[A], step: Step) = + api.useLayoutEffectOnMount(effect) + override def X_useEffectOnMountBy[A](effect: Ctx => A)(implicit a: UseEffectArg[A], step: Step) = + api.useLayoutEffectOnMountBy(effect) + override def X_useEffectWithDeps[D, A](deps: => D)(effect: D => A)(implicit a: UseEffectArg[A], r: Reusability[D], step: Step) = + api.useLayoutEffectWithDeps(deps)(effect) + override def X_useEffectWithDepsBy[D, A](deps: Ctx => D)(effect: Ctx => D => A)(implicit a: UseEffectArg[A], r: Reusability[D], step: Step) = + api.useLayoutEffectWithDepsBy(deps)(effect) + } + protected class Secondary[Ctx, CtxFn[_], Step <: HooksApi.SubsequentStep[Ctx, CtxFn]](api: HooksApi.Secondary[Ctx, CtxFn, Step]) extends Primary(api) with X_UseEffect_Secondary[Ctx, CtxFn, Step] { + override def X_useEffectBy[A](init: CtxFn[A])(implicit a: UseEffectArg[A], step: Step): step.Self = + api.useLayoutEffectBy(init) + override def X_useEffectOnMountBy[A](effect: CtxFn[A])(implicit a: UseEffectArg[A], step: Step): step.Self = + api.useLayoutEffectOnMountBy(effect) + override def X_useEffectWithDepsBy[D, A](deps: CtxFn[D])(effect: CtxFn[D => A])(implicit a: UseEffectArg[A], r: Reusability[D], step: Step): step.Self = + api.useLayoutEffectWithDepsBy(deps)(effect) + } + } + + private abstract class UseEffectTests { + protected implicit def hooksExt1[Ctx, Step <: HooksApi.AbstractStep](api: HooksApi.Primary[Ctx, Step]): X_UseEffect_Primary[Ctx, Step] + protected implicit def hooksExt2[Ctx, CtxFn[_], Step <: HooksApi.SubsequentStep[Ctx, CtxFn]](api: HooksApi.Secondary[Ctx, CtxFn, Step]): X_UseEffect_Secondary[Ctx, CtxFn, Step] + + def testConst(): Unit = { + val counter1 = new Counter + val counter2 = new Counter + def state() = s"${counter1.value}:${counter2.value}" + + val comp = ScalaFnComponent.withHooks[Unit] + .X_useEffect(counter1.incCB.ret(counter2.incCB)) + .X_useEffect(counter1.incCB(101)) + .X_useEffect(counter1.incCB.ret(counter2.incCB)) + .useState(321) + .renderRR((_, s) => <.button(^.onClick --> s.modState(_ + 1))) + + test(comp()) { t => + assertEq(state(), "103:0") + t.clickButton(); assertEq(state(), "206:2") + } + assertEq(state(), "206:4") + } + + def testConstBy(): Unit = { + val counter1 = new Counter + val counter2 = new Counter + def state() = s"${counter1.value}:${counter2.value}" + val comp = ScalaFnComponent.withHooks[Unit] + .useState(100) + .X_useEffectBy((_, s1) => counter1.incCB(s1.value)) + .X_useEffectBy($ => counter1.incCB.ret(counter2.incCB($.hook1.value))) + .renderRR((_, s) => <.button(^.onClick --> s.modState(_ + 1))) + + test(comp()) { t => + assertEq(state(), "101:0") + t.clickButton(); assertEq(state(), "203:100") + } + assertEq(state(), "203:201") + } + + def testOnMount(): Unit = { + val counter1 = new Counter + val counter2 = new Counter + def state() = s"${counter1.value}:${counter2.value}" + val comp = ScalaFnComponent.withHooks[Unit] + .X_useEffectOnMount(counter1.incCB.ret(counter2.incCB)) + .X_useEffectOnMount(counter1.incCB(101)) + .X_useEffectOnMount(counter1.incCB.ret(counter2.incCB)) + .useState(321) + .renderRR((_, s) => <.button(^.onClick --> s.modState(_ + 1))) + + test(comp()) { t => + assertEq(state(), "103:0") + t.clickButton(); assertEq(state(), "103:0") + } + assertEq(state(), "103:2") + } + + def testOnMountBy(): Unit = { + val counter1 = new Counter + val counter2 = new Counter + def state() = s"${counter1.value}:${counter2.value}" + val comp = ScalaFnComponent.withHooks[Unit] + .useState(100) + .X_useEffectOnMountBy((_, s1) => counter1.incCB(s1.value)) + .X_useEffectOnMountBy($ => counter1.incCB.ret(counter2.incCB($.hook1.value))) + .renderRR((_, s) => <.button(^.onClick --> s.modState(_ + 1))) + + test(comp()) { t => + assertEq(state(), "101:0") + t.clickButton(); assertEq(state(), "101:0") + } + assertEq(state(), "101:100") + } + + def testWithDeps(): Unit = { + val dep1 = new Counter + val dep2 = new Counter + val dep3 = new Counter + val counter1 = new Counter + val counter2 = new Counter + def state() = s"${counter1.value}:${counter2.value}" + val comp = ScalaFnComponent.withHooks[Unit] + .X_useEffectWithDeps(dep1.value)(_ => counter1.incCB.ret(counter2.incCB)) + .X_useEffectWithDeps(dep2.value)(_ => counter1.incCB(100)) + .X_useEffectWithDeps(dep3.value)(_ => counter1.incCB(10).ret(counter2.incCB(10))) + .useState(321) + .renderRR((_, s) => <.button(^.onClick --> s.modState(_ + 1))) + + test(comp()) { t => + assertEq(state(), "111:0") + t.clickButton(); assertEq(state(), "111:0") + dep2.inc(); t.clickButton(); assertEq(state(), "211:0") + dep1.inc(); t.clickButton(); assertEq(state(), "212:1") + dep1.inc(); t.clickButton(); assertEq(state(), "213:2") + dep3.inc(); t.clickButton(); assertEq(state(), "223:12") + } + assertEq(state(), "223:23") + } + + def testWithDepsBy(): Unit = { + var _state = -1 + val dep1 = new Counter + val dep2 = new Counter + val dep3 = new Counter + val counter1 = new Counter + val counter2 = new Counter + def state() = s"${_state})${counter1.value}:${counter2.value}" + + val comp = ScalaFnComponent.withHooks[PI] + .X_useEffectWithDepsBy(_ => dep1.value)(p => _ => counter1.incCB(p.pi).ret(counter2.incCB(p.pi))) + .useState(100) + .X_useEffectWithDepsBy((_, _) => dep2.value)((_, s) => _ => counter1.incCB(s.value)) + .X_useEffectWithDepsBy(_ => dep3.value)($ => _ => counter1.incCB($.hook1.value / 10).ret(counter2.incCB($.hook1.value / 10))) + .renderRR((_, s) => { + _state = s.value + <.button(^.onClick --> s.modState(_ + 100)) + }) + + test(comp(PI(1000))) { t => + assertEq(state(), "100)1110:0") + t.clickButton(); assertEq(state(), "200)1110:0") + dep2.inc(); t.clickButton(); assertEq(state(), "300)1410:0") + dep1.inc(); t.clickButton(); assertEq(state(), "400)2410:1000") + dep1.inc(); t.clickButton(); assertEq(state(), "500)3410:2000") + dep3.inc(); t.clickButton(); assertEq(state(), "600)3470:2010") // s'=100, d'=10, s=600, d=60 + dep3.inc(); t.clickButton(); assertEq(state(), "700)3540:2070") // s'=600, d'=60, s=700, d=70 + } + assertEq(state(), "700)3540:3140") // +1000 +0 +70 + } + + } // UseEffectTests + + private def testUseForceUpdate(): Unit = { + val counter = new Counter + val comp = ScalaFnComponent.withHooks[Unit] + .useForceUpdate + .renderRR { (_, forceUpdate) => + val rev = counter.inc() + <.div( + rev, ":", ReusableCallbackComponent(forceUpdate) + ) + } + + test(comp()) { t => + t.assertText("1:1") + t.clickButton(); t.assertText("2:2") + t.clickButton(); t.assertText("3:3") + } + } + + private def testUseMemo(): Unit = { + val dep1 = new Counter + val dep2 = new Counter + val counter = new Counter + + val comp = ScalaFnComponent.withHooks[Unit] + .useMemo(dep1.value)(counter.incCB) + .useMemo(dep2.value)(counter.incCB) + .useState(0) + .renderRR((_, c1, c2, s) => + <.div( + "C1=", ReusableCallbackComponent(c1), + ", C2=", ReusableCallbackComponent(c2), + <.button(^.onClick --> s.modState(_ + 1)), + ) + ) + + val c1 = 1 + val c2 = 2 + val s = 3 + + dep1.value = 1 + dep2.value = 10 + test(comp()) { t => + assertEq(counter.value, 0); t.assertText("C1=1, C2=1") + t.clickButton(c2); assertEq(counter.value, 10); t.assertText("C1=1, C2=1") + t.clickButton(c2); assertEq(counter.value, 20); t.assertText("C1=1, C2=1") + t.clickButton(c1); assertEq(counter.value, 21); t.assertText("C1=1, C2=1") + t.clickButton(s); assertEq(counter.value, 21); t.assertText("C1=1, C2=1") + t.clickButton(s); assertEq(counter.value, 21); t.assertText("C1=1, C2=1") + dep1.value = 17; t.clickButton(s); assertEq(counter.value, 21); t.assertText("C1=2, C2=1") + dep1.value = 7; t.clickButton(s); assertEq(counter.value, 21); t.assertText("C1=3, C2=1") + t.clickButton(c2); assertEq(counter.value, 31); t.assertText("C1=3, C2=1") + t.clickButton(c1); assertEq(counter.value, 38); t.assertText("C1=3, C2=1") + t.clickButton(s); assertEq(counter.value, 38); t.assertText("C1=3, C2=1") + dep2.value = 100; t.clickButton(s); assertEq(counter.value, 38); t.assertText("C1=3, C2=2") + t.clickButton(c2); assertEq(counter.value, 138); t.assertText("C1=3, C2=2") + t.clickButton(s); assertEq(counter.value, 138); t.assertText("C1=3, C2=2") + t.clickButton(c1); assertEq(counter.value, 145); t.assertText("C1=3, C2=2") + } + } + + private def testUseMemoBy(): Unit = { + val counter = new Counter + val comp = ScalaFnComponent.withHooks[PI] + .useMemoBy(_.pi)(p => _ => counter.incCB(p.pi)) + .useState(1) + .useMemoBy((_, _, s) => s.value)((_, _, s) => _ => counter.incCB(s.value)) + .useState(5) + .useMemoBy($ => $.props.pi + $.hook4.value)(_ => counter.incCB) + .renderRR((_, c1, s2, c2, s3, c3) => + <.div( + "S2=", s2.value, + ", S3=", s3.value, + ", C1=", ReusableCallbackComponent(c1), + ", C2=", ReusableCallbackComponent(c2), + ", C3=", ReusableCallbackComponent(c3), + <.button(^.onClick --> s2.modState(_ + 1)), + <.button(^.onClick --> s3.modState(_ + 1)), + ) + ) + + val c1 = 1 // + p + val c2 = 2 // + s2 + val c3 = 3 // + p + s3 + val s2 = 4 + val s3 = 5 + + test(comp(PI(10))) { t => + assertEq(counter.value, 0); t.assertText("S2=1, S3=5, C1=1, C2=1, C3=1") + t.clickButton(c2); assertEq(counter.value, 1); t.assertText("S2=1, S3=5, C1=1, C2=1, C3=1") + t.clickButton(c1); assertEq(counter.value, 11); t.assertText("S2=1, S3=5, C1=1, C2=1, C3=1") + t.clickButton(c3); assertEq(counter.value, 26); t.assertText("S2=1, S3=5, C1=1, C2=1, C3=1") + t.clickButton(s2); assertEq(counter.value, 26); t.assertText("S2=2, S3=5, C1=1, C2=2, C3=1") + t.clickButton(c2); assertEq(counter.value, 28); t.assertText("S2=2, S3=5, C1=1, C2=2, C3=1") + t.clickButton(s3); assertEq(counter.value, 28); t.assertText("S2=2, S3=6, C1=1, C2=2, C3=2") + t.clickButton(c3); assertEq(counter.value, 44); t.assertText("S2=2, S3=6, C1=1, C2=2, C3=2") + } + } + + private def testUseRefManual(): Unit = { + val comp = ScalaFnComponent.withHooks[Unit] + .useRef(100) + .useState(0) + .renderRR { (_, ref, s) => + <.div( + ref.value, + <.button(^.onClick --> ref.mod(_ + 1)), + <.button(^.onClick --> s.modState(_ + 1)), + ) + } + + test(comp()) { t => + t.assertText("100") + t.clickButton(1); t.assertText("100") + t.clickButton(2); t.assertText("101") + t.clickButton(1); t.assertText("101") + t.clickButton(2); t.assertText("102") + } + } + + private def testUseRefManualBy(): Unit = { + val comp = ScalaFnComponent.withHooks[PI] + .useRefBy(_.pi + 1) + .useRefBy($ => $.props.pi + $.hook1.value) + .useState(0) + .renderRR { (_, ref1, ref2, s) => + <.div( + s"${ref1.value}:${ref2.value}", + <.button(^.onClick --> ref1.mod(_ + 1)), + <.button(^.onClick --> ref2.mod(_ + 1)), + <.button(^.onClick --> s.modState(_ + 1)), + ) + } + + test(comp(PI(4))) { t => + t.assertText("5:9") + t.clickButton(1); t.assertText("5:9") + t.clickButton(3); t.assertText("6:9") + t.clickButton(2); t.assertText("6:9") + t.clickButton(3); t.assertText("6:10") + } + } + + private def testUseRefVdom(): Unit = { + var text = "uninitialised" + val comp = ScalaFnComponent.withHooks[Unit] + .useRefToVdom[Input] + .useState("x") + .renderRR { (_, inputRef, s) => + + def onChange(e: ReactEventFromInput): Callback = + s.setState(e.target.value) + + def btn: Callback = + for { + i <- inputRef.get.asCBO + // _ <- Callback.log(s"i.value = [${i.value}]") + } yield { + text = i.value + } + + <.div( + <.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), + <.button(^.onClick --> btn) + ) + } + + test(comp()) { t => + t.assertInputText("x") + t.clickButton() + assertEq(text, "x") + + t.setInputText("hehe") + t.assertInputText("hehe") + t.clickButton() + assertEq(text, "hehe") + } + } + + private def testUseReducer(): Unit = { + def add(n: Int): (Int, Int) => Int = _ + _ + n + val comp = ScalaFnComponent.withHooks[PI] + .useReducer(add(0), 100) + .useReducerBy((_, s1) => add(s1.value), (p, s1) => p.pi + s1.value) + .useReducerBy($ => add($.hook1.value), $ => $.props.pi + $.hook1.value + $.hook2.value) + .renderRR((p, s1, s2, s3) => + <.div( + <.div(s"P=$p, s1=${s1.value}, s2=${s2.value}, s3=${s3.value}"), + <.button(^.onClick --> s1.dispatch(1)), + <.button(^.onClick --> s2.dispatch(10)), + <.button(^.onClick --> s3.dispatch(100)), + )) + + test(comp(PI(666))) { t => + t.assertText("P=PI(666), s1=100, s2=766, s3=1532") + t.clickButton(1); t.assertText("P=PI(666), s1=101, s2=766, s3=1532") + t.clickButton(2); t.assertText("P=PI(666), s1=101, s2=877, s3=1532") // +101+10 + t.clickButton(3); t.assertText("P=PI(666), s1=101, s2=877, s3=1733") // +101+100 + } + } + + private def testUseState(): Unit = { + val comp = ScalaFnComponent.withHooks[PI] + .useState(100) + .useStateBy((p, s1) => p.pi + s1.value) + .useStateBy($ => $.props.pi + $.hook1.value + $.hook2.value) + .renderRR { $ => + val p = $.props + val s1 = $.hook1 + val s2 = $.hook2 + val s3 = $.hook3 + <.div( + <.div(s"P=$p, s1=${s1.value}, s2=${s2.value}, s3=${s3.value}"), + <.button(^.onClick --> ( + s1.modState(_ + 1) >> s2.modState(-_) >> s3.modState(_ * 10) + ))) + } + + test(comp(PI(666))) { t => + t.assertText("P=PI(666), s1=100, s2=766, s3=1532") + t.clickButton(); t.assertText("P=PI(666), s1=101, s2=-766, s3=15320") + } + } + + private def testUseStateSetStateReusability(): Unit = { + val comp = ScalaFnComponent.withHooks[Unit] + .useState(4) + .renderRR { (_, s) => + <.div( + s"S=${s.value}", + ", R1=", ReusableSetIntComponent(s.setState), + ", R2=", ReusableSetIntComponent(s.setState), + ", R3=", ReusableCallbackComponent(s.withReusableInputs.setState(Reusable.implicitly(if (s.value >= 30) -30 else 30))), + ", R4=", ReusableCallbackComponent(s.withReusableInputs.setState(Reusable.implicitly(40))), + ) + } + + val r1_1 = 1 + val r1_2 = 2 + val r2_1 = 3 + val r2_2 = 4 + val r3 = 5 + val r4 = 6 + + test(comp()) { t => + t.assertText("S=4, R1=1, R2=1, R3=1, R4=1") + t.clickButton(r2_1); t.assertText("S=1, R1=1, R2=1, R3=1, R4=1") + t.clickButton(r1_2); t.assertText("S=2, R1=1, R2=1, R3=1, R4=1") + t.clickButton(r1_1); t.assertText("S=1, R1=1, R2=1, R3=1, R4=1") + t.clickButton(r2_2); t.assertText("S=2, R1=1, R2=1, R3=1, R4=1") + t.clickButton(r3); t.assertText("S=30, R1=1, R2=1, R3=2, R4=1") + t.clickButton(r4); t.assertText("S=40, R1=1, R2=1, R3=2, R4=1") + t.clickButton(r3); t.assertText("S=-30, R1=1, R2=1, R3=3, R4=1") + t.clickButton(r3); t.assertText("S=30, R1=1, R2=1, R3=4, R4=1") + } + } + + private def testUseStateModStateReusability(): Unit = { + val comp = ScalaFnComponent.withHooks[Unit] + .useState(4) + .renderRR { (_, s) => + <.div( + s"S=${s.value}", + ", R1=", ReusableModIntComponent(s.modState), + ", R2=", ReusableModIntComponent(s.modState), + ", R3=", ReusableCallbackComponent(s.withReusableInputs.modState(if (s.value >= 28) incBy5 else incBy1)), + ", R4=", ReusableCallbackComponent(s.withReusableInputs.modState(incBy1)), + ) + } + + val r1_1 = 1 + val r1_10 = 2 + val r2_1 = 3 + val r2_10 = 4 + val r3 = 5 + val r4 = 6 + + test(comp()) { t => + t.assertText("S=4, R1=1, R2=1, R3=1, R4=1") + t.clickButton(r2_1); t.assertText("S=5, R1=1, R2=1, R3=1, R4=1") + t.clickButton(r1_10); t.assertText("S=15, R1=1, R2=1, R3=1, R4=1") + t.clickButton(r1_1); t.assertText("S=16, R1=1, R2=1, R3=1, R4=1") + t.clickButton(r2_10); t.assertText("S=26, R1=1, R2=1, R3=1, R4=1") + t.clickButton(r3); t.assertText("S=27, R1=1, R2=1, R3=1, R4=1") + t.clickButton(r4); t.assertText("S=28, R1=1, R2=1, R3=2, R4=1") + t.clickButton(r3); t.assertText("S=33, R1=1, R2=1, R3=2, R4=1") + } + } + + private def testUseStateWithReuse(): Unit = { + implicit val reusability: Reusability[PI] = Reusability.by[PI, Int](_.pi >> 1) + + val comp = ScalaFnComponent.withHooks[PI] + .useStateWithReuse(PI(100)) + .useStateWithReuseBy((p, s1) => p + s1.value) + .useStateWithReuseBy($ => $.props + $.hook1.value + $.hook2.value) + .renderRR((p, s1, s2, s3) => + <.div( + <.div(s"P=$p, s1=${s1.value}, s2=${s2.value}, s3=${s3.value}"), + <.button(^.onClick --> ( + s1.modState(_ + 2) >> s2.modState(-_) >> s3.modState(_ * 10) + )), + <.button(^.onClick --> ( + s1.modState(_ + 1) >> s2.modState(-_) + )), + )) + + test(comp(PI(666))) { t => + t.assertText("P=PI(666), s1=PI(100), s2=PI(766), s3=PI(1532)") + t.clickButton(1); t.assertText("P=PI(666), s1=PI(102), s2=PI(-766), s3=PI(15320)") + t.clickButton(2); t.assertText("P=PI(666), s1=PI(102), s2=PI(766), s3=PI(15320)") + } + } + + private def testUseStateWithReuseSetStateReusability(): Unit = { + implicit val reusability: Reusability[PI] = Reusability[PI]((x, y) => (x.pi - y.pi).abs <= 1) + + val comp = ScalaFnComponent.withHooks[Unit] + .useStateWithReuse(PI(4)) + .renderRR { (_, s) => + <.div( + s"S=${s.value}", + ", R1=", ReusableSetIntComponent(s.setState.map(f => (i: Int) => f(PI(i)).value)), + ", R2=", ReusableSetIntComponent(s.setState.map(f => (i: Int) => f(PI(i)).value)), + ", R3=", ReusableCallbackComponent(s.setState(PI(if (s.value.pi >= 30) -30 else 30))), + ", R4=", ReusableCallbackComponent(s.setState(PI(40))), + ) + } + + val r1_1 = 1 + val r1_2 = 2 + val r2_1 = 3 + val r2_2 = 4 + val r3 = 5 + val r4 = 6 + + test(comp()) { t => + t.assertText("S=PI(4), R1=1, R2=1, R3=1, R4=1") + t.clickButton(r2_1); t.assertText("S=PI(1), R1=1, R2=1, R3=1, R4=1") + t.clickButton(r1_2); t.assertText("S=PI(1), R1=1, R2=1, R3=1, R4=1") + t.clickButton(r3); t.assertText("S=PI(30), R1=1, R2=1, R3=2, R4=1") + t.clickButton(r4); t.assertText("S=PI(40), R1=1, R2=1, R3=2, R4=1") + t.clickButton(r2_2); t.assertText("S=PI(2), R1=1, R2=1, R3=3, R4=1") + t.clickButton(r1_1); t.assertText("S=PI(2), R1=1, R2=1, R3=3, R4=1") + t.clickButton(r3); t.assertText("S=PI(30), R1=1, R2=1, R3=4, R4=1") + t.clickButton(r3); t.assertText("S=PI(-30), R1=1, R2=1, R3=5, R4=1") + t.clickButton(r3); t.assertText("S=PI(30), R1=1, R2=1, R3=6, R4=1") + } + } + + private def testUseStateWithReuseModStateReusability(): Unit = { + implicit val reusability: Reusability[PI] = Reusability.by[PI, Int](_.pi >> 1) + val comp = ScalaFnComponent.withHooks[Unit] + .useStateWithReuse(PI(4)) + .renderRR { (_, s) => + <.div( + s"S=${s.value}", + ", R0=", ReusableCallbackComponent(s.modState(_ + 1)), + ", R1=", ReusableCallbackComponent(s.modState(_ + 2)), + ", R2=", ReusableCallbackComponent(s.modState(_ + 4)), + ) + } + + val inc1 = 1 + val inc2 = 2 + val inc4 = 3 + + test(comp()) { t => + t.assertText("S=PI(4), R0=1, R1=1, R2=1") + t.clickButton(inc2); t.assertText("S=PI(6), R0=1, R1=1, R2=1") + t.clickButton(inc4); t.assertText("S=PI(10), R0=1, R1=1, R2=1") + t.clickButton(inc1); t.assertText("S=PI(10), R0=1, R1=1, R2=1") + t.clickButton(inc4); t.assertText("S=PI(14), R0=1, R1=1, R2=1") + t.clickButton(inc2); t.assertText("S=PI(16), R0=1, R1=1, R2=1") + } + } + + private def testUseStateSnapshot(): Unit = { + val counter = new Counter + var latestS3 = 0 + val comp = ScalaFnComponent.withHooks[PI] + .useStateSnapshot(100) + .useStateSnapshotBy((p, s1) => p.pi + s1.value) + .useStateSnapshotBy($ => $.props.pi + $.hook1.value + $.hook2.value) + .renderRR { (p, s1, s2, s3) => + latestS3 = s3.value + <.div( + <.button(^.onClick --> (s1.modState(_ + 1) >> s2.modState(-_) >> s3.modState(_ * 10))), + <.button(^.onClick --> s3.modState(_ + 1, CallbackTo(latestS3).flatMap(counter.incCB(_)))), + <.button(^.onClick --> s3.setStateOption(None, counter.incCB)), + s"P=$p", + s", S1=${s1.value}:", ReusableSetIntComponent(s1.underlyingSetFn.map(f => (i: Int) => f(Some(i), Callback.empty))), + s", S2=${s2.value}:", ReusableSetIntComponent(s1.underlyingSetFn.map(f => (i: Int) => f(Some(i), Callback.empty))), + s", S3=${s3.value}:", ReusableSetIntComponent(s1.underlyingSetFn.map(f => (i: Int) => f(Some(i), Callback.empty))), + ) + } + + test(comp(PI(666))) { t => + t.assertText("P=PI(666), S1=100:1, S2=766:1, S3=1532:1") + t.clickButton(1); t.assertText("P=PI(666), S1=101:1, S2=-766:1, S3=15320:1") + t.clickButton(2); t.assertText("P=PI(666), S1=101:1, S2=-766:1, S3=15321:1") + assertEq(counter.value, 15321) // verify that the modState(cb) executes after the state update + t.clickButton(3); t.assertText("P=PI(666), S1=101:1, S2=-766:1, S3=15321:1") + assertEq(counter.value, 15322) // verify that the setState(None, cb) executes (and that ↖ the previous modState effect ↖ doesn't execute again) + t.clickButton(3); t.assertText("P=PI(666), S1=101:1, S2=-766:1, S3=15321:1") + assertEq(counter.value, 15323) + t.clickButton(2); t.assertText("P=PI(666), S1=101:1, S2=-766:1, S3=15322:1") + assertEq(counter.value, 15323 + 15322) + t.clickButton(4); t.assertText("P=PI(666), S1=1:1, S2=-766:1, S3=15322:1") + assertEq(counter.value, 15323 + 15322) + } + } + + private def testUseStateSnapshotWithReuse(): Unit = { + type I = Int {type A=1} + implicit val I = Reusability.int.contramap((_: I) >> 1) + val counter = new Counter + var latestS3 = 0 + val comp = ScalaFnComponent.withHooks[PI] + .useStateSnapshotWithReuse(100) + .useStateSnapshotWithReuseBy((p, s1) => p.pi + s1.value) + .useStateSnapshotWithReuseBy($ => $.props.pi + $.hook1.value + $.hook2.value) + .useStateSnapshotWithReuse(330.asInstanceOf[I]) + .renderRR { (p, s1, s2, s3, s4) => + latestS3 = s3.value + <.div( + <.button(^.onClick --> (s1.modState(_ + 1) >> s2.modState(-_) >> s3.modState(_ * 10))), + <.button(^.onClick --> s3.modState(_ + 1, CallbackTo(latestS3).flatMap(counter.incCB(_)))), + <.button(^.onClick --> s3.setStateOption(None, counter.incCB)), + s"P=$p", + ", S1=", ReusableStateSnapshotComponent(s1), // buttons: 4 & 5 + ", S2=", ReusableStateSnapshotComponent(s2), // buttons: 6 & 7 + ", S3=", ReusableStateSnapshotComponent(s3), // buttons: 8 & 9 + s", S4=", ReusableStateSnapshotComponent(s4.asInstanceOf[StateSnapshot[Int]]), // buttons: 10 & 11 + ) + } + + test(comp(PI(666))) { t => + t.assertText("P=PI(666), S1=100:1, S2=766:1, S3=1532:1, S4=330:1") + t.clickButton(1); t.assertText("P=PI(666), S1=101:2, S2=-766:2, S3=15320:2, S4=330:1") + t.clickButton(2); t.assertText("P=PI(666), S1=101:2, S2=-766:2, S3=15321:3, S4=330:1") + assertEq(counter.value, 15321) // verify that the modState(cb) executes after the state update + t.clickButton(3); t.assertText("P=PI(666), S1=101:2, S2=-766:2, S3=15321:3, S4=330:1") + assertEq(counter.value, 15322) // verify that the setState(None, cb) executes (and that ↖ the previous modState effect ↖ doesn't execute again) + t.clickButton(3); t.assertText("P=PI(666), S1=101:2, S2=-766:2, S3=15321:3, S4=330:1") + assertEq(counter.value, 15323) + t.clickButton(2); t.assertText("P=PI(666), S1=101:2, S2=-766:2, S3=15322:4, S4=330:1") + assertEq(counter.value, 15323 + 15322) + t.clickButton(4); t.assertText("P=PI(666), S1=102:3, S2=-766:2, S3=15322:4, S4=330:1") + t.clickButton(4); t.assertText("P=PI(666), S1=103:4, S2=-766:2, S3=15322:4, S4=330:1") + assertEq(counter.value, 15323 + 15322) + t.clickButton(11); t.assertText("P=PI(666), S1=103:4, S2=-766:2, S3=15322:4, S4=340:2") + t.clickButton(10); t.assertText("P=PI(666), S1=103:4, S2=-766:2, S3=15322:4, S4=340:2") // reusability blocks update + t.clickButton(11); t.assertText("P=PI(666), S1=103:4, S2=-766:2, S3=15322:4, S4=350:3") + } + } + + private def testRenderWithReuse(): Unit = { + implicit val reusability: Reusability[PI] = Reusability.by[PI, Int](_.pi >> 1) + var renders = 0 + var extState = 5 + val comp = ScalaFnComponent.withHooks[PI] + .useState(20) + .useCallback(Callback(extState += 1)) + .useForceUpdate + .renderRRWithReuse { (p, s, incES, fu) => + renders += 1 + <.div( + s"P=$p, S=${s.value}, ES=$extState, R=$renders", + <.button(^.onClick --> s.modState(_ + 1)), + <.button(^.onClick --> (incES >> fu)), + ) + } + + val wrapper = ScalaComponent.builder[PI].render_P(comp(_)).build + + withRenderedIntoBody(wrapper(PI(3))) { (m, root) => + val t = new DomTester(root) + t.assertText("P=PI(3), S=20, ES=5, R=1") + replaceProps(wrapper, m)(PI(2)); t.assertText("P=PI(3), S=20, ES=5, R=1") + t.clickButton(1); t.assertText("P=PI(2), S=21, ES=5, R=2") + replaceProps(wrapper, m)(PI(2)); t.assertText("P=PI(2), S=21, ES=5, R=2") + replaceProps(wrapper, m)(PI(3)); t.assertText("P=PI(2), S=21, ES=5, R=2") + replaceProps(wrapper, m)(PI(4)); t.assertText("P=PI(4), S=21, ES=5, R=3") + t.clickButton(2); t.assertText("P=PI(4), S=21, ES=6, R=4") + replaceProps(wrapper, m)(PI(5)); t.assertText("P=PI(4), S=21, ES=6, R=4") + } + } + + // See https://github.com/japgolly/scalajs-react/issues/1027 + private def testRenderWithReuseNever(): Unit = { + implicit val reusability: Reusability[PI] = Reusability.never + var renders = 0 + val comp = ScalaFnComponent.withHooks[PI] + .renderRRWithReuse { p => + renders += 1 + <.div(s"P=$p, R=$renders") + } + + val wrapper = ScalaComponent.builder[PI] + .initialStateFromProps(identity) + .renderS { ($, s) => + <.div( + comp(s), + <.button(^.onClick --> $.modState(_ + 0)), + <.button(^.onClick --> $.modState(_ + 1)), + ) + } + .build + + withRenderedIntoBody(wrapper(PI(3))) { (_, root) => + val t = new DomTester(root) + t.assertText("P=PI(3), R=1") + t.clickButton(2); t.assertText("P=PI(4), R=2") + t.clickButton(1); t.assertText("P=PI(4), R=3") + } + } + + private def testRenderWithReuseNeverPC(): Unit = { + implicit val reusability: Reusability[PI] = Reusability.never + + implicit val v: Reusability[japgolly.scalajs.react.hooks.HookCtx.PC0[PI]] = + japgolly.scalajs.react.hooks.HookCtx.reusabilityPC0 + + var renders = 0 + val comp = ScalaFnComponent.withHooks[PI] + .withPropsChildren + .renderRRWithReuse { (p, c) => + renders += 1 + <.div(s"P=$p, R=$renders", c) + } + + val wrapper = ScalaComponent.builder[PI] + .initialStateFromProps(identity) + .renderS { ($, s) => + <.div( + comp(s)("."), + <.button(^.onClick --> $.modState(_ + 0)), + <.button(^.onClick --> $.modState(_ + 1)), + ) + } + .build + + withRenderedIntoBody(wrapper(PI(3))) { (_, root) => + val t = new DomTester(root) + t.assertText("P=PI(3), R=1.") + t.clickButton(2); t.assertText("P=PI(4), R=2.") + t.clickButton(1); t.assertText("P=PI(4), R=3.") + } + } + + private def testRenderWithReuseAndUseRef(): Unit = { + val comp = ScalaFnComponent.withHooks[Unit] + .useRef(100) + .useState(0) + .renderRRWithReuse { $ => + val ref = $.hook1 + val s = $.hook2 + <.div( + ref.value, + <.button(^.onClick --> ref.mod(_ + 1)), + <.button(^.onClick --> s.modState(_ + 1)), + ) + } + + test(comp()) { t => + t.assertText("100") + t.clickButton(1); t.assertText("100") + t.clickButton(2); t.assertText("101") + t.clickButton(1); t.assertText("101") + t.clickButton(2); t.assertText("102") + } + } + + private def testRenderWithReuseAndUseRefToVdom(): Unit = { + var text = "uninitialised" + val comp = ScalaFnComponent.withHooks[Unit] + .withPropsChildren + .useRefToVdom[Input] + .useState("x") + .renderRRWithReuse { (_, c, inputRef, s) => + + def onChange(e: ReactEventFromInput): Callback = + s.setState(e.target.value) + + def btn: Callback = + for { + i <- inputRef.get.asCBO + // _ <- Callback.log(s"i.value = [${i.value}]") + } yield { + text = i.value + } + + <.div( + <.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), + <.button(^.onClick --> btn), + c + ) + } + + test(comp("!")) { t => + t.assertInputText("x") + t.clickButton() + assertEq(text, "x") + + t.setInputText("hehe") + t.assertInputText("hehe") + t.clickButton() + assertEq(text, "hehe") + } + } + + private def testRenderWithReuseAndUseRefToVdomO(): Unit = { + var text = "uninitialised" + val comp = ScalaFnComponent.withHooks[Unit] + .withPropsChildren + .useRefToVdom[Input] + .useState("x") + .renderRRWithReuse { $ => + val c = $.propsChildren + val inputRef = $.hook1 + val s = $.hook2 + + def onChange(e: ReactEventFromInput): Callback = + s.setState(e.target.value) + + def btn: Callback = + for { + i <- inputRef.get.asCBO + // _ <- Callback.log(s"i.value = [${i.value}]") + } yield { + text = i.value + } + + <.div( + <.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), + <.button(^.onClick --> btn), + c + ) + } + + test(comp("!")) { t => + t.assertInputText("x") + t.clickButton() + assertEq(text, "x") + + t.setInputText("hehe") + t.assertInputText("hehe") + t.clickButton() + assertEq(text, "hehe") + } + } + + private def testPropsChildrenCtxObj(): Unit = { + val inner = ScalaFnComponent.withHooks[Int] + .withPropsChildren + .useState(123) + .renderRR { $ => + val p = $.props + val c = $.propsChildren + val s = $.hook1 + <.div(p + 1, " | ", s.value, " | ", c) + } + + val comp = ScalaFnComponent[Int] { p => inner(p * 10)(<.p("yo!")) } + + test(comp(3))(_ assertText "31 | 123 | yo!") + } + + private def testPropsChildrenCtxFn(): Unit = { + val inner = ScalaFnComponent.withHooks[Int] + .withPropsChildren + .useState(123) + .renderRR((p, c, s) => <.div(p + 1, " | ", s.value, " | ", c)) + + val comp = ScalaFnComponent[Int] { p => inner(p * 10)(<.p("yo!")) } + + test(comp(3))(_ assertText "31 | 123 | yo!") + } + + // =================================================================================================================== + // Not included in HooksTest + + private trait JsP extends js.Object + private trait JsS extends js.Object + private trait JsF extends js.Object + + @nowarn("msg=pure.expression") + private def testUseRefCompilation(): Unit = { + val jsComp = JsComponent.force[Null, Children.None, Null](null) + + ScalaFnComponent.withHooks[Unit] + .useRefToAnyVdom + .useRefToJsComponent(jsComp) + .useRefToJsComponent[JsP, JsS] + .useRefToJsComponentWithMountedFacade[JsP, JsS, JsF] + .useRefToScalaComponent(ReusableCallbackComponent) + .useRefToScalaComponent[Int, Long, String] + .renderRR { (_, any, js, jsPS, jsPSF, scala, scalaPSB) => + + // Assert types of results + any : Ref.Simple[Node] + jsComp.withRef(js)() + jsPS : Ref.ToJsComponent[JsP, JsS, JsComponent.RawMounted[JsP, JsS]] + jsPSF : Ref.ToJsComponent[JsP, JsS, JsComponent.RawMounted[JsP, JsS] with JsF] + ReusableCallbackComponent.withRef(scala)(Reusable.never(Callback.empty)) + scalaPSB : Ref.ToScalaComponent[Int, Long, String] + + "ok" + } + } + + private def testRenderWithReuseBy(): Unit = { + implicit val reusability: Reusability[PI] = Reusability.by[PI, Int](_.pi >> 1) + var renders = 0 + var extState = 5 + val comp = ScalaFnComponent.withHooks[PI] + .useState(20) + .useCallback(Callback(extState += 1)) + .useForceUpdate + .renderRRWithReuseBy((_, _, _, _)) { case (p, s, incES, fu) => + renders += 1 + <.div( + s"P=$p, S=${s.value}, ES=$extState, R=$renders", + <.button(^.onClick --> s.modState(_ + 1)), + <.button(^.onClick --> (incES >> fu)), + ) + } + + val wrapper = ScalaComponent.builder[PI].render_P(comp(_)).build + + withRenderedIntoBody(wrapper(PI(3))) { (m, root) => + val t = new DomTester(root) + t.assertText("P=PI(3), S=20, ES=5, R=1") + replaceProps(wrapper, m)(PI(2)); t.assertText("P=PI(3), S=20, ES=5, R=1") + t.clickButton(1); t.assertText("P=PI(2), S=21, ES=5, R=2") + replaceProps(wrapper, m)(PI(2)); t.assertText("P=PI(2), S=21, ES=5, R=2") + replaceProps(wrapper, m)(PI(3)); t.assertText("P=PI(2), S=21, ES=5, R=2") + replaceProps(wrapper, m)(PI(4)); t.assertText("P=PI(4), S=21, ES=5, R=3") + t.clickButton(2); t.assertText("P=PI(4), S=21, ES=6, R=4") + replaceProps(wrapper, m)(PI(5)); t.assertText("P=PI(4), S=21, ES=6, R=4") + } + } + + // See https://github.com/japgolly/scalajs-react/issues/1027 + private def testRenderWithReuseByNever(): Unit = { + implicit val reusability: Reusability[PI] = Reusability.never + var renders = 0 + val comp = ScalaFnComponent.withHooks[PI] + .renderRRWithReuseBy(ctx => ctx) { p => + renders += 1 + <.div(s"P=$p, R=$renders") + } + + val wrapper = ScalaComponent.builder[PI] + .initialStateFromProps(identity) + .renderS { ($, s) => + <.div( + comp(s), + <.button(^.onClick --> $.modState(_ + 0)), + <.button(^.onClick --> $.modState(_ + 1)), + ) + } + .build + + withRenderedIntoBody(wrapper(PI(3))) { (_, root) => + val t = new DomTester(root) + t.assertText("P=PI(3), R=1") + t.clickButton(2); t.assertText("P=PI(4), R=2") + t.clickButton(1); t.assertText("P=PI(4), R=3") + } + } + + private def testRenderWithReuseByNeverPC(): Unit = { + implicit val reusability: Reusability[PI] = Reusability.never + + implicit val v: Reusability[japgolly.scalajs.react.hooks.HookCtx.PC0[PI]] = + japgolly.scalajs.react.hooks.HookCtx.reusabilityPC0 + + var renders = 0 + val comp = ScalaFnComponent.withHooks[PI] + .withPropsChildren + .renderRRWithReuseBy((_, _)) { case (p, c) => + renders += 1 + <.div(s"P=$p, R=$renders", c) + } + + val wrapper = ScalaComponent.builder[PI] + .initialStateFromProps(identity) + .renderS { ($, s) => + <.div( + comp(s)("."), + <.button(^.onClick --> $.modState(_ + 0)), + <.button(^.onClick --> $.modState(_ + 1)), + ) + } + .build + + withRenderedIntoBody(wrapper(PI(3))) { (_, root) => + val t = new DomTester(root) + t.assertText("P=PI(3), R=1.") + t.clickButton(2); t.assertText("P=PI(4), R=2.") + t.clickButton(1); t.assertText("P=PI(4), R=3.") + } + } + + private def testRenderWithReuseByAndUseRef(): Unit = { + val comp = ScalaFnComponent.withHooks[Unit] + .useRef(100) + .useState(0) + .renderRRWithReuseBy(ctx => ctx) { $ => + val ref = $.hook1 + val s = $.hook2 + <.div( + ref.value, + <.button(^.onClick --> ref.mod(_ + 1)), + <.button(^.onClick --> s.modState(_ + 1)), + ) + } + + test(comp()) { t => + t.assertText("100") + t.clickButton(1); t.assertText("100") + t.clickButton(2); t.assertText("101") + t.clickButton(1); t.assertText("101") + t.clickButton(2); t.assertText("102") + } + } + + private def testRenderWithReuseByAndUseRefToVdom(): Unit = { + var text = "uninitialised" + val comp = ScalaFnComponent.withHooks[Unit] + .withPropsChildren + .useRefToVdom[Input] + .useState("x") + .renderRRWithReuseBy((_, _, _, _)) { case (_, c, inputRef, s) => + + def onChange(e: ReactEventFromInput): Callback = + s.setState(e.target.value) + + def btn: Callback = + for { + i <- inputRef.get.asCBO + // _ <- Callback.log(s"i.value = [${i.value}]") + } yield { + text = i.value + } + + <.div( + <.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), + <.button(^.onClick --> btn), + c + ) + } + + test(comp("!")) { t => + t.assertInputText("x") + t.clickButton() + assertEq(text, "x") + + t.setInputText("hehe") + t.assertInputText("hehe") + t.clickButton() + assertEq(text, "hehe") + } + } + + private def testRenderWithReuseByAndUseRefToVdomO(): Unit = { + var text = "uninitialised" + val comp = ScalaFnComponent.withHooks[Unit] + .withPropsChildren + .useRefToVdom[Input] + .useState("x") + .renderRRWithReuseBy(ctx => ctx) { $ => + val c = $.propsChildren + val inputRef = $.hook1 + val s = $.hook2 + + def onChange(e: ReactEventFromInput): Callback = + s.setState(e.target.value) + + def btn: Callback = + for { + i <- inputRef.get.asCBO + // _ <- Callback.log(s"i.value = [${i.value}]") + } yield { + text = i.value + } + + <.div( + <.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), + <.button(^.onClick --> btn), + c + ) + } + + test(comp("!")) { t => + t.assertInputText("x") + t.clickButton() + assertEq(text, "x") + + t.setInputText("hehe") + t.assertInputText("hehe") + t.clickButton() + assertEq(text, "hehe") + } + } + + // =================================================================================================================== + + override def tests = Tests { + "noHooks" - { + "props" - testProps() + "propsChildren" - testPropsChildren() + } + "custom" - { + "usage" - testCustomHook() + "composition" - testCustomHookComposition() + } + "localLazyVal" - testLazyVal() + "localVal" - testVal() + "localVar" - testVar() + "useCallback" - { + "const" - testUseCallback() + "constBy" - testUseCallbackBy() + "deps" - testUseCallbackWithDeps() + "depsBy" - testUseCallbackWithDepsBy() + } + "unchecked" - testUnchecked() + "useContext" - testUseContext() + // "useDebugValue" - testUseDebugValue() TODO: reenable + "useEffect" - { + import UseEffect._ + "const" - testConst() + "constBy" - testConstBy() + "deps" - testWithDeps() + "depsBy" - testWithDepsBy() + "mount" - testOnMount() + "mountBy" - testOnMountBy() + } + "useForceUpdate" - testUseForceUpdate() + "useLayoutEffect" - { + import UseLayoutEffect._ + "const" - testConst() + "constBy" - testConstBy() + "deps" - testWithDeps() + "depsBy" - testWithDepsBy() + "mount" - testOnMount() + "mountBy" - testOnMountBy() + } + "useMemo" - { + "deps" - testUseMemo() + "depsBy" - testUseMemoBy() + } + "useRef" - { + "compilation" - testUseRefCompilation() + "manual" - testUseRefManual() + "manualBy" - testUseRefManualBy() + "vdom" - testUseRefVdom() + } + "useReducer" - testUseReducer() + "useState" - { + "state" - testUseState() + "reusability" - { + "set" - testUseStateSetStateReusability() + "mod" - testUseStateModStateReusability() + } + } + "useStateWithReuse" - { + "state" - testUseStateWithReuse() + "reusability" - { + "set" - testUseStateWithReuseSetStateReusability() + "mod" - testUseStateWithReuseModStateReusability() + } + } + "useStateSnapshot" - testUseStateSnapshot() + "useStateSnapshotWithReuse" - testUseStateSnapshotWithReuse() + + "withPropsChildren" - { + "ctxObj" - testPropsChildrenCtxObj() + "ctxFn" - testPropsChildrenCtxFn() + } + + "renderWithReuse" - { + "main" - testRenderWithReuse() // P, Secondary, CtxFn + "never" - testRenderWithReuseNever() // P, Primary + "neverC" - testRenderWithReuseNeverPC() // PC, Primary + "useRef" - testRenderWithReuseAndUseRef() // P, Secondary, CtxObj + "useRefToVdom" - testRenderWithReuseAndUseRefToVdom() // PC, Secondary, CtxFn + "useRefToVdomO" - testRenderWithReuseAndUseRefToVdomO() // PC, Secondary, CtxObj + } + + "renderWithReuseBy" - { + "main" - testRenderWithReuseBy() // P, Secondary, CtxFn + "never" - testRenderWithReuseByNever() // P, Primary + "neverC" - testRenderWithReuseByNeverPC() // PC, Primary + "useRef" - testRenderWithReuseByAndUseRef() // P, Secondary, CtxObj + "useRefToVdom" - testRenderWithReuseByAndUseRefToVdom() // PC, Secondary, CtxFn + "useRefToVdomO" - testRenderWithReuseByAndUseRefToVdomO() // PC, Secondary, CtxObj + } + } +} diff --git a/library/tests/src/test/scala/japgolly/scalajs/react/core/HooksTest.scala b/library/tests/src/test/scala/japgolly/scalajs/react/core/HooksTest.scala index 407954639..32f0fcbdd 100644 --- a/library/tests/src/test/scala/japgolly/scalajs/react/core/HooksTest.scala +++ b/library/tests/src/test/scala/japgolly/scalajs/react/core/HooksTest.scala @@ -110,6 +110,23 @@ object HooksTest extends TestSuite { // =================================================================================================================== + private def testProps(): Unit = { + val comp = ScalaFnComponent.withHooks[Int] + .render(_ + 1) + + test(comp(3))(_ assertText "4") + } + + private def testPropsChildren(): Unit = { + val inner = ScalaFnComponent.withHooks[Int] + .withPropsChildren + .render((p, c) => <.div(p + 1, " | ", c)) + + val comp = ScalaFnComponent[Int] { p => inner(p * 10)(<.p("yo!")) } + + test(comp(3))(_ assertText "31 | yo!") + } + private def testCustomHook(): Unit = { // TODO: https://github.com/lampepfl/dotty/issues/12663 ScalaSpecificHooksTest.testCustomHook() @@ -144,7 +161,6 @@ object HooksTest extends TestSuite { } private def testCustomHookComposition(): Unit = { - locally { type LL = CustomHook[Long, Long] type II = CustomHook[Int, Int] @@ -907,12 +923,17 @@ object HooksTest extends TestSuite { .useState(100) .useStateBy((p, s1) => p.pi + s1.value) .useStateBy($ => $.props.pi + $.hook1.value + $.hook2.value) - .render((p, s1, s2, s3) => + .render { $ => + val p = $.props + val s1 = $.hook1 + val s2 = $.hook2 + val s3 = $.hook3 <.div( <.div(s"P=$p, s1=${s1.value}, s2=${s2.value}, s3=${s3.value}"), <.button(^.onClick --> ( s1.modState(_ + 1) >> s2.modState(-_) >> s3.modState(_ * 10) - )))) + ))) + } test(comp(PI(666))) { t => t.assertText("P=PI(666), s1=100, s2=766, s3=1532") @@ -1214,11 +1235,46 @@ object HooksTest extends TestSuite { } } + private def testRenderWithReuseNeverPC(): Unit = { + implicit val reusability: Reusability[PI] = Reusability.never + + implicit val v: Reusability[japgolly.scalajs.react.hooks.HookCtx.PC0[PI]] = + japgolly.scalajs.react.hooks.HookCtx.reusabilityPC0 + + var renders = 0 + val comp = ScalaFnComponent.withHooks[PI] + .withPropsChildren + .renderWithReuse { (p, c) => + renders += 1 + <.div(s"P=$p, R=$renders", c) + } + + val wrapper = ScalaComponent.builder[PI] + .initialStateFromProps(identity) + .renderS { ($, s) => + <.div( + comp(s)("."), + <.button(^.onClick --> $.modState(_ + 0)), + <.button(^.onClick --> $.modState(_ + 1)), + ) + } + .build + + withRenderedIntoBody(wrapper(PI(3))) { (_, root) => + val t = new DomTester(root) + t.assertText("P=PI(3), R=1.") + t.clickButton(2); t.assertText("P=PI(4), R=2.") + t.clickButton(1); t.assertText("P=PI(4), R=3.") + } + } + private def testRenderWithReuseAndUseRef(): Unit = { val comp = ScalaFnComponent.withHooks[Unit] .useRef(100) .useState(0) - .renderWithReuse { (_, ref, s) => + .renderWithReuse { $ => + val ref = $.hook1 + val s = $.hook2 <.div( ref.value, <.button(^.onClick --> ref.mod(_ + 1)), @@ -1238,9 +1294,10 @@ object HooksTest extends TestSuite { private def testRenderWithReuseAndUseRefToVdom(): Unit = { var text = "uninitialised" val comp = ScalaFnComponent.withHooks[Unit] + .withPropsChildren .useRefToVdom[Input] .useState("x") - .renderWithReuse { (_, inputRef, s) => + .renderWithReuse { (_, c, inputRef, s) => def onChange(e: ReactEventFromInput): Callback = s.setState(e.target.value) @@ -1255,11 +1312,12 @@ object HooksTest extends TestSuite { <.div( <.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), - <.button(^.onClick --> btn) + <.button(^.onClick --> btn), + c ) } - test(comp()) { t => + test(comp("!")) { t => t.assertInputText("x") t.clickButton() assertEq(text, "x") @@ -1271,9 +1329,81 @@ object HooksTest extends TestSuite { } } + private def testRenderWithReuseAndUseRefToVdomO(): Unit = { + var text = "uninitialised" + val comp = ScalaFnComponent.withHooks[Unit] + .withPropsChildren + .useRefToVdom[Input] + .useState("x") + .renderWithReuse { $ => + val c = $.propsChildren + val inputRef = $.hook1 + val s = $.hook2 + + def onChange(e: ReactEventFromInput): Callback = + s.setState(e.target.value) + + def btn: Callback = + for { + i <- inputRef.get.asCBO + // _ <- Callback.log(s"i.value = [${i.value}]") + } yield { + text = i.value + } + + <.div( + <.input.text.withRef(inputRef)(^.value := s.value, ^.onChange ==> onChange), + <.button(^.onClick --> btn), + c + ) + } + + test(comp("!")) { t => + t.assertInputText("x") + t.clickButton() + assertEq(text, "x") + + t.setInputText("hehe") + t.assertInputText("hehe") + t.clickButton() + assertEq(text, "hehe") + } + } + + private def testPropsChildrenCtxObj(): Unit = { + val inner = ScalaFnComponent.withHooks[Int] + .withPropsChildren + .useState(123) + .render { $ => + val p = $.props + val c = $.propsChildren + val s = $.hook1 + <.div(p + 1, " | ", s.value, " | ", c) + } + + val comp = ScalaFnComponent[Int] { p => inner(p * 10)(<.p("yo!")) } + + test(comp(3))(_ assertText "31 | 123 | yo!") + } + + private def testPropsChildrenCtxFn(): Unit = { + val inner = ScalaFnComponent.withHooks[Int] + .withPropsChildren + .useState(123) + .render((p, c, s) => <.div(p + 1, " | ", s.value, " | ", c)) + + val comp = ScalaFnComponent[Int] { p => inner(p * 10)(<.p("yo!")) } + + test(comp(3))(_ assertText "31 | 123 | yo!") + } + // =================================================================================================================== override def tests = Tests { + "noHooks" - { + "props" - testProps() + "propsChildren" - testPropsChildren() + } "custom" - { "usage" - testCustomHook() "composition" - testCustomHookComposition() @@ -1336,11 +1466,18 @@ object HooksTest extends TestSuite { "useStateSnapshot" - testUseStateSnapshot() "useStateSnapshotWithReuse" - testUseStateSnapshotWithReuse() + "withPropsChildren" - { + "ctxObj" - testPropsChildrenCtxObj() + "ctxFn" - testPropsChildrenCtxFn() + } + "renderWithReuse" - { - "main" - testRenderWithReuse() - "never" - testRenderWithReuseNever() - "useRef" - testRenderWithReuseAndUseRef() - "useRefToVdom" - testRenderWithReuseAndUseRefToVdom() + "main" - testRenderWithReuse() // P, Secondary, CtxFn + "never" - testRenderWithReuseNever() // P, Primary + "neverC" - testRenderWithReuseNeverPC() // PC, Primary + "useRef" - testRenderWithReuseAndUseRef() // P, Secondary, CtxObj + "useRefToVdom" - testRenderWithReuseAndUseRefToVdom() // PC, Secondary, CtxFn + "useRefToVdomO" - testRenderWithReuseAndUseRefToVdomO() // PC, Secondary, CtxObj } } } diff --git a/library/tests/src/test/scala/japgolly/scalajs/react/core/ReusabilityTest.scala b/library/tests/src/test/scala/japgolly/scalajs/react/core/ReusabilityTest.scala index d3073e0e9..01b5e8e48 100644 --- a/library/tests/src/test/scala/japgolly/scalajs/react/core/ReusabilityTest.scala +++ b/library/tests/src/test/scala/japgolly/scalajs/react/core/ReusabilityTest.scala @@ -145,7 +145,6 @@ object ReusabilityTest extends TestSuite { private class DerivesByRef { class X implicit val x: Reusability[X] = Reusability.never - val _ = x case class Y(x: X) implicit val y: Reusability[Y] = Reusability.derive[Y] val y1 = Y(new X) diff --git a/library/version.sbt b/library/version.sbt new file mode 100644 index 000000000..df188c14c --- /dev/null +++ b/library/version.sbt @@ -0,0 +1,5 @@ +// Remove timestamp from SNAPSHOT versions +ThisBuild / version := { + val v = (ThisBuild / version).value + v.replaceFirst("""\+\d{8}-\d{4}(?=-SNAPSHOT)""", "") +}