{"id":18515379,"url":"https://github.com/tommmyy/react-native-reason-template","last_synced_at":"2025-04-09T06:34:55.422Z","repository":{"id":36578423,"uuid":"218466668","full_name":"tommmyy/react-native-reason-template","owner":"tommmyy","description":"Bare template for reason-react-native apps.","archived":false,"fork":false,"pushed_at":"2023-01-04T23:44:49.000Z","size":991,"stargazers_count":6,"open_issues_count":18,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T01:05:31.387Z","etag":null,"topics":["react-native","reason-react-native","reasonml"],"latest_commit_sha":null,"homepage":"","language":"Reason","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tommmyy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-30T07:22:15.000Z","updated_at":"2024-11-05T00:20:30.000Z","dependencies_parsed_at":"2022-09-08T20:00:41.458Z","dependency_job_id":null,"html_url":"https://github.com/tommmyy/react-native-reason-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommmyy%2Freact-native-reason-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommmyy%2Freact-native-reason-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommmyy%2Freact-native-reason-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommmyy%2Freact-native-reason-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tommmyy","download_url":"https://codeload.github.com/tommmyy/react-native-reason-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247993677,"owners_count":21030043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react-native","reason-react-native","reasonml"],"created_at":"2024-11-06T15:47:33.385Z","updated_at":"2025-04-09T06:34:50.391Z","avatar_url":"https://github.com/tommmyy.png","language":"Reason","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repo was created with following trials and errors according to official instructions.\n\n# Running a project\n\nOne window:\n\n```sh\nyarn ios\n\n# or\n\nyarn android\n```\n\nSecond window:\n\n```sh\nyarn re:watch\n```\n\n# Main source of instructions:\n\n- [React-navive-cli](https://reasonml-community.github.io/reason-react-native/en/docs/install/#create-a-new-project-with-reason-react-native)\n- [Reason ML platfrorm](https://bucklescript.github.io/)\n\n# My take\n\nFor Mac - install (!!!) XCode 11 and OpenJDK8\nFor Android - ??\n\nUsing Node v10.10.0\n\n## Installing tools\n\n```\nyarn global add react-native-cli bs-platform --ignore-engines\n```\n\n## Create project\n\nThis should work, but for me it did not:\n\n```sh\nreact-native init RNRTemplate --template reason-react-native-template\n```\n\nSo I needed to create Reason project manually.\n\n1. create repo\n```sh\nreact-native init RNRTemplate\ncd RNRTemplate\nyarn add bs-platform --dev \u0026\u0026 yarn add reason-react reason-react-native\n```\n\n2. Add following lines to `.gitignore`:\n\n```\n# Reason\n\n*.bs.js\n.bsb.lock\n.merlin\nlib/bs\n```\n\n3. Then I add scripts to `package.json` for working with ReasonML compilation:\n\n```\n\"scripts\": {\n\t\t\"re:build\": \"bsb -clean-world -make-world\",\n    \"re:watch\": \"bsb -clean-world -make-world -w\",\n\t\t...\n}\n```\n\n4. Lastly you need create a file `bsconfig.json` to configure bucklescript.\n\n```json\n{\n  \"name\": \"demo-react-native-app\",\n  \"refmt\": 3,\n  \"reason\": {\n    \"react-jsx\": 3\n  },\n  \"package-specs\": {\n    \"module\": \"es6\",\n    \"in-source\": true\n  },\n  \"suffix\": \".bs.js\",\n  \"sources\": [\n    {\n      \"dir\": \"src\",\n      \"subdirs\": true\n    }\n  ],\n  \"bs-dependencies\": [\"reason-react\", \"reason-react-native\"]\n}\n```\n\n# Result\nResult is this repo.\n\n# Vim setup\n\n1. Install reasonml-language-server and add the binary to the $PATH\n\n2. `.vimrc` plugins:\n\n```\n# linting, formatting\nPlugin 'w0rp/ale'\n\n# autocompletion, does linting\nPlugin 'neoclide/coc.nvim'\n\n# syntax highliting\nPlugin 'reasonml-editor/vim-reason-plus'\n```\n\n3. `.vimrc` config:\n\n```\nlet g:ale\\_linters = {\n\\   'reason': ['reason-language-server'],\n\\}\n\nlet g:ale\\_fixers = {\n\\   'reason': ['refmt'],\n\\}\n\nlet g:ale\\_reason\\_ls\\_executable = '~/your-path-to/reason-language-server'\n```\n\n4. configuration of CoC\n- `:CocConfig`\n- Add following:\n\n```json\n{\n\t\"languageserver\": {\n    \"reason\": {\n      \"command\": \"reason-language-server\",\n      \"filetypes\": [\"reason\"]\n    }\n  },\n\t// following is nice to have:\n\t\"coc.preferences.previewAutoClose\": false,\n\t\"suggest.echodocSupport\": true,\n\t\"signature.target\": \"float\",\n\t\"suggest.detailField\": \"preview\",\n\t\"suggest.enablePreview\": true\n}\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommmyy%2Freact-native-reason-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommmyy%2Freact-native-reason-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommmyy%2Freact-native-reason-template/lists"}