Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ package-lock.json
**/lib/bs
**/lib/ocaml
**/.merlin

_opam
_build
.vscode
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ before reporting issue.
- Upgraded reason-react to 0.8.0 ([#689](https://github.com/reason-react-native/reason-react-native/issues/689)) by [@jfrolich](https://github.com/jfrolich)
See <https://reasonml.org/blog/reason-react-0-8-0> for more informations
- Upgraded to bs-platform 7.3.0 ([#631](https://github.com/reason-react-native/reason-react-native/issues/631)) by [@idkjs](https://github.com/idkjs) ([#666](https://github.com/reason-react-native/reason-react-native/issues/666)) by [@Arnarkari93](https://github.com/Arnarkari93) ([#674](https://github.com/reason-react-native/reason-react-native/issues/674)) ([#693](https://github.com/reason-react-native/reason-react-native/issues/693)) ([#690](https://github.com/reason-react-native/reason-react-native/issues/690)) ([#694](https://github.com/reason-react-native/reason-react-native/issues/694)) by [@sgny](https://github.com/sgny) ([#695](https://github.com/reason-react-native/reason-react-native/issues/695)) by [@cknitt](https://github.com/cknitt)
We have converted `Js.t` objects to records where possible (we had to skipped objects that rely on `[@bs.meth]`). This means ou will have to change a lot of `##` notation to just a dot (`.`) to access properties.
We have converted `Js.t` objects to records where possible (we had to skipped objects that rely on `[@mel.meth]`). This means ou will have to change a lot of `##` notation to just a dot (`.`) to access properties.
See <https://reasonml.org/blog/whats-new-in-7-pt1> for more informations
- Removed some methods for FlatList, ScrollView, SectionList, VirtualizedList and VirtualizedSectionList ([#680](https://github.com/reason-react-native/reason-react-native/issues/680)) by [@sgny](https://github.com/sgny)
These components are interrelated in the sense of being based on each other and inheriting props, however, applicable methods are not inherited quite so consistently. We removed unavailable methods from each component.
Expand Down Expand Up @@ -222,7 +222,7 @@ Sorry, a mix of bugfixes & changes! This should be easy to handle for you.
- Fix `AppState` (now return `unit`) [#568](https://github.com/reason-react-native/reason-react-native/pull/568) by [@cknitt](https://github.com/cknitt)
- Fix `Animated.event` type so it can be used in `Animated.ScrollView`
`onScroll` props (& similar) [#584](https://github.com/reason-react-native/reason-react-native/pull/584) by [@MoOx](https://github.com/MoOx)
- Fix missing `[@bs.meth]` in methods of `Event`, `BackHandler` & `NetInfo` [#621](https://github.com/reason-react-native/reason-react-native/pull/621) by [@cknitt](https://github.com/cknitt)
- Fix missing `[@mel.meth]` in methods of `Event`, `BackHandler` & `NetInfo` [#621](https://github.com/reason-react-native/reason-react-native/pull/621) by [@cknitt](https://github.com/cknitt)
- Fix `ScrollView` `scrollToItem`, `scrollToIndex` and `scrollToOffset` [#569](https://github.com/reason-react-native/reason-react-native/pull/569) by [@benadamstyles](https://github.com/benadamstyles)
- Fix `Webview` `contentInset` prop [#607](https://github.com/reason-react-native/reason-react-native/pull/607) by [@cem2ran](https://github.com/cem2ran)
- Fix `WebView` event types & add missing fields [#608](https://github.com/reason-react-native/reason-react-native/pull/608) by [@cem2ran](https://github.com/cem2ran)
Expand Down
61 changes: 61 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
project_name = reason-react-native

DUNE = opam exec -- dune

.DEFAULT_GOAL := help

.PHONY: help
help: ## Print this help message
@echo "List of available make commands";
@echo "";
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}';
@echo "";

.PHONY: nuke
nuke: ## Delete all files that will be generated
rm $(project_name).opam
rm -rf node_modules
opam switch remove . -y

.PHONY: create-switch
create-switch: ## Create opam switch
opam switch create . -y --empty
opam install dune -y

.PHONY: init
init: create-switch install ## Configure everything to develop this repository in local

.PHONY: generate-opam
generate-opam: ## Generate the opam file
$(DUNE) build $(project_name).opam

.PHONY: install
install: generate-opam ## Install development dependencies
yarn install
opam update
opam install -y . --deps-only --with-test
opam exec opam-check-npm-deps

.PHONY: build
build: ## Build the project
$(DUNE) build

.PHONY: watch
watch: ## Watch for the filesystem and rebuild on every change
$(DUNE) build --watch

.PHONY: test
test:
yarn test

.PHONY: clean
clean: ## Clean build artifacts and other generated files
$(DUNE) clean

.PHONY: format
format: ## Format the codebase with ocamlformat
$(DUNE) build @fmt --auto-promote

.PHONY: format-check
format-check: ## Checks if format is correct
$(DUNE) build @fmt
24 changes: 0 additions & 24 deletions bsconfig.json

This file was deleted.

1 change: 1 addition & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(dirs :standard \ node_modules)
38 changes: 38 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(lang dune 3.12)

(using melange 0.1)

(source
(github riKiMasan/reason-react-native))

(license MIT)

(maintainers "unmaintained")

(authors "idk")

(homepage https://github.com/riKiMasan/reason-react-native)

(bug_reports https://github.com/riKiMasan/reason-react-native/issues)

(name reason-react-native)

(package
(name reason-react-native)
(synopsis "ReasonML Bindings for React Native")
(description "ReasonML Bindings for React Native")
(depends
dot-merlin-reader
(melange
(>= 2.0.0))
(ocaml
(>= 5.1.0))
(reason
(>= 3.10.0))
ocaml-lsp-server ; change to (ocaml-lsp-server :with-dev-setup) when opam 2.2 releases
ocamlformat ; with-dev-setup
reason-react
opam-check-npm-deps ; with-dev-setup
))

(generate_opam_files)
48 changes: 8 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
"description": "ReScript bindings for React Native.",
"version": "0.64.0",
"peerDependencies": {
"bs-platform": "^8.2.0",
"react-native": "^0.64.0",
"reason-react": "^0.9.1"
"react-native": "^0.64.0"
},
"repository": "https://github.com/reason-react-native/reason-react-native.git",
"license": "MIT",
"keywords": [
"rescript",
"reason",
"reasonml",
"bucklescript",
"melange",
"react-native"
],
"files": [
Expand All @@ -23,41 +21,11 @@
"src/**/*.js",
"!src/**/*.bs.js"
],
"scripts": {
"format:most": "prettier --write \"**/*.{md,json,js,css}\"",
"format:re": "find . -name \"*.re\" -or -name \"*.rei\" | grep -v \"node_modules\" | xargs bsrefmt --in-place",
"format": "yarn format:most && yarn format:re",
"re:start": "bsb -make-world -w",
"re:build": "bsb -make-world",
"re:clean-build": "bsb -clean-world -make-world",
"start": "yarn re:start",
"build": "yarn re:build",
"test": "yarn re:clean-build",
"release": "npmpub"
},
"devDependencies": {
"bs-platform": "^8.3.0",
"husky": "^4.0.0",
"lint-staged": "^10.0.0",
"npm-run-all": "^3.0.0",
"npmpub": "^5.0.0",
"prettier": "^2.0.0",
"reason-react": "^0.9.1"
},
"prettier": {
"trailingComma": "all"
},
"lint-staged": {
"*.{md,json,js,css}": [
"prettier --write"
],
"*.{re,rei}": [
"bsrefmt --in-place"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.0",
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6"
}
}
}
36 changes: 36 additions & 0 deletions reason-react-native.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "ReasonML Bindings for React Native"
description: "ReasonML Bindings for React Native"
maintainer: ["unmaintained"]
authors: ["idk"]
license: "MIT"
homepage: "https://github.com/riKiMasan/reason-react-native"
bug-reports: "https://github.com/riKiMasan/reason-react-native/issues"
depends: [
"dune" {>= "3.12"}
"dot-merlin-reader"
"melange" {>= "2.0.0"}
"ocaml" {>= "5.1.0"}
"reason" {>= "3.10.0"}
"ocaml-lsp-server"
"ocamlformat"
"reason-react"
"opam-check-npm-deps"
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/riKiMasan/reason-react-native.git"
6 changes: 3 additions & 3 deletions src/apis/AccessibilityInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ To query whether reduce motion is currently enabled. Promise resolves to `true`
when reduce motion is enabled and `false` otherwise.

```reason
[@bs.scope "AccesibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccesibilityInfo"] [@mel.module "react-native"]
external isReduceMotionEnabled: unit => Js.Promise.t(bool) = "isReduceMotionEnabled";
```

Expand All @@ -74,7 +74,7 @@ To query whether reduce transparency is currently enabled. Promise resolves to
`true` when reduce transparency is enabled and `false` otherwise.

```reason
[@bs.scope "AccesibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccesibilityInfo"] [@mel.module "react-native"]
external isReduceTransparencyEnabled: unit => Js.Promise.t(bool) = "isReduceTransparencyEnabled";
```

Expand All @@ -84,7 +84,7 @@ To query whether screen reader is currently enabled. Promise resolves to `true`
when screen reader is enabled and `false` otherwise.

```reason
[@bs.scope "AccesibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccesibilityInfo"] [@mel.module "react-native"]
external isScreenReaderEnabled: unit => Js.Promise.t(bool) = "isScreenReaderEnabled";
```

Expand Down
24 changes: 12 additions & 12 deletions src/apis/AccessibilityInfo.re
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,40 @@ type announcementResult = {
success: bool,
};

[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccessibilityInfo"] [@mel.module "react-native"]
external isBoldTextEnabled: unit => Js.Promise.t(bool) = "isBoldTextEnabled";

[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccessibilityInfo"] [@mel.module "react-native"]
external isGrayscaleEnabled: unit => Js.Promise.t(bool) =
"isGrayscaleEnabled";

[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccessibilityInfo"] [@mel.module "react-native"]
external isInvertColorsEnabled: unit => Js.Promise.t(bool) =
"isInvertColorsEnabled";

[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccessibilityInfo"] [@mel.module "react-native"]
external isReduceMotionEnabled: unit => Js.Promise.t(bool) =
"isReduceMotionEnabled";

[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccessibilityInfo"] [@mel.module "react-native"]
external isReduceTransparencyEnabled: unit => Js.Promise.t(bool) =
"isReduceTransparencyEnabled";

[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccessibilityInfo"] [@mel.module "react-native"]
external isScreenReaderEnabled: unit => Js.Promise.t(bool) =
"isScreenReaderEnabled";

[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccessibilityInfo"] [@mel.module "react-native"]
external setAccessibilityFocus: NativeTypes.nodeHandle => unit =
"setAccessibilityFocus";

[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccessibilityInfo"] [@mel.module "react-native"]
external announceForAccessibility: string => unit = "announceForAccessibility";

[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccessibilityInfo"] [@mel.module "react-native"]
external addEventListener:
(
[@bs.string]
[@mel.string]
[
| `boldTextChanged(bool => unit)
| `grayscaleChanged(bool => unit)
Expand All @@ -50,10 +50,10 @@ external addEventListener:
unit =
"addEventListener";

[@bs.scope "AccessibilityInfo"] [@bs.module "react-native"]
[@mel.scope "AccessibilityInfo"] [@mel.module "react-native"]
external removeEventListener:
(
[@bs.string]
[@mel.string]
[
| `boldTextChanged(bool => unit)
| `grayscaleChanged(bool => unit)
Expand Down
8 changes: 4 additions & 4 deletions src/apis/ActionSheetIOS.re
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type options;
[@bs.obj]
[@mel.obj]
external options:
(
~options: array(string),
Expand All @@ -13,12 +13,12 @@ external options:
) =>
options;

[@bs.module "react-native"] [@bs.scope "ActionSheetIOS"]
[@mel.module "react-native"] [@mel.scope "ActionSheetIOS"]
external showActionSheetWithOptions: (options, int => unit) => unit =
"showActionSheetWithOptions";

type shareOptions;
[@bs.obj]
[@mel.obj]
external shareOptions:
(
~url: string=?,
Expand All @@ -31,7 +31,7 @@ external shareOptions:

type error = {stack: option(string)};

[@bs.module "react-native"] [@bs.scope "ActionSheetIOS"]
[@mel.module "react-native"] [@mel.scope "ActionSheetIOS"]
external showShareActionSheetWithOptions:
(shareOptions, error => unit, (bool, string) => unit) => unit =
"showShareActionSheetWithOptions";
Loading