Skip to content

Commit 13cf07e

Browse files
authored
Merge pull request facebook#66 from ulrikstrid/reason-react-0-2-4
Update to reason-react 0.2-4
2 parents ef9b96d + 0d706fc commit 13cf07e

29 files changed

+101
-62
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
"name": "bs-react-native",
33
"version": "0.1.0",
44
"scripts": {
5-
"build": "bsb -make-world",
6-
"start": "bsb -make-world -w",
7-
"clean": "bsb -clean-world",
8-
"test": "exit 0"
5+
"build": "bsb -make-world",
6+
"start": "bsb -make-world -w",
7+
"clean": "bsb -clean-world",
8+
"test": "exit 0"
99
},
1010
"license": "MIT",
11-
"keywords": ["reason", "reasonml","bucklescript", "react-native"],
11+
"keywords": ["reason", "reasonml", "bucklescript", "react-native"],
1212
"author": "",
1313
"repository": {
1414
"type": "git",
1515
"url": "https://github.com/reasonml-community/bs-react-native.git"
1616
},
1717
"devDependencies": {
18-
"bs-platform": "^1.9.0"
18+
"bs-platform": "^1.9.1"
1919
},
2020
"dependencies": {
21-
"reason-react": "^0.2.3"
21+
"reason-react": "^0.2.4"
2222
},
2323
"peerDependencies": {
2424
"react-native": "^0.46.0"

src/components/activityIndicatorRe.rei

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ let make:
4343
accessibilityViewIsModal::bool? =>
4444
shouldRasterizeIOS::bool? =>
4545
array ReasonReact.reactElement =>
46-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
46+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/animatedComponentsRe.rei

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ module Text: TextRe.TextComponent;
66

77
module ScrollView: {
88
let onScrollUpdater: x::'a? => y::'b? => native::bool? => unit => RNEvent.NativeEvent.t => unit;
9-
type point = {x: float, y: float};
9+
type point = {
10+
x: float,
11+
y: float
12+
};
1013
let scrollTo: ReasonReact.reactRef => x::int => y::int => animated::bool => unit;
1114
let scrollToEnd: ReasonReact.reactRef => animated::bool => unit;
1215
let make:
@@ -84,5 +87,5 @@ module ScrollView: {
8487
snapToAlignment::[ | `center | `end_ | `start]? =>
8588
zoomScale::float? =>
8689
array ReasonReact.reactElement =>
87-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
88-
};
90+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
91+
};

src/components/buttonRe.rei

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ let make:
66
testID::string? =>
77
title::string? =>
88
array ReasonReact.reactElement =>
9-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
9+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/datePickerIOSRe.rei

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ let make:
4646
accessibilityViewIsModal::bool? =>
4747
shouldRasterizeIOS::bool? =>
4848
array ReasonReact.reactElement =>
49-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
49+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/flatListRe.rei

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,21 @@ let scrollToOffset: ReasonReact.reactRef => offset::int? => animated::Js.boolean
2121

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

24-
type renderBag 'item = {item: 'item, index: int};
24+
type renderBag 'item = {
25+
item: 'item,
26+
index: int
27+
};
2528

2629
type renderItem 'item;
2730

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

3033
type separatorComponent 'item;
3134

32-
type separatorProps 'item = {highlighted: bool, leadingItem: option 'item};
35+
type separatorProps 'item = {
36+
highlighted: bool,
37+
leadingItem: option 'item
38+
};
3339

3440
let separatorComponent:
3541
(separatorProps 'item => ReasonReact.reactElement) => separatorComponent 'item;
@@ -81,4 +87,4 @@ let make:
8187
removeClippedSubviews::bool? =>
8288
viewabilityConfig::Js.t {.}? =>
8389
array ReasonReact.reactElement =>
84-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
90+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/imageRe.re

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ module type ImageComponent = {
2222
type defaultSource =
2323
| URI defaultURISource
2424
| Required PackagerRe.required;
25-
module Event: {type error; type progress = {loaded: float, total: float};};
25+
module Event: {
26+
type error;
27+
type progress = {
28+
loaded: float,
29+
total: float
30+
};
31+
};
2632
let make:
2733
onError::(Event.error => unit)? =>
2834
onLayout::(RNEvent.NativeLayoutEvent.t => unit)? =>
@@ -42,7 +48,7 @@ module type ImageComponent = {
4248
onPartialLoad::(unit => unit)? =>
4349
onProgress::(Event.progress => unit)? =>
4450
array ReasonReact.reactElement =>
45-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
51+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
4652
};
4753

4854
module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
@@ -56,11 +62,18 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
5662
/*
5763
* Be careful not to refmt this away !!!
5864
* https://github.com/facebook/reason/issues/821 (resolved, not released yet)
59-
*
65+
*
6066
* This is hot it should look (or to copy it in again ^^)
6167
* cache::[ | `default | `reload | `forceCache [@bs.as "force-cache"] | `onlyIfCached [@bs.as "only-if-cached"]] [@bs.string]? =>
6268
*/
63-
cache::[ | `default | `reload | `forceCache [@bs.as "force-cache"] | `onlyIfCached [@bs.as "only-if-cached"]] [@bs.string]? =>
69+
cache::
70+
[
71+
| `default
72+
| `reload
73+
| `forceCache [@bs.as "force-cache"]
74+
| `onlyIfCached [@bs.as "only-if-cached"]
75+
]
76+
[@bs.string]? =>
6477
scale::float? =>
6578
width::float? =>
6679
height::float? =>
@@ -83,7 +96,10 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
8396
module Event = {
8497
type t;
8598
type error;
86-
type progress = {loaded: float, total: float};
99+
type progress = {
100+
loaded: float,
101+
total: float
102+
};
87103
external progress : t => progress = "nativeEvent" [@@bs.get];
88104
};
89105
let encodeResizeMode x =>
@@ -105,8 +121,7 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
105121
| `auto => "auto"
106122
| `resize => "resize"
107123
| `scale => "scale"
108-
};
109-
124+
};
110125
let encodeDefaultSource (x: defaultSource) =>
111126
switch x {
112127
| URI x => rawImageSourceJS x
@@ -149,7 +164,7 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
149164
"accessible": from_opt (UtilsRN.optBoolToOptJsBoolean accessible),
150165
"blurRadius": from_opt blurRadius,
151166
"capInsets": from_opt capInsets,
152-
"defaultSource":from_opt (UtilsRN.option_map encodeDefaultSource defaultSource),
167+
"defaultSource": from_opt (UtilsRN.option_map encodeDefaultSource defaultSource),
153168
"onPartialLoad": from_opt onPartialLoad,
154169
"onProgress":
155170
from_opt (UtilsRN.option_map (fun x y => x (Event.progress y)) onProgress)
@@ -160,4 +175,4 @@ module CreateComponent (Impl: ViewRe.Impl) :ImageComponent => {
160175
module Image =
161176
CreateComponent {
162177
external view : ReasonReact.reactClass = "Image" [@@bs.module "react-native"];
163-
};
178+
};

src/components/imageRe.rei

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ module type ImageComponent = {
2222
type defaultSource =
2323
| URI defaultURISource
2424
| Required PackagerRe.required;
25-
module Event: {type error; type progress = {loaded: float, total: float};};
25+
module Event: {
26+
type error;
27+
type progress = {
28+
loaded: float,
29+
total: float
30+
};
31+
};
2632
let make:
2733
onError::(Event.error => unit)? =>
2834
onLayout::(RNEvent.NativeLayoutEvent.t => unit)? =>
@@ -42,9 +48,9 @@ module type ImageComponent = {
4248
onPartialLoad::(unit => unit)? =>
4349
onProgress::(Event.progress => unit)? =>
4450
array ReasonReact.reactElement =>
45-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
51+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
4652
};
4753

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

50-
module Image: ImageComponent;
56+
module Image: ImageComponent;

src/components/modalRe.rei

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ let make:
99
supportedOrientations::
1010
[ | `landscape | `landscapeLeft | `landscapeRight | `portrait | `portraitUpsideDown]? =>
1111
array ReasonReact.reactElement =>
12-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
12+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/pickerRe.rei

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Item: {
55
value::'value? =>
66
testID::string? =>
77
array ReasonReact.reactElement =>
8-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
8+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
99
};
1010

1111
let make:
@@ -55,4 +55,4 @@ let make:
5555
accessibilityViewIsModal::bool? =>
5656
shouldRasterizeIOS::bool? =>
5757
array ReasonReact.reactElement =>
58-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
58+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/refreshControlRe.rei

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ let make:
4848
accessibilityViewIsModal::bool? =>
4949
shouldRasterizeIOS::bool? =>
5050
array ReasonReact.reactElement =>
51-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
51+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/scrollViewRe.re

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module type ScrollViewComponent = {
2-
type point = {x: float, y: float};
2+
type point = {
3+
x: float,
4+
y: float
5+
};
36
let scrollTo: ReasonReact.reactRef => x::int => y::int => animated::bool => unit;
47
let scrollToEnd: ReasonReact.reactRef => animated::bool => unit;
58
let make:
@@ -77,11 +80,14 @@ module type ScrollViewComponent = {
7780
snapToAlignment::[ | `center | `start | `end_]? =>
7881
zoomScale::float? =>
7982
array ReasonReact.reactElement =>
80-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
83+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
8184
};
8285

8386
module CreateComponent (Impl: ViewRe.Impl) :ScrollViewComponent => {
84-
type point = {x: float, y: float};
87+
type point = {
88+
x: float,
89+
y: float
90+
};
8591
external _scrollTo :
8692
ReasonReact.reactRef => Js.t {. x : int, y : int, animated : Js.boolean} => unit =
8793
"scrollTo" [@@bs.send];
@@ -291,4 +297,4 @@ module CreateComponent (Impl: ViewRe.Impl) :ScrollViewComponent => {
291297
module ScrollView =
292298
CreateComponent {
293299
external view : ReasonReact.reactClass = "ScrollView" [@@bs.module "react-native"];
294-
};
300+
};

src/components/scrollViewRe.rei

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module type ScrollViewComponent = {
2-
type point = {x: float, y: float};
2+
type point = {
3+
x: float,
4+
y: float
5+
};
36
let scrollTo: ReasonReact.reactRef => x::int => y::int => animated::bool => unit;
47
let scrollToEnd: ReasonReact.reactRef => animated::bool => unit;
58
let make:
@@ -77,9 +80,9 @@ module type ScrollViewComponent = {
7780
snapToAlignment::[ | `center | `end_ | `start]? =>
7881
zoomScale::float? =>
7982
array ReasonReact.reactElement =>
80-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
83+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
8184
};
8285

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

85-
module ScrollView: ScrollViewComponent;
88+
module ScrollView: ScrollViewComponent;

src/components/sectionListRe.re

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ let separatorComponent
9191
highlighted: Js.to_bool jsSeparatorProps##highlighted,
9292
leadingItem: Js.Undefined.to_opt jsSeparatorProps##leadingItem,
9393
leadingSection:
94-
Js.Undefined.to_opt jsSeparatorProps##leadingSection |>
95-
UtilsRN.option_map jsSectionToSection,
94+
Js.Undefined.to_opt jsSeparatorProps##leadingSection
95+
|> UtilsRN.option_map jsSectionToSection,
9696
section: jsSectionToSection jsSeparatorProps##section,
9797
trailingItem: Js.Undefined.to_opt jsSeparatorProps##trailingItem,
9898
trailingSection:
99-
Js.Undefined.to_opt jsSeparatorProps##trailingSection |>
100-
UtilsRN.option_map jsSectionToSection
99+
Js.Undefined.to_opt jsSeparatorProps##trailingSection
100+
|> UtilsRN.option_map jsSectionToSection
101101
};
102102

103103
type viewToken 'item =
@@ -131,7 +131,7 @@ let make:
131131
renderSectionFooter::(Js.t {. section : section 'item} => ReasonReact.reactElement)? =>
132132
stickySectionHeadersEnabled::bool? =>
133133
array ReasonReact.reactElement =>
134-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps =
134+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit =
135135
fun ::sections
136136
::renderItem
137137
::keyExtractor

src/components/sectionListRe.rei

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ let make:
7070
renderSectionFooter::(Js.t {. section : section 'item} => ReasonReact.reactElement)? =>
7171
stickySectionHeadersEnabled::bool? =>
7272
array ReasonReact.reactElement =>
73-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
73+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/segmentedControllOSRe.rei

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ let make:
4646
accessibilityViewIsModal::bool? =>
4747
shouldRasterizeIOS::bool? =>
4848
array ReasonReact.reactElement =>
49-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
49+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/sliderRe.rei

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ let make:
5353
accessibilityViewIsModal::bool? =>
5454
shouldRasterizeIOS::bool? =>
5555
array ReasonReact.reactElement =>
56-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
56+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/statusBarRe.rei

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ let make:
1717
networkActivityIndicatorVisible::bool? =>
1818
showHideTransition::[ | `fade | `none | `slide]? =>
1919
array ReasonReact.reactElement =>
20-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
20+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/switchRe.rei

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ let make:
4545
accessibilityViewIsModal::bool? =>
4646
shouldRasterizeIOS::bool? =>
4747
array ReasonReact.reactElement =>
48-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
48+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/tabBarIOSRe.rei

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module Item: {
5050
accessibilityViewIsModal::bool? =>
5151
shouldRasterizeIOS::bool? =>
5252
array ReasonReact.reactElement =>
53-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
53+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
5454
};
5555

5656
let make:
@@ -100,4 +100,4 @@ let make:
100100
accessibilityViewIsModal::bool? =>
101101
shouldRasterizeIOS::bool? =>
102102
array ReasonReact.reactElement =>
103-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
103+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/textInputRe.rei

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ let make:
115115
selectionState::'documentSelectionState? =>
116116
spellCheck::bool? =>
117117
array ReasonReact.reactElement =>
118-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
118+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;

src/components/textRe.re

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module type TextComponent = {
1818
suppressHighlighting::bool? =>
1919
value::string? =>
2020
array ReasonReact.reactElement =>
21-
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps;
21+
ReasonReact.component ReasonReact.stateless ReasonReact.noRetainedProps unit;
2222
};
2323

2424
module CreateComponent (Impl: ViewRe.Impl) :TextComponent => {
@@ -96,4 +96,4 @@ module CreateComponent (Impl: ViewRe.Impl) :TextComponent => {
9696
module Text =
9797
CreateComponent {
9898
external view : ReasonReact.reactClass = "Text" [@@bs.module "react-native"];
99-
};
99+
};

0 commit comments

Comments
 (0)