<commit_before>package japgolly.scalajs.react

import scala.scalajs.js._

final class ReactComponentB[Props](name: String) {

  def getInitialState[State](f: Props => State) = new B2[State](f)
  def initialState[State](s: => State) = getInitialState(_ => s)
  def stateless = initialState(())
  def render(render: Props => VDom) = stateless.render((p,_) => render(p))

  class B2[State] private[ReactComponentB](getInitialState: Props => State) {
    type ScopeB = BackendScope[Props, State]

    def backend[Backend](f: ScopeB => Backend) = new B3[Backend](f)
    def noBackend = new B3[Unit](_ => ())
    def render(render: (Props, State) => VDom) = noBackend.render((p,s,_) => render(p,s))

    class B3[Backend] private[ReactComponentB](backend: ScopeB => Backend) {
      type ScopeU = ComponentScopeU[Props, State, Backend]
      type ScopeM = ComponentScopeM[Props, State, Backend]
      type ScopeWU = ComponentScopeWU[Props, State, Backend]

      def render(render: (Props, State, Backend) => VDom) =
        B4(s => render(s.props, s.state, s.backend)
          , undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined)

      case class B4 private[ReactComponentB](
          __render: ScopeU => VDom
          , getDefaultProps: UndefOr[() => Props]
          , componentWillMount: UndefOr[ScopeU => Unit]
          , componentDidMount: UndefOr[ScopeM => Unit]
          , componentWillUnmount: UndefOr[ScopeM => Unit]
          , componentWillUpdate: UndefOr[(ScopeWU, Props, State) => Unit]
          , componentDidUpdate: UndefOr[(ScopeM, Props, State) => Unit]
          , componentWillReceiveProps: UndefOr[(ScopeM, Props) => Unit]
          , shouldComponentUpdate: UndefOr[(ScopeM, Props, State) => Boolean]
          ) {<commit_msg>Provide full scope to render fns.<commit_after>package japgolly.scalajs.react

import scala.scalajs.js._

final class ReactComponentB[Props](name: String) {

  def getInitialState[State](f: Props => State) = new B2[State](f)
  def initialState[State](s: => State) = getInitialState(_ => s)
  def stateless = initialState(())
  def render(render: Props => VDom) = stateless.render((p,_) => render(p))

  class B2[State] private[ReactComponentB](getInitialState: Props => State) {
    type ScopeB = BackendScope[Props, State]

    def backend[Backend](f: ScopeB => Backend) = new B3[Backend](f)
    def noBackend = new B3[Unit](_ => ())
    def render(render: (Props, State) => VDom) = noBackend.render((p,s,_) => render(p,s))

    class B3[Backend] private[ReactComponentB](backend: ScopeB => Backend) {
      type ScopeU = ComponentScopeU[Props, State, Backend]
      type ScopeM = ComponentScopeM[Props, State, Backend]
      type ScopeWU = ComponentScopeWU[Props, State, Backend]

      def render(r: (Props, State, Backend) => VDom): B4 =
        render(s => r(s.props, s.state, s.backend))

      def render(render: ScopeU => VDom): B4 =
        B4(render, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined)

      case class B4 private[ReactComponentB](
          __render: ScopeU => VDom
          , getDefaultProps: UndefOr[() => Props]
          , componentWillMount: UndefOr[ScopeU => Unit]
          , componentDidMount: UndefOr[ScopeM => Unit]
          , componentWillUnmount: UndefOr[ScopeM => Unit]
          , componentWillUpdate: UndefOr[(ScopeWU, Props, State) => Unit]
          , componentDidUpdate: UndefOr[(ScopeM, Props, State) => Unit]
          , componentWillReceiveProps: UndefOr[(ScopeM, Props) => Unit]
          , shouldComponentUpdate: UndefOr[(ScopeM, Props, State) => Boolean]
          ) {
{'fraction_non_alphanumeric': 0.1358397365532382, 'fraction_numerical': 0.0043907793633369925, 'mean_word_length': 3.74609375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3225498', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1171, 'n_words': 272}