Skip to content

Commit

Permalink
Merge pull request facebook#66 from ulrikstrid/reason-react-0-2-4
Browse files Browse the repository at this point in the history
Update to reason-react 0.2-4
  • Loading branch information
saschatimme committed Sep 2, 2017
2 parents ef9b96d + 0d706fc commit 13cf07e
Show file tree
Hide file tree
Showing 29 changed files with 101 additions and 62 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
"name": "bs-react-native",
"version": "0.1.0",
"scripts": {
"build": "bsb -make-world",
"start": "bsb -make-world -w",
"clean": "bsb -clean-world",
"test": "exit 0"
"build": "bsb -make-world",
"start": "bsb -make-world -w",
"clean": "bsb -clean-world",
"test": "exit 0"
},
"license": "MIT",
"keywords": ["reason", "reasonml","bucklescript", "react-native"],
"keywords": ["reason", "reasonml", "bucklescript", "react-native"],
"author": "",
"repository": {
"type": "git",
"url": "https://github.com/reasonml-community/bs-react-native.git"
},
"devDependencies": {
"bs-platform": "^1.9.0"
"bs-platform": "^1.9.1"
},
"dependencies": {
"reason-react": "^0.2.3"
"reason-react": "^0.2.4"
},
"peerDependencies": {
"react-native": "^0.46.0"
Expand Down
2 changes: 1 addition & 1 deletion src/components/activityIndicatorRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ let make:
accessibilityViewIsModal::bool? =>
shouldRasterizeIOS::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
9 changes: 6 additions & 3 deletions src/components/animatedComponentsRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ module Text: TextRe.TextComponent;

module ScrollView: {
let onScrollUpdater: x::'a? => y::'b? => native::bool? => unit => RNEvent.NativeEvent.t => unit;
type point = {x: float, y: float};
type point = {
x: float,
y: float
};
let scrollTo: ReasonReact.reactRef => x::int => y::int => animated::bool => unit;
let scrollToEnd: ReasonReact.reactRef => animated::bool => unit;
let make:
Expand Down Expand Up @@ -84,5 +87,5 @@ module ScrollView: {
snapToAlignment::[ | `center | `end_ | `start]? =>
zoomScale::float? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
};
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
};
2 changes: 1 addition & 1 deletion src/components/buttonRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ let make:
testID::string? =>
title::string? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
2 changes: 1 addition & 1 deletion src/components/datePickerIOSRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ let make:
accessibilityViewIsModal::bool? =>
shouldRasterizeIOS::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
12 changes: 9 additions & 3 deletions src/components/flatListRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,21 @@ let scrollToOffset: ReasonReact.reactRef => offset::int? => animated::Js.boolean

external recordInteraction : ReasonReact.reactRef => unit = "" [@@bs.send];

type renderBag 'item = {item: 'item, index: int};
type renderBag 'item = {
item: 'item,
index: int
};

type renderItem 'item;

let renderItem: (renderBag 'item => ReasonReact.reactElement) => renderItem 'item;

type separatorComponent 'item;

type separatorProps 'item = {highlighted: bool, leadingItem: option 'item};
type separatorProps 'item = {
highlighted: bool,
leadingItem: option 'item
};

let separatorComponent:
(separatorProps 'item => ReasonReact.reactElement) => separatorComponent 'item;
Expand Down Expand Up @@ -81,4 +87,4 @@ let make:
removeClippedSubviews::bool? =>
viewabilityConfig::Js.t {.}? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
33 changes: 24 additions & 9 deletions src/components/imageRe.re
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ module type ImageComponent = {
type defaultSource =
| URI defaultURISource
| Required PackagerRe.required;
module Event: {type error; type progress = {loaded: float, total: float};};
module Event: {
type error;
type progress = {
loaded: float,
total: float
};
};
let make:
onError::(Event.error => unit)? =>
onLayout::(RNEvent.NativeLayoutEvent.t => unit)? =>
Expand All @@ -42,7 +48,7 @@ module type ImageComponent = {
onPartialLoad::(unit => unit)? =>
onProgress::(Event.progress => unit)? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
};

module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
Expand All @@ -56,11 +62,18 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
/*
* Be careful not to refmt this away !!!
* https://github.com/facebook/reason/issues/821 (resolved, not released yet)
*
*
* This is hot it should look (or to copy it in again ^^)
* cache::[ | `default | `reload | `forceCache [@bs.as "force-cache"] | `onlyIfCached [@bs.as "only-if-cached"]] [@bs.string]? =>
*/
cache::[ | `default | `reload | `forceCache [@bs.as "force-cache"] | `onlyIfCached [@bs.as "only-if-cached"]] [@bs.string]? =>
cache::
[
| `default
| `reload
| `forceCache [@bs.as "force-cache"]
| `onlyIfCached [@bs.as "only-if-cached"]
]
[@bs.string]? =>
scale::float? =>
width::float? =>
height::float? =>
Expand All @@ -83,7 +96,10 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
module Event = {
type t;
type error;
type progress = {loaded: float, total: float};
type progress = {
loaded: float,
total: float
};
external progress : t => progress = "nativeEvent" [@@bs.get];
};
let encodeResizeMode x =>
Expand All @@ -105,8 +121,7 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
| `auto => "auto"
| `resize => "resize"
| `scale => "scale"
};

};
let encodeDefaultSource (x: defaultSource) =>
switch x {
| URI x => rawImageSourceJS x
Expand Down Expand Up @@ -149,7 +164,7 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
"accessible": from_opt (UtilsRN.optBoolToOptJsBoolean accessible),
"blurRadius": from_opt blurRadius,
"capInsets": from_opt capInsets,
"defaultSource":from_opt (UtilsRN.option_map encodeDefaultSource defaultSource),
"defaultSource": from_opt (UtilsRN.option_map encodeDefaultSource defaultSource),
"onPartialLoad": from_opt onPartialLoad,
"onProgress":
from_opt (UtilsRN.option_map (fun x y => x (Event.progress y)) onProgress)
Expand All @@ -160,4 +175,4 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
module Image =
CreateComponent {
external view : ReasonReact.reactClass = "Image" [@@bs.module "react-native"];
};
};
12 changes: 9 additions & 3 deletions src/components/imageRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ module type ImageComponent = {
type defaultSource =
| URI defaultURISource
| Required PackagerRe.required;
module Event: {type error; type progress = {loaded: float, total: float};};
module Event: {
type error;
type progress = {
loaded: float,
total: float
};
};
let make:
onError::(Event.error => unit)? =>
onLayout::(RNEvent.NativeLayoutEvent.t => unit)? =>
Expand All @@ -42,9 +48,9 @@ module type ImageComponent = {
onPartialLoad::(unit => unit)? =>
onProgress::(Event.progress => unit)? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
};

module CreateComponent: (Impl: ViewRe.Impl) => ImageComponent;

module Image: ImageComponent;
module Image: ImageComponent;
2 changes: 1 addition & 1 deletion src/components/modalRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ let make:
supportedOrientations::
[ | `landscape | `landscapeLeft | `landscapeRight | `portrait | `portraitUpsideDown]? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
4 changes: 2 additions & 2 deletions src/components/pickerRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Item: {
value::'value? =>
testID::string? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
};

let make:
Expand Down Expand Up @@ -55,4 +55,4 @@ let make:
accessibilityViewIsModal::bool? =>
shouldRasterizeIOS::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
2 changes: 1 addition & 1 deletion src/components/refreshControlRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ let make:
accessibilityViewIsModal::bool? =>
shouldRasterizeIOS::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
14 changes: 10 additions & 4 deletions src/components/scrollViewRe.re
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module type ScrollViewComponent = {
type point = {x: float, y: float};
type point = {
x: float,
y: float
};
let scrollTo: ReasonReact.reactRef => x::int => y::int => animated::bool => unit;
let scrollToEnd: ReasonReact.reactRef => animated::bool => unit;
let make:
Expand Down Expand Up @@ -77,11 +80,14 @@ module type ScrollViewComponent = {
snapToAlignment::[ | `center | `start | `end_]? =>
zoomScale::float? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
};

module CreateComponent (Impl: ViewRe.Impl) :ScrollViewComponent => {
type point = {x: float, y: float};
type point = {
x: float,
y: float
};
external _scrollTo :
ReasonReact.reactRef => Js.t {. x : int, y : int, animated : Js.boolean} => unit =
"scrollTo" [@@bs.send];
Expand Down Expand Up @@ -291,4 +297,4 @@ module CreateComponent (Impl: ViewRe.Impl) :ScrollViewComponent => {
module ScrollView =
CreateComponent {
external view : ReasonReact.reactClass = "ScrollView" [@@bs.module "react-native"];
};
};
9 changes: 6 additions & 3 deletions src/components/scrollViewRe.rei
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module type ScrollViewComponent = {
type point = {x: float, y: float};
type point = {
x: float,
y: float
};
let scrollTo: ReasonReact.reactRef => x::int => y::int => animated::bool => unit;
let scrollToEnd: ReasonReact.reactRef => animated::bool => unit;
let make:
Expand Down Expand Up @@ -77,9 +80,9 @@ module type ScrollViewComponent = {
snapToAlignment::[ | `center | `end_ | `start]? =>
zoomScale::float? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
};

module CreateComponent: (Impl: ViewRe.Impl) => ScrollViewComponent;

module ScrollView: ScrollViewComponent;
module ScrollView: ScrollViewComponent;
10 changes: 5 additions & 5 deletions src/components/sectionListRe.re
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ let separatorComponent
highlighted: Js.to_bool jsSeparatorProps##highlighted,
leadingItem: Js.Undefined.to_opt jsSeparatorProps##leadingItem,
leadingSection:
Js.Undefined.to_opt jsSeparatorProps##leadingSection |>
UtilsRN.option_map jsSectionToSection,
Js.Undefined.to_opt jsSeparatorProps##leadingSection
|> UtilsRN.option_map jsSectionToSection,
section: jsSectionToSection jsSeparatorProps##section,
trailingItem: Js.Undefined.to_opt jsSeparatorProps##trailingItem,
trailingSection:
Js.Undefined.to_opt jsSeparatorProps##trailingSection |>
UtilsRN.option_map jsSectionToSection
Js.Undefined.to_opt jsSeparatorProps##trailingSection
|> UtilsRN.option_map jsSectionToSection
};

type viewToken 'item =
Expand Down Expand Up @@ -131,7 +131,7 @@ let make:
renderSectionFooter::(Js.t {. section : section 'item} => ReasonReact.reactElement)? =>
stickySectionHeadersEnabled::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps =
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit =
fun ::sections
::renderItem
::keyExtractor
Expand Down
2 changes: 1 addition & 1 deletion src/components/sectionListRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ let make:
renderSectionFooter::(Js.t {. section : section 'item} => ReasonReact.reactElement)? =>
stickySectionHeadersEnabled::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
2 changes: 1 addition & 1 deletion src/components/segmentedControllOSRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ let make:
accessibilityViewIsModal::bool? =>
shouldRasterizeIOS::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
2 changes: 1 addition & 1 deletion src/components/sliderRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ let make:
accessibilityViewIsModal::bool? =>
shouldRasterizeIOS::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
2 changes: 1 addition & 1 deletion src/components/statusBarRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ let make:
networkActivityIndicatorVisible::bool? =>
showHideTransition::[ | `fade | `none | `slide]? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
2 changes: 1 addition & 1 deletion src/components/switchRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ let make:
accessibilityViewIsModal::bool? =>
shouldRasterizeIOS::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
4 changes: 2 additions & 2 deletions src/components/tabBarIOSRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module Item: {
accessibilityViewIsModal::bool? =>
shouldRasterizeIOS::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
};

let make:
Expand Down Expand Up @@ -100,4 +100,4 @@ let make:
accessibilityViewIsModal::bool? =>
shouldRasterizeIOS::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
2 changes: 1 addition & 1 deletion src/components/textInputRe.rei
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ let make:
selectionState::'documentSelectionState? =>
spellCheck::bool? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
4 changes: 2 additions & 2 deletions src/components/textRe.re
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module type TextComponent = {
suppressHighlighting::bool? =>
value::string? =>
array ReasonReact.reactElement =>
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
};

module CreateComponent (Impl: ViewRe.Impl) :TextComponent => {
Expand Down Expand Up @@ -96,4 +96,4 @@ module CreateComponent (Impl: ViewRe.Impl) :TextComponent => {
module Text =
CreateComponent {
external view : ReasonReact.reactClass = "Text" [@@bs.module "react-native"];
};
};
Loading

0 comments on commit 13cf07e

Please sign in to comment.