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;

0 commit comments

Comments
 (0)