Skip to content

Commit eb3737c

Browse files
committed
bs-react-native-next: use commonjs as output instead of es6 (so we can use it for the website with node)
1 parent 212b825 commit eb3737c

16 files changed

Lines changed: 68 additions & 113 deletions

‎bs-react-native-next/bsconfig.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"namespace": "react-native",
44
"refmt": 3,
55
"package-specs": {
6-
"module": "es6",
6+
"module": "commonjs",
77
"in-source": true
88
},
99
"suffix": ".bs.js",

‎bs-react-native-next/src/apis/Animated.bs.js‎

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
'use strict';
12

2-
3-
import * as $$Array from "bs-platform/lib/es6/array.js";
4-
import * as Belt_Option from "bs-platform/lib/es6/belt_Option.js";
5-
import * as Caml_option from "bs-platform/lib/es6/caml_option.js";
6-
import * as Js_undefined from "bs-platform/lib/es6/js_undefined.js";
7-
import * as ReactNative from "react-native";
3+
var $$Array = require("bs-platform/lib/js/array.js");
4+
var Belt_Option = require("bs-platform/lib/js/belt_Option.js");
5+
var Caml_option = require("bs-platform/lib/js/caml_option.js");
6+
var Js_undefined = require("bs-platform/lib/js/js_undefined.js");
7+
var ReactNative = require("react-native");
88

99
function start(t, callback, param) {
1010
t.start(Js_undefined.fromOption(callback));
@@ -455,20 +455,17 @@ var spring = animate$1;
455455

456456
var decay = animate;
457457

458-
export {
459-
Animation ,
460-
ValueAnimations ,
461-
Interpolation ,
462-
ValueOperations ,
463-
Value ,
464-
ValueXY ,
465-
loop ,
466-
timing ,
467-
spring ,
468-
decay ,
469-
start ,
470-
stop ,
471-
reset ,
472-
473-
}
458+
exports.Animation = Animation;
459+
exports.ValueAnimations = ValueAnimations;
460+
exports.Interpolation = Interpolation;
461+
exports.ValueOperations = ValueOperations;
462+
exports.Value = Value;
463+
exports.ValueXY = ValueXY;
464+
exports.loop = loop;
465+
exports.timing = timing;
466+
exports.spring = spring;
467+
exports.decay = decay;
468+
exports.start = start;
469+
exports.stop = stop;
470+
exports.reset = reset;
474471
/* react-native Not a pure module */
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
'use strict';
22

33

44
var active = "active";
@@ -7,10 +7,7 @@ var background = "background";
77

88
var inactive = "inactive";
99

10-
export {
11-
active ,
12-
background ,
13-
inactive ,
14-
15-
}
10+
exports.active = active;
11+
exports.background = background;
12+
exports.inactive = inactive;
1613
/* No side effect */
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
'use strict';
12

2-
3-
import * as ReactNative from "react-native";
4-
import * as PromiseUtils$ReactNative from "../utils/PromiseUtils.bs.js";
3+
var ReactNative = require("react-native");
4+
var PromiseUtils$ReactNative = require("../utils/PromiseUtils.bs.js");
55

66
function getItem(key) {
77
return ReactNative.AsyncStorage.getItem(key).then(PromiseUtils$ReactNative.nullableToOption);
@@ -15,10 +15,7 @@ function multiGet(keys) {
1515
return ReactNative.AsyncStorage.multiGet(keys).then(PromiseUtils$ReactNative.nullableToOption);
1616
}
1717

18-
export {
19-
getItem ,
20-
getAllKeys ,
21-
multiGet ,
22-
23-
}
18+
exports.getItem = getItem;
19+
exports.getAllKeys = getAllKeys;
20+
exports.multiGet = multiGet;
2421
/* react-native Not a pure module */

‎bs-react-native-next/src/apis/Event.bs.js‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
'use strict';
22

33

44
var NativeEvent = /* module */[];
@@ -58,11 +58,8 @@ var NativeScrollEvent = /* module */[
5858

5959
var NativePressEvent = 0;
6060

61-
export {
62-
NativeEvent ,
63-
NativePressEvent ,
64-
NativeLayoutEvent ,
65-
NativeScrollEvent ,
66-
67-
}
61+
exports.NativeEvent = NativeEvent;
62+
exports.NativePressEvent = NativePressEvent;
63+
exports.NativeLayoutEvent = NativeLayoutEvent;
64+
exports.NativeScrollEvent = NativeScrollEvent;
6865
/* No side effect */
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
'use strict';
22

33

44
var Easing = /* module */[
@@ -9,8 +9,5 @@ var Easing = /* module */[
99
/* keyboard */"keyboard"
1010
];
1111

12-
export {
13-
Easing ,
14-
15-
}
12+
exports.Easing = Easing;
1613
/* No side effect */
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1+
'use strict';
12

2-
3-
import * as ReactNative from "react-native";
4-
import * as PromiseUtils$ReactNative from "../utils/PromiseUtils.bs.js";
3+
var ReactNative = require("react-native");
4+
var PromiseUtils$ReactNative = require("../utils/PromiseUtils.bs.js");
55

66
function getInitialURL(param) {
77
return ReactNative.Linking.getInitialURL().then(PromiseUtils$ReactNative.nullableToOption);
88
}
99

10-
export {
11-
getInitialURL ,
12-
13-
}
10+
exports.getInitialURL = getInitialURL;
1411
/* react-native Not a pure module */
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1+
'use strict';
12

2-
3-
import * as ReactNative from "react-native";
3+
var ReactNative = require("react-native");
44

55
function get(name) {
66
return ReactNative.NativeModules[name];
77
}
88

9-
export {
10-
get ,
11-
12-
}
9+
exports.get = get;
1310
/* react-native Not a pure module */

‎bs-react-native-next/src/apis/Style.bs.js‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
'use strict';
22

33

44
function pct(num) {
@@ -33,12 +33,9 @@ var FontVariant = /* module */[
3333
/* proportionalNums */"proportional-nums"
3434
];
3535

36-
export {
37-
pct ,
38-
Margin ,
39-
Size ,
40-
Transform ,
41-
FontVariant ,
42-
43-
}
36+
exports.pct = pct;
37+
exports.Margin = Margin;
38+
exports.Size = Size;
39+
exports.Transform = Transform;
40+
exports.FontVariant = FontVariant;
4441
/* No side effect */
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
1+
'use strict';
22

33

44
var small = "small";
55

66
var large = "large";
77

8-
export {
9-
small ,
10-
large ,
11-
12-
}
8+
exports.small = small;
9+
exports.large = large;
1310
/* No side effect */

0 commit comments

Comments
 (0)