Skip to content

Commit

Permalink
release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chandu0101 committed Oct 11, 2015
1 parent ee2854f commit 67182b5
Show file tree
Hide file tree
Showing 54 changed files with 385 additions and 269 deletions.
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ npm-debug.log


#mobile
index.ios.js
index.android.js
mobile-examples/index.ios.js
mobile-examples/index.android.js
mobile-examples/android/.gradle
mobile-examples/android/build
mobile-examples/android/app/build

#web-examples
web-examples/assets/
web-examples/node_modules/


#relay-web-examples
relay-web-examples/assets/
relay-web-examples/node_modules/

10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sri

Sri(scala react interface) is a scalajs library to build truly native cross platform(mobile and web) applications ,its based on [reactjs](http://facebook.github.io/react/) and [react-native](https://facebook.github.io/react-native/) so you must be familiar with them inorder to use this library.
Sri(scala react interface) is a scalajs library to build truly native cross platform(mobile(ios and android) and web) applications ,its based on [reactjs](http://facebook.github.io/react/) and [react-native](https://facebook.github.io/react-native/) so you must be familiar with them inorder to use this library.


![sri](/docs/sri.png)
Expand All @@ -13,6 +13,7 @@ Sri(scala react interface) is a scalajs library to build truly native cross plat
- [Relay](#relay)
- [Documentation](#documentation)
- [Examples](#examples)
- [Templates](#templates)

#Mobile
Use this module to build iOS/Android mobile applications
Expand Down Expand Up @@ -46,4 +47,9 @@ libraryDependencies += "com.github.chandu0101.sri" %%% "relay" % "0.1.0"
#Examples
- [Mobile Examples](/mobile-examples)
- [Web Examples](/web-examples)
- [Relay Web Examples](/relay-web-examples)
- [Relay Web Examples](/relay-web-examples)

#Templates
- [Mobile App(iOS and Android) Template](https://github.com/chandu0101/sri-mobile-template)
- [Web App Template](https://github.com/chandu0101/sri-web-template)
- [Cross Platform App(mobile(ios and android) and web) Template](https://github.com/chandu0101/sri-cross-platform-template)
3 changes: 3 additions & 0 deletions docs/InteropWithThirdParty.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,6 @@ def render() = View(key= "1")(AwesomeJSCmpWrapper(numberOfLines = 3,testID = "id

##Real World Examples

https://github.com/chandu0101/sri/tree/master/universal/src/main/scala/sri/universal/components

https://github.com/chandu0101/sri/tree/master/mobile/src/main/scala/sri/mobile/components
8 changes: 4 additions & 4 deletions docs/RefsToComponents.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ object Parent {
childRef.hideMe() // invoke actions
}
}
val factory = getComponentFactory(js.constructorOf[Component], classOf[Component])
def apply(key: js.UndefOr[String] = js.undefined, ref: js.Function1[Component,_] = null) = createElementNoProps(factory, key = key, ref = ref)
val ctor = getTypedConstructor(js.constructorOf[Component], classOf[Component])
def apply(key: js.UndefOr[String] = js.undefined, ref: js.Function1[Component,_] = null) = createElementNoProps(ctor, key = key, ref = ref)
}

object Child {
Expand All @@ -36,8 +36,8 @@ object Child {
println(s"Ok done!.")
}
}
val factory = getComponentFactory(js.constructorOf[Component], classOf[Component])
def apply(key: js.UndefOr[String] = js.undefined, ref: js.Function1[Component,_] = null) = createElementNoProps(factory, key = key, ref = ref)
val ctor = getTypedConstructor(js.constructorOf[Component], classOf[Component])
def apply(key: js.UndefOr[String] = js.undefined, ref: js.Function1[Component,_] = null) = createElementNoProps(ctor, key = key, ref = ref)
}


Expand Down
2 changes: 1 addition & 1 deletion docs/WhyNoDOMDSL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To make this more clear and to make it easier to build more environments that Re

>Can someone explain why semantic markup is important? I don't buy the screen reader and search engine arguments anymore. #divallthethings ,In other words, React Native can fix a11y in other ways and hence doesn't need semantic markup.
[Initial web implementation od react-native-animated](https://github.com/facebook/react-native/commit/a50b4ea7b9ecc4c95a38b58f12a71b93ff3a3131)
[Initial web implementation of react-native-animated](https://github.com/facebook/react-native/commit/a50b4ea7b9ecc4c95a38b58f12a71b93ff3a3131)

[react-native-for-web](https://github.com/KodersLab/react-native-for-web)

Expand Down
18 changes: 18 additions & 0 deletions mobile-examples/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Mobile Examples

# React Native Playground

```scala

// in root(sri)
sbt ~fullOptMobile

// this will generate index.ios.js and index.android.js files

```

1) go to https://rnplay.org/ -> Signin -> NewApp -> name it as `SriMobile`

2) Replace content of index.io.js and index.android.js files with content from files that are generated using sbt ~fullOptMobile


# Simulator/Device

-> Install Node.js 4.0 or greater using [nvm](https://github.com/creationix/nvm#installation)

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sri.core.ElementFactory._
import sri.core.ReactComponent
import sri.mobile.ReactNative
import sri.universal.components._
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
Expand All @@ -24,7 +24,7 @@ object HelloSriMobile {
}
}

object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {

val container = style(flexOne,
backgroundColor := "rgb(175, 9, 119)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sri.mobile.examples.movies.MoviesUtil._
import sri.universal.components._
import sri.universal.router
import sri.universal.router.UniversalRouterComponent
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js
import scala.scalajs.js.UndefOr
Expand Down Expand Up @@ -48,7 +48,7 @@ object MovieCell {
def apply(movie: js.Dynamic, key: UndefOr[String] = js.undefined, ref: js.Function1[Component, _] = null) = createElement(ctor, movie, key = key, ref = ref)


object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {
val textContainer = style(
flex := 1
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sri.mobile.ReactNative
import sri.mobile.all._
import sri.mobile.examples.movies.MoviesUtil._
import sri.universal.components._
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js
import scala.scalajs.js.Dynamic.{literal => json}
Expand Down Expand Up @@ -95,7 +95,7 @@ object MovieDetails {

def apply(movie: js.Dynamic, key: UndefOr[String] = js.undefined, ref: js.Function1[Component,_] = null) = createElement(ctor, movie, key = key, ref = ref)

object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {

val contentContainer = style(
padding := 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package sri.mobile.examples.movies

import sri.core.ReactElement
import sri.mobile.all._
import sri.mobile.components.DefaultNavigationBar
import sri.mobile.examples.movies.android.DefaultAndroidNavigationBar
import sri.universal.components.View
import sri.universal.components.{DefaultNavigationBar, View}
import sri.universal.router._
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js

Expand Down Expand Up @@ -42,6 +41,6 @@ object MoviesApp {

}

object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {
val c = style(flexOne)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import sri.mobile.examples.movies.android.SearchBarAndroid
import sri.mobile.examples.movies.ios.SearchBarIOS
import sri.universal.ReactEvent
import sri.universal.components._
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.async.Async._
import scala.scalajs.concurrent.JSExecutionContext.Implicits.runNow
Expand Down Expand Up @@ -203,7 +203,7 @@ object SearchScreen {
def apply(key: UndefOr[String] = js.undefined, ref: js.Function1[Component, _] = null) = createElementNoProps(ctor, key = key, ref = ref)


object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {

val container = style(
flex := 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import sri.mobile.components.android.ToolbarAndroid
import sri.universal.components._
import sri.universal.router
import sri.universal.router.{NavigatorRoute, UniversalRouterComponent, UniversalRouterCtrl}
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
Expand Down Expand Up @@ -43,7 +43,7 @@ object DefaultAndroidNavigationBar {
/**
* style for navigation bar
*/
trait Style extends SriStyleSheet {
trait Style extends UniversalStyleSheet {

def toolbar = style(
height := 56,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sri.mobile.components.android.{ProgressBarAndroid, ProgressBarAndroidStyl
import sri.mobile.components.{TouchableNativeFeedback, TouchableNativeFeedbackS}
import sri.universal.ReactEvent
import sri.universal.components._
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js
import scala.scalajs.js.UndefOr
Expand Down Expand Up @@ -58,7 +58,7 @@ object SearchBarAndroid {
}
}

object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {

val searchBar = style(
height := 56,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sri.mobile.all._
import sri.mobile.components.ios.ActivityIndicatorIOS
import sri.universal.ReactEvent
import sri.universal.components.{AutoCapitalize, TextInput, View}
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js
import scala.scalajs.js.UndefOr
Expand All @@ -25,7 +25,7 @@ object SearchBarIOS {
)
}

object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {

val searchBar = style(
padding := 3,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package sri.mobile.examples.router

import sri.core.ReactElement
import sri.mobile.components.DefaultNavigationBar
import sri.mobile.components.DefaultNavigationBar.Style
import sri.mobile.examples.router.components.{FourthScreen, HomeScreen, Person, SecondScreen}
import sri.mobile.examples.router.routes.ThirdModule
import sri.universal.components.View
import sri.universal.components.DefaultNavigationBar.Style
import sri.universal.components.{DefaultNavigationBar, View}
import sri.universal.router._
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet


object RouterExampleApp {
Expand All @@ -31,7 +30,7 @@ object RouterExampleApp {
override val notFound: (StaticPage, NavigatorRoute) = initialRoute

override def renderScene(route: NavigatorRoute): ReactElement = {
View(style = SriStyleSheet.wholeContainer)(
View(style = UniversalStyleSheet.wholeContainer)(
DefaultNavigationBar(route, CustomNavigationBarTheme),
super.renderScene(route)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sri.mobile.examples.router.routes.ThirdModule
import sri.universal.components._
import sri.universal.router
import sri.universal.router.{UniversalRouterComponent, _}
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js
import scala.scalajs.js.Dynamic.{literal => json}
Expand Down Expand Up @@ -59,7 +59,7 @@ object HomeScreen {
def apply() = createElementNoProps(ctor)
}

object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {

val container = style(flexOne,
// alignItems.center,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package sri.mobile.examples.uiexplorer

import sri.core.ReactElement
import sri.mobile.components.DefaultNavigationBar
import sri.universal.components.View
import sri.universal.components.{DefaultNavigationBar, View}
import sri.universal.router._
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

object UIExplorerApp {

Expand All @@ -20,7 +19,7 @@ object UIExplorerApp {
dynamicRoute(UIExplorerDetails, component = (c: ReactElement) => c)

override def renderScene(route: NavigatorRoute): ReactElement = {
View(style = SriStyleSheet.wholeContainer)(
View(style = UniversalStyleSheet.wholeContainer)(
DefaultNavigationBar(route),
super.renderScene(route)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package sri.mobile.examples.uiexplorer
import sri.core.ElementFactory._
import sri.core.{ReactComponent, ReactNode}
import sri.universal.components._
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined


object UIExplorerBlock {

object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {

val container = style(
borderRadius := 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import sri.mobile.examples.uiexplorer.components.ios._
import sri.universal.components._
import sri.universal.router
import sri.universal.router.UniversalRouterComponent
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js
import scala.scalajs.js.Dynamic.{literal => json}
Expand Down Expand Up @@ -141,7 +141,7 @@ object UIExplorerListScreen {

}

object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {
val listContainer = style(
flex := 1
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package sri.mobile.examples.uiexplorer
import sri.core.ElementFactory._
import sri.core.{ReactComponent, _}
import sri.universal.components._
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined

object UIExplorerPage {

object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {

val wrapper = style(
flex := 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import sri.mobile.all._
import sri.mobile.apis.AlertButton
import sri.mobile.examples.uiexplorer.{UIExample, UIExplorerBlock, UIExplorerPage}
import sri.universal.components._
import sri.universal.styles.SriStyleSheet
import sri.universal.styles.UniversalStyleSheet

import scala.scalajs.js
import scala.scalajs.js.Dynamic.{literal => json}
Expand Down Expand Up @@ -74,7 +74,7 @@ object AlertIOSExample extends UIExample {

val component = createElementNoProps(ctor)

object styles extends SriStyleSheet {
object styles extends UniversalStyleSheet {
val alertsContainer = style(backgroundColor := "white",
padding := 20)
val wrapper = style(borderRadius := 5, marginBottom := 5)
Expand Down
Loading

0 comments on commit 67182b5

Please sign in to comment.