Skip to content

Commit

Permalink
release 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chandu0101 committed Feb 27, 2016
1 parent 65b9a04 commit 645c6f5
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 35 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ Sri (Scala React interface) is a scalajs library to build truly native cross pla
Use this module to build iOS/Android mobile applications:

```scala
libraryDependencies += "com.github.chandu0101.sri" %%% "mobile" % "0.3.0"
libraryDependencies += "com.github.chandu0101.sri" %%% "mobile" % "0.4.0"
```

#Web
Use this module to build browser based applications:

```scala
libraryDependencies += "com.github.chandu0101.sri" %%% "web" % "0.3.0"
libraryDependencies += "com.github.chandu0101.sri" %%% "web" % "0.4.0"
```

#Relay
Use this module to add relay support to your applications:
```scala
libraryDependencies += "com.github.chandu0101.sri" %%% "relay" % "0.3.0"
libraryDependencies += "com.github.chandu0101.sri" %%% "relay" % "0.4.0"
```
#Documentation
- [Sri Internals](/docs/SriInternals.md)
Expand All @@ -53,6 +53,7 @@ libraryDependencies += "com.github.chandu0101.sri" %%% "relay" % "0.3.0"
- [Mobile Examples](/mobile-examples)
- [Web Examples](/web-examples)
- [Relay Web Examples](/relay-web-examples)
- [Sangria-Graphql Example](https://github.com/chandu0101/sri-sangria-example)

#Templates
- [Mobile App(iOS and Android) Template](https://github.com/chandu0101/sri-mobile-template)
Expand Down
9 changes: 5 additions & 4 deletions changelog/CHANGE_LOG_0.4.0.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# ChangeLog 0.4.0(WIP)
# ChangeLog 0.4.0


# Core

- Bump scalajs version to 0.6.7

- [Pure Components](../docs/PureComponents.md)


# Universal


# Mobile
Expand All @@ -28,3 +25,7 @@
- Upgrade to relay [0.7.1](https://github.com/facebook/relay/blob/master/CHANGELOG.md#070-february-12-2016)



# Misc

- [Sangria-Graphql Example](https://github.com/chandu0101/sri-sangria-example)
16 changes: 8 additions & 8 deletions docs/PureComponents.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# PureComponents

`React makes use of a virtual DOM, which is a descriptor of a DOM subtree rendered in the browser. This parallel representation allows React to avoid creating DOM nodes and accessing existing ones, which is slower than operations on JavaScript objects. When a component's props or state change, React decides whether an actual DOM update is necessary by constructing a new virtual DOM and comparing it to the old one. Only in the case they are not equal, will React reconcile the DOM, applying as few mutations as possible.
`React makes use of a virtual DOM, which is a descriptor of a DOM subtree rendered in the browser. This parallel representation allows React to avoid creating DOM nodes and accessing existing ones, which is slower than operations on JavaScript objects. When a component's props or state change, React decides whether an actual DOM update is necessary by constructing a new virtual DOM and comparing it to the old one. Only in the case they are not equal, will React reconcile the DOM, applying as few mutations as possible.`

On top of this, React provides a component lifecycle function, shouldComponentUpdate, which is triggered before the re-rendering process starts (virtual DOM comparison and possible eventual DOM reconciliation), giving the developer the ability to short circuit this process.`
`On top of this, React provides a component lifecycle function, shouldComponentUpdate, which is triggered before the re-rendering process starts (virtual DOM comparison and possible eventual DOM reconciliation), giving the developer the ability to short circuit this process.`

Sri comes with few helper classes that already have `shouldComponentUpdate` implemented.


##### ReactComponentPureRef[P `<:` AnyRef,S `<:` AnyRef]

Use this class when your component have immutable Props and State.It uses scala 'reference equality`(eq,ne) to check whether props/sate updated.
Use this class when your component have immutable Props and State.It uses scala `reference equality`(eq,ne) to check whether props/sate updated.

Example :

Expand All @@ -27,7 +27,7 @@ class MyComponent extends ReactComponentPureRef[Props,State] {

##### ReactComponentPureRefP[P `<:` AnyRef]

Use this class when your component have immutable Props but no State.It uses scala 'reference equality`(eq,ne) to check whether props are updated or not.
Use this class when your component have immutable Props but no State.It uses scala `reference equality`(eq,ne) to check whether props are updated or not.

Example :

Expand All @@ -43,7 +43,7 @@ class MyComponent extends ReactComponentPureRefP[Props] {

##### ReactComponentPureRefS[S `<:` AnyRef]

Use this class when your component have immutable State but no Props.It uses scala 'reference equality`(eq,ne) to check whether state is updated or not.
Use this class when your component have immutable State but no Props.It uses scala `reference equality`(eq,ne) to check whether state is updated or not.

Example :

Expand All @@ -59,7 +59,7 @@ class MyComponent extends ReactComponentPureRefS[State] {

##### ReactComponentPureValue[P,S]

Use this class when your component have value classes(Boolean,Int,Double ..) as Props and State.It uses scala 'value equality`(==,!=) to check whether props/sate updated.
Use this class when your component have value classes(Boolean,Int,Double ..) as Props and State.It uses scala `value equality`(==,!=) to check whether props/sate updated.

Example :

Expand All @@ -73,7 +73,7 @@ class MyComponent extends ReactComponentPureValue[Int,Boolean] {

##### ReactComponentPureValueP[P]

Use this class when your component have value class(Boolean,Int,Double ..) as Props but no State.It uses scala 'value equality`(==,!=) to check whether props are updated or not.
Use this class when your component have value class(Boolean,Int,Double ..) as Props but no State.It uses scala `value equality`(==,!=) to check whether props are updated or not.

Example :

Expand All @@ -87,7 +87,7 @@ class MyComponent extends ReactComponentPureValueP[Int] {

##### ReactComponentPureValueS[S]

Use this class when your component have value class(Boolean,Int,Double ..) as State but no Props.It uses scala 'value equality`(==,!=) to check whether state is updated or not.
Use this class when your component have value class(Boolean,Int,Double ..) as State but no Props.It uses scala `value equality`(==,!=) to check whether state is updated or not.

Example :

Expand Down
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object Sri extends Build {
lazy val commonSettings =
Seq(
organization := "com.github.chandu0101.sri",
version := "0.4.0-SNAPSHOT",
version := "0.4.0",
homepage := Some(url("https://github.com/chandu0101/sri")),
licenses +=("Apache-2.0", url("http://opensource.org/licenses/Apache-2.0")),
scalaVersion := Scala211,
Expand Down
27 changes: 15 additions & 12 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,36 @@ import sbt._

object Dependencies {

val scalaAsyncVersion = "0.9.2"

val upickleVersion = "0.3.1"
object Version {

val scalatestVersion = "3.0.0-M6"
val scalaAsync = "0.9.2"

val utestVersion = "0.3.0"
val upickle = "0.3.1"

val scalaJSDOMVersion = "0.9.0"
val scalatest = "3.0.0-M6"

val utest = "0.3.0"

val chandu0101MacrosVersion = "0.5.1"
val scalaJSDOM = "0.9.0"

val chandu0101Macros = "0.5.1"
}


val utestJS = libraryDependencies += "com.lihaoyi" %%% "utest" % "0.3.0" % Test

val scalatestJS = libraryDependencies += "org.scalatest" %%% "scalatest" % scalatestVersion % Test
val scalatestJS = libraryDependencies += "org.scalatest" %%% "scalatest" % Version.scalatest % Test

val scalaAsync = libraryDependencies += "org.scala-lang.modules" %% "scala-async" % scalaAsyncVersion
val scalaAsync = libraryDependencies += "org.scala-lang.modules" %% "scala-async" % Version.scalaAsync

val scalaJSUpickle = libraryDependencies += "com.lihaoyi" %%% "upickle" % upickleVersion
val scalaJSUpickle = libraryDependencies += "com.lihaoyi" %%% "upickle" % Version.upickle

val scalaJSDOM = libraryDependencies += "org.scala-js" %%% "scalajs-dom" % scalaJSDOMVersion
val scalaJSDOM = libraryDependencies += "org.scala-js" %%% "scalajs-dom" % Version.scalaJSDOM

val chandu0101Macros = libraryDependencies += "com.github.chandu0101" %%% "macros" % chandu0101MacrosVersion
val chandu0101Macros = libraryDependencies += "com.github.chandu0101" %%% "macros" % Version.chandu0101Macros

val scalaReflect = libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided
val scalaReflect = libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided

val coreModuleDeps = Seq(
scalaJSDOM,
Expand Down
2 changes: 1 addition & 1 deletion relay/src/main/scala/sri/relay/external/Deferred.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package sri.relay.external

import org.scalajs.dom.raw.Promise

import scala.scalajs.js
import scala.scalajs.js.Promise
import scala.scalajs.js.annotation.JSName

/**
Expand Down
2 changes: 1 addition & 1 deletion relay/src/main/scala/sri/relay/network/NetworkLayer.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package sri.relay.network

import org.scalajs.dom.raw.Promise

import scala.scalajs.js
import scala.scalajs.js.Promise
import scala.scalajs.js.annotation.{JSName, ScalaJSDefined}

@js.native
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package sri.relay.tools

import org.scalajs.dom.raw.Promise

import sri.relay.tools.RelayTaskScheduler.TaskExecutor

import scala.scalajs.js
import scala.scalajs.js.Promise

object RelayTaskScheduler {
type TaskCallback = () => Unit
Expand Down
8 changes: 4 additions & 4 deletions universal/src/main/scala/sri/universal/apis/Clipboard.scala
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package sri.universal.apis

import org.scalajs.dom.raw.Promise

import scala.scalajs.js
import scala.scalajs.js.Promise


@js.native
trait Clipboard extends js.Object{
trait Clipboard extends js.Object {

def setString(content : String) : Unit = js.native
def setString(content: String): Unit = js.native

def getString() : Promise[String] = js.native
def getString(): Promise[String] = js.native
}

0 comments on commit 645c6f5

Please sign in to comment.