This repo was created with following trials and errors according to official instructions.
One window:
yarn ios
# or
yarn android
Second window:
yarn re:watch
For Mac - install (!!!) XCode 11 and OpenJDK8 For Android - ??
Using Node v10.10.0
yarn global add react-native-cli bs-platform --ignore-engines
This should work, but for me it did not:
react-native init RNRTemplate --template reason-react-native-template
So I needed to create Reason project manually.
- create repo
react-native init RNRTemplate
cd RNRTemplate
yarn add bs-platform --dev && yarn add reason-react reason-react-native
- Add following lines to
.gitignore
:
# Reason
*.bs.js
.bsb.lock
.merlin
lib/bs
- Then I add scripts to
package.json
for working with ReasonML compilation:
"scripts": {
"re:build": "bsb -clean-world -make-world",
"re:watch": "bsb -clean-world -make-world -w",
...
}
- Lastly you need create a file
bsconfig.json
to configure bucklescript.
{
"name": "demo-react-native-app",
"refmt": 3,
"reason": {
"react-jsx": 3
},
"package-specs": {
"module": "es6",
"in-source": true
},
"suffix": ".bs.js",
"sources": [
{
"dir": "src",
"subdirs": true
}
],
"bs-dependencies": ["reason-react", "reason-react-native"]
}
Result is this repo.
-
Install reasonml-language-server and add the binary to the $PATH
-
.vimrc
plugins:
# linting, formatting
Plugin 'w0rp/ale'
# autocompletion, does linting
Plugin 'neoclide/coc.nvim'
# syntax highliting
Plugin 'reasonml-editor/vim-reason-plus'
.vimrc
config:
let g:ale\_linters = {
\ 'reason': ['reason-language-server'],
\}
let g:ale\_fixers = {
\ 'reason': ['refmt'],
\}
let g:ale\_reason\_ls\_executable = '~/your-path-to/reason-language-server'
- configuration of CoC
:CocConfig
- Add following:
{
"languageserver": {
"reason": {
"command": "reason-language-server",
"filetypes": ["reason"]
}
},
// following is nice to have:
"coc.preferences.previewAutoClose": false,
"suggest.echodocSupport": true,
"signature.target": "float",
"suggest.detailField": "preview",
"suggest.enablePreview": true
}