Skip to content

Commit 0136334

Browse files
committed
Merge v0.10 into master
2 parents 89f405a + ba2834c commit 0136334

File tree

124 files changed

+6220
-4061
lines changed

Some content is hidden

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

124 files changed

+6220
-4061
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ Includes a router, testing utils, performance utils, more.
1818
- [Type Summary](doc/TYPES.md).
1919
- [Functional Programming](doc/FP.md).
2020
- Scala-only Utilities.
21-
- [Router](extra/ROUTER2.md).
21+
- [Router](extra/ROUTER.md).
2222
- [Performance Management](extra/PERF.md).
2323
- [Smaller stuff](extra/README.md).
2424
- [Testing](test/README.md).
25-
- [Changelogs](doc/)[Latest](doc/CHANGELOG-0.9.md).
25+
- [Changelogs](doc/)[Latest](doc/CHANGELOG-0.10.md).
2626

2727

2828
##### External Resources
2929

3030
* Templates & Tutorials
3131
* [chandu0101 / scalajs-react-template](https://github.com/chandu0101/scalajs-react-template)
3232
* [ochrons / scalajs-spa-tutorial](https://github.com/ochrons/scalajs-spa-tutorial)
33-
* [elacin / scalajs-todos](https://github.com/elacin/scalajs-todos)
33+
* [TodoMVC example](http://todomvc.com/examples/scalajs-react)
3434
* [Scala.js and React: Building an Application for the Web](https://scala-bility.blogspot.com/2015/05/scalajs-and-react-building-application.html)
3535

3636
* [Interop With Third-Party Components - chandu0101](https://github.com/chandu0101/scalajs-react-components/blob/master/doc/InteropWithThirdParty.md)
@@ -41,6 +41,6 @@ Includes a router, testing utils, performance utils, more.
4141

4242

4343
##### Requirements:
44-
* React 0.12 *(0.13 probably works too, 0.14 will be fully supported when released)*
44+
* React 0.14
4545
* Scala 2.11
46-
* Scala.JS 0.6.3+
46+
* Scala.JS 0.6.4+

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

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,36 @@ object Addons {
88
object ReactCssTransitionGroup {
99
/** Items in the CSSTransitionGroup need this attribute for animation to work properly. */
1010
@inline final def key = vdom.Attrs.key
11+
12+
private val factory =
13+
React.createFactory(
14+
React.addons.CSSTransitionGroup.asInstanceOf[JsComponentType[js.Any, js.Any, TopNode]])
1115
}
1216

13-
case class ReactCssTransitionGroup(name : String,
14-
enter : js.UndefOr[Boolean] = js.undefined,
15-
leave : js.UndefOr[Boolean] = js.undefined,
16-
component: js.UndefOr[String] = js.undefined,
17-
ref : js.UndefOr[String] = js.undefined) {
17+
case class ReactCssTransitionGroup(name : String,
18+
appear : js.UndefOr[Boolean] = js.undefined,
19+
appearTimeout: js.UndefOr[Int] = js.undefined,
20+
enter : js.UndefOr[Boolean] = js.undefined,
21+
enterTimeout : js.UndefOr[Int] = js.undefined,
22+
leave : js.UndefOr[Boolean] = js.undefined,
23+
leaveTimeout : js.UndefOr[Int] = js.undefined,
24+
component : js.UndefOr[String] = js.undefined,
25+
ref : js.UndefOr[String] = js.undefined) {
1826
def toJs: js.Object = {
1927
val p = js.Dynamic.literal("transitionName" -> name)
20-
enter .foreach(p.updateDynamic("transitionEnter")(_))
21-
leave .foreach(p.updateDynamic("transitionLeave")(_))
22-
component.foreach(p.updateDynamic("component" )(_))
23-
ref .foreach(p.updateDynamic("ref" )(_))
28+
appear .foreach(p.updateDynamic("transitionAppear")(_))
29+
appearTimeout.foreach(p.updateDynamic("transitionAppearTimeout")(_))
30+
enter .foreach(p.updateDynamic("transitionEnter")(_))
31+
enterTimeout .foreach(p.updateDynamic("transitionEnterTimeout")(_))
32+
leave .foreach(p.updateDynamic("transitionLeave")(_))
33+
leaveTimeout .foreach(p.updateDynamic("transitionLeaveTimeout")(_))
34+
component .foreach(p.updateDynamic("component" )(_))
35+
ref .foreach(p.updateDynamic("ref" )(_))
2436
p
2537
}
2638

27-
def apply(children: ReactNode*): ReactComponentU_ = {
28-
val f = React.addons.CSSTransitionGroup
29-
f(toJs, children.toJsArray).asInstanceOf[ReactComponentU_]
30-
}
39+
def apply(children: ReactNode*): ReactComponentU_ =
40+
ReactCssTransitionGroup.factory(toJs, children.toJsArray).asInstanceOf[ReactComponentU_]
3141
}
3242

3343
object ReactCloneWithProps {
@@ -40,6 +50,11 @@ object Addons {
4050
obj
4151
}
4252

53+
/**
54+
* `cloneWithProps` is now deprecated. Use `React.cloneElement` instead (unlike `cloneWithProps`, `cloneElement`
55+
* does not merge `className` or `style` automatically; you can merge them manually if needed).
56+
*/
57+
@deprecated("As of React 0.14, you must use React.cloneElement instead.", "0.10.0")
4358
def apply(child: ReactNode, newProps: Map[String, js.Any]) = {
4459
val f = React.addons.cloneWithProps
4560
f(child, mapToJS(newProps)).asInstanceOf[ReactComponentU_]

0 commit comments

Comments
 (0)