├── .gitignore ├── .npmignore ├── .vim └── coc-settings.json ├── .vscode └── extensions.json ├── LICENSE ├── README.md ├── bsconfig.json ├── package.json ├── public ├── favicon.ico ├── index.html └── robots.txt ├── snowpack.config.mjs └── src ├── App.css ├── App.res ├── Index.res ├── bindings ├── ReactDomExperimental.res ├── ReactDomExperimental.resi └── ReactExperimental.res ├── index.css ├── index.js └── logo.svg /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | *.log* 3 | 4 | .merlin 5 | .bsb.lock 6 | *.bs.js 7 | 8 | node_modules/ 9 | /lib/ 10 | /build/ 11 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | *.bs.js 2 | -------------------------------------------------------------------------------- /.vim/coc-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "coc.preferences.formatOnSaveFiletypes": [ 3 | "rescript" 4 | ], 5 | "languageserver": { 6 | "rescript": { 7 | "enable": true, 8 | "module": "~/.vim/plugged/vim-rescript/rescript-vscode/extension/server/out/server.js", 9 | "args": ["--node-ipc"], 10 | "filetypes": ["rescript"], 11 | "rootPatterns": ["bsconfig.json"] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "chenglou92.rescript-vscode", 4 | "jaredly.reason-vscode" 5 | ], 6 | "unwantedRecommendations": [ 7 | "vscode.typescript-language-features" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Reason Seoul 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # snowpack-rescript-react 2 | 3 | [](https://npm.im/snowpack-rescript-react) 4 | [](https://npm.im/snowpack-rescript-react) 5 | 6 | A project template to start [ReScript React](https://rescript-lang.org/docs/react/latest/introduction) with [Snowpack](https://www.snowpack.dev/) 7 | 8 | ## Usage 9 | 10 | Bootstrap a project using [create-snowpack-app](https://github.com/snowpackjs/snowpack/tree/main/create-snowpack-app/cli) 11 | 12 | ```bash 13 | # Using Yarn 14 | yarn create snowpack-app my-rescript-project --template snowpack-rescript-react --use-yarn 15 | 16 | # Or using pnpm 17 | pnpx create-snowpack-app my-rescript-project --template snowpack-rescript-react --use-pnpm 18 | ``` 19 | -------------------------------------------------------------------------------- /bsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app", 3 | "reason": { 4 | "react-jsx": 3 5 | }, 6 | "refmt": 3, 7 | "suffix": ".bs.js", 8 | "sources": { 9 | "dir" : "src", 10 | "subdirs" : true 11 | }, 12 | "bsc-flags": [ 13 | "-bs-super-errors", 14 | "-bs-no-version-header" 15 | ], 16 | "package-specs": [ 17 | { 18 | "module": "es6", 19 | "in-source": true 20 | } 21 | ], 22 | "bs-dependencies": [ 23 | "@rescript/react", 24 | "bs-webapi" 25 | ], 26 | "bs-dev-dependencies": [ 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "snowpack-rescript-react", 3 | "version": "0.1.0", 4 | "license": "MIT", 5 | "repository": { 6 | "type": "git", 7 | "url": "git+https://github.com/reason-seoul/snowpack-rescript-react.git" 8 | }, 9 | "keywords": [ 10 | "csa-template", 11 | "snowpack", 12 | "rescript", 13 | "react" 14 | ], 15 | "scripts": { 16 | "prepack": "git clean -fdx", 17 | "postinstall": "rescript build -with-deps", 18 | "start:re": "rescript build -w", 19 | "start:snowpack": "snowpack dev", 20 | "start": "run-p start:**", 21 | "build:re": "rescript build", 22 | "build:snowpack": "snowpack build", 23 | "build": "run-s build:**", 24 | "format": "rescript format", 25 | "test": "echo \"This template does not include a test runner by default.\" && exit 1" 26 | }, 27 | "files": [ 28 | ".gitignore", 29 | "bsconfig.json", 30 | "README.md", 31 | "snowpack.config.mjs", 32 | "public", 33 | "src" 34 | ], 35 | "resolutions": { 36 | "react": "0.0.0-experimental-2d8d133e1", 37 | "react-dom": "0.0.0-experimental-2d8d133e1" 38 | }, 39 | "dependencies": { 40 | "@rescript/react": "^0.10.3", 41 | "bs-webapi": "^0.19.1", 42 | "react": "experimental", 43 | "react-dom": "experimental", 44 | "rescript": "^9.1.2" 45 | }, 46 | "devDependencies": { 47 | "@snowpack/plugin-react-refresh": "^2.5.0", 48 | "npm-run-all": "^4.1.5", 49 | "snowpack": "^3.5.1" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reason-seoul/snowpack-rescript-react/07a59a6871e64b5589697c10c73f33fc1380aad8/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 |
13 | {React.string("Edit ")}
14 | {React.string("src/App.js")}
15 | {React.string(" and save to reload.")}
16 |