Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update to rescript 12
  • Loading branch information
Freddy03h committed Apr 25, 2026
commit 25c6ebd03a5a56274c6fc1ce40075dd04d56473e
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ node_modules
# ReScript artifacts
# *.bs.js # we do want this files to ensure zero-cost
.bsb.lock
**/lib/bs
**/lib/ocaml
lib/
**/.merlin
2,100 changes: 639 additions & 1,461 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"description": "ReScript bindings for React Native.",
"version": "0.83.0",
"peerDependencies": {
"@rescript/react": ">=0.14.2",
"@rescript/react": ">=0.15.0",
"react-native": ">=0.83.0",
"rescript": ">=11.0.0"
"rescript": ">=12.0.0"
},
"overrides": {
"react": "^19.2.0"
Expand Down Expand Up @@ -39,13 +39,13 @@
"release": "npmpub"
},
"devDependencies": {
"@rescript/react": "^0.14.2",
"@rescript/react": "^0.15.0",
"husky": "^8.0.0",
"lint-staged": "^13.0.0",
"npm-run-all": "^4.0.0",
"npmpub": "^5.0.0",
"prettier": "^2.0.0",
"rescript": "^11.1.0"
"rescript": "^12.2.0"
},
"prettier": {
"trailingComma": "all"
Expand Down
4 changes: 2 additions & 2 deletions rescript.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"subdirs": true
}
],
"bsc-flags": [
"compiler-flags": [
"-bs-no-version-header"
],
"warnings": {
"error": true
},
"bs-dependencies": [
"dependencies": [
"@rescript/react"
]
}
84 changes: 42 additions & 42 deletions src/apis/Animated.bs.js
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
'use strict';

var Caml_option = require("rescript/lib/js/caml_option.js");
var ReactNative = require("react-native");
let ReactNative = require("react-native");
let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.js");

var $$Animation = {};
let Animation = {};

function ValueAnimations(Val) {
var Decay = {};
var Spring = {};
var Timing = {};
let Decay = {};
let Spring = {};
let Timing = {};
return {
Decay: Decay,
Spring: Spring,
Timing: Timing
};
Decay: Decay,
Spring: Spring,
Timing: Timing
};
}

var Interpolation = {};
let Interpolation = {};

function interpolate(prim0, prim1) {
return prim0.interpolate(prim1);
}

var ValueOperations = {
let ValueOperations = {
interpolate: interpolate
};

function ValueMethods(Val) {
var Decay = {};
var Spring = {};
var Timing = {};
let Decay = {};
let Spring = {};
let Timing = {};
return {
Decay: Decay,
Spring: Spring,
Timing: Timing
};
Decay: Decay,
Spring: Spring,
Timing: Timing
};
}

var Decay = {};
let Decay = {};

var Spring = {};
let Spring = {};

var Timing = {};
let Timing = {};

var Value = {
let Value = {
Decay: Decay,
Spring: Spring,
Timing: Timing,
interpolate: interpolate
};

var Decay$1 = {};
let Decay$1 = {};

var Spring$1 = {};
let Spring$1 = {};

var Timing$1 = {};
let Timing$1 = {};

var ValueXY = {
let ValueXY = {
Decay: Decay$1,
Spring: Spring$1,
Timing: Timing$1
};

var Decay$2 = {};
let Decay$2 = {};

var Spring$2 = {};
let Spring$2 = {};

var Timing$2 = {};
let Timing$2 = {};

var Color = {
let Color = {
Decay: Decay$2,
Spring: Spring$2,
Timing: Timing$2
Expand All @@ -87,7 +87,7 @@ function decay(prim0, prim1) {
}

function start(prim0, prim1) {
prim0.start(prim1 !== undefined ? Caml_option.valFromOption(prim1) : undefined);
prim0.start(prim1 !== undefined ? Primitive_option.valFromOption(prim1) : undefined);
}

function stop(prim) {
Expand All @@ -98,21 +98,21 @@ function reset(prim) {
prim.reset();
}

var StyleProp = {};
let StyleProp = {};

var FlatList = {};
let FlatList = {};

var $$Image = {};
let Image = {};

var ScrollView = {};
let ScrollView = {};

var SectionList = {};
let SectionList = {};

var $$Text = {};
let Text = {};

var View = {};
let View = {};

exports.$$Animation = $$Animation;
exports.Animation = Animation;
exports.ValueAnimations = ValueAnimations;
exports.Interpolation = Interpolation;
exports.ValueOperations = ValueOperations;
Expand All @@ -128,9 +128,9 @@ exports.stop = stop;
exports.reset = reset;
exports.StyleProp = StyleProp;
exports.FlatList = FlatList;
exports.$$Image = $$Image;
exports.Image = Image;
exports.ScrollView = ScrollView;
exports.SectionList = SectionList;
exports.$$Text = $$Text;
exports.Text = Text;
exports.View = View;
/* react-native Not a pure module */
2 changes: 1 addition & 1 deletion src/apis/AppRegistry.res
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type appConfig<'a> = {
}

type runnable<'a> = {
"component": Js.Nullable.t<componentProvider<'a>>,
"component": nullable<componentProvider<'a>>,
@meth
"run": appParameters => unit,
}
Expand Down
2 changes: 1 addition & 1 deletion src/apis/BackHandler.res
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ external exitApp: unit => unit = "exitApp"
type eventType = [#hardwareBackPress]

@scope("BackHandler") @module("react-native")
external addEventListener: (eventType, unit => Js.Nullable.t<bool>) => remove = "addEventListener"
external addEventListener: (eventType, unit => nullable<bool>) => remove = "addEventListener"
8 changes: 4 additions & 4 deletions src/apis/Color.bs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@


function rgb(r, g, b) {
return "rgb(" + r.toString() + ", " + g.toString() + ", " + b.toString() + ")";
return `rgb(` + r.toString() + `, ` + g.toString() + `, ` + b.toString() + `)`;
}

function rgba(r, g, b, a) {
return "rgba(" + r.toString() + ", " + g.toString() + ", " + b.toString() + ", " + a.toString() + ")";
return `rgba(` + r.toString() + `, ` + g.toString() + `, ` + b.toString() + `, ` + a.toString() + `)`;
}

function hsl(h, s, l) {
return "hsl(" + h.toString() + ", " + s.toString() + "%, " + l.toString() + "%)";
return `hsl(` + h.toString() + `, ` + s.toString() + `%, ` + l.toString() + `%)`;
}

function hsla(h, s, l, a) {
return "hsl(" + h.toString() + ", " + s.toString() + "%, " + l.toString() + "%, " + a.toString() + ")";
return `hsl(` + h.toString() + `, ` + s.toString() + `%, ` + l.toString() + `%, ` + a.toString() + `)`;
}

exports.rgb = rgb;
Expand Down
8 changes: 4 additions & 4 deletions src/apis/Color.res
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ type t = string
external processColor: string => string = "processColor"

let rgb = (~r: int, ~g: int, ~b: int) =>
`rgb(${r->Js.Int.toString}, ${g->Js.Int.toString}, ${b->Js.Int.toString})`
`rgb(${r->Int.toString}, ${g->Int.toString}, ${b->Int.toString})`
let rgba = (~r: int, ~g: int, ~b: int, ~a: float) =>
`rgba(${r->Js.Int.toString}, ${g->Js.Int.toString}, ${b->Js.Int.toString}, ${a->Js.Float.toString})`
`rgba(${r->Int.toString}, ${g->Int.toString}, ${b->Int.toString}, ${a->Float.toString})`

let hsl = (~h: float, ~s: float, ~l: float) =>
`hsl(${h->Js.Float.toString}, ${s->Js.Float.toString}%, ${l->Js.Float.toString}%)`
`hsl(${h->Float.toString}, ${s->Float.toString}%, ${l->Float.toString}%)`
let hsla = (~h: float, ~s: float, ~l: float, ~a: float) =>
`hsl(${h->Js.Float.toString}, ${s->Js.Float.toString}%, ${l->Js.Float.toString}%, ${a->Js.Float.toString})`
`hsl(${h->Float.toString}, ${s->Float.toString}%, ${l->Float.toString}%, ${a->Float.toString})`

@inline
let transparent = "transparent"
Expand Down
18 changes: 9 additions & 9 deletions src/apis/Event.bs.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ function ResponderSyntheticEvent(T) {
return {};
}

var BlurEvent = {};
let BlurEvent = {};

var $$FocusEvent = {};
let FocusEvent = {};

var LayoutEvent = {};
let LayoutEvent = {};

var TextLayoutEvent = {};
let TextLayoutEvent = {};

var PressEvent = {};
let PressEvent = {};

var ScrollEvent = {};
let ScrollEvent = {};

var SwitchChangeEvent = {};
let SwitchChangeEvent = {};

var TargetEvent = {};
let TargetEvent = {};

exports.EventMethods = EventMethods;
exports.SyntheticEvent = SyntheticEvent;
exports.ResponderSyntheticEvent = ResponderSyntheticEvent;
exports.BlurEvent = BlurEvent;
exports.$$FocusEvent = $$FocusEvent;
exports.FocusEvent = FocusEvent;
exports.LayoutEvent = LayoutEvent;
exports.TextLayoutEvent = TextLayoutEvent;
exports.PressEvent = PressEvent;
Expand Down
30 changes: 15 additions & 15 deletions src/apis/Event.res
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ module SyntheticEvent = (
},
) => {
type t = {
bubbles: Js.Nullable.t<bool>,
cancelable: Js.Nullable.t<bool>,
bubbles: nullable<bool>,
cancelable: nullable<bool>,
currentTarget: float,
defaultPrevented: Js.Nullable.t<bool>,
defaultPrevented: nullable<bool>,
dispatchConfig: registrationName,
eventPhase: Js.Nullable.t<float>,
isTrusted: Js.Nullable.t<bool>,
eventPhase: nullable<float>,
isTrusted: nullable<bool>,
nativeEvent: T._payload,
target: Js.Nullable.t<float>,
target: nullable<float>,
timeStamp: float,
\"type": Js.Nullable.t<string>,
\"type": nullable<string>,
}

include EventMethods({
Expand Down Expand Up @@ -85,17 +85,17 @@ module ResponderSyntheticEvent = (
}

type t = {
bubbles: Js.Nullable.t<bool>,
cancelable: Js.Nullable.t<bool>,
bubbles: nullable<bool>,
cancelable: nullable<bool>,
currentTarget: float,
defaultPrevented: Js.Nullable.t<bool>,
defaultPrevented: nullable<bool>,
dispatchConfig: registrationName,
eventPhase: Js.Nullable.t<float>,
isTrusted: Js.Nullable.t<bool>,
eventPhase: nullable<float>,
isTrusted: nullable<bool>,
nativeEvent: T._payload,
target: Js.Nullable.t<float>,
target: nullable<float>,
timeStamp: float,
\"type": Js.Nullable.t<string>,
\"type": nullable<string>,
touchHistory: touchHistory,
}

Expand Down Expand Up @@ -161,7 +161,7 @@ module PressEvent = {
locationY: float,
pageX: float,
pageY: float,
target: Js.Nullable.t<float>,
target: nullable<float>,
timestamp: float,
touches: array<payload>,
}
Expand Down
2 changes: 1 addition & 1 deletion src/apis/LayoutAnimation.bs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';


var Presets = {};
let Presets = {};

exports.Presets = Presets;
/* No side effect */
2 changes: 1 addition & 1 deletion src/apis/Linking.bs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';


var ExtraValue = {};
let ExtraValue = {};

exports.ExtraValue = ExtraValue;
/* No side effect */
2 changes: 1 addition & 1 deletion src/apis/Linking.res
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ external openURL: string => promise<unit> = "openURL"
external canOpenURL: string => promise<bool> = "canOpenURL"

@scope("Linking") @module("react-native")
external getInitialURL: unit => promise<Js.Null.t<string>> = "getInitialURL"
external getInitialURL: unit => promise<null<string>> = "getInitialURL"

@scope("Linking") @module("react-native")
external openSettings: unit => promise<unit> = "openSettings"
Expand Down
2 changes: 1 addition & 1 deletion src/apis/LogBox.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external ignoreLogs: array<string> => unit = "ignoreLogs"

@module("react-native") @scope("LogBox")
external ignoreLogsRegex: array<Js.Re.t> => unit = "ignoreLogs"
external ignoreLogsRegex: array<RegExp.t> => unit = "ignoreLogs"

@module("react-native") @scope("LogBox")
external ignoreAllLogs: (~ignore: bool=?) => unit = "ignoreAllLogs"
Expand Down
Loading