Skip to content

Commit dc55455

Browse files
committed
Port reason-react@0.9 to initial rescript-react version
Check the Changes.md for more details on the breaking changes that were introduced along the way.
0 parents  commit dc55455

25 files changed

+9791
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [10.x, 12.x]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
- run: npm install
28+
- run: npm run build
29+
- run: npm run test

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.DS_Store
2+
/node_modules*
3+
finalOutput/*.js
4+
.merlin
5+
.install
6+
/lib/bs/
7+
/lib/js/
8+
/lib/ocaml/
9+
/docs/
10+
*.log
11+
.bsb.lock
12+
/src/*.js
13+
_esy
14+
_build
15+
*.install
16+
*.bs.js
17+
18+
# Editor
19+
/.idea/

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lib/bs/
2+
.merlin
3+
docs

Changes.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# master
2+
3+
This is the initial version of `rescript-react`, a port of `reason-react@0.9` that will be almost equivalent, except for a few long needed minor breaking changes.
4+
5+
It is intended to be used with our newest ReScript React-JSX transformations (> JSX v3) and React v17.
6+
7+
For history on previous evolution of the code, check out the original [reason-react history](https://github.com/reasonml/reason-react/blob/master/HISTORY.md)
8+
9+
**Breaking:**
10+
11+
- Removed legacy modules ("record api"):
12+
- `ReasonReactCompat`
13+
- `ReactDOMServerRe`
14+
- `ReactEventRe`
15+
- `ReasonReactOptimizedCreateClass`
16+
17+
- Renamed existing modules:
18+
- `ReasonReactErrorBoundary` -> `RescriptReactErrorBoundary`
19+
- `ReasonReactRouter` -> `RescriptReactRouter`
20+
- (Note: Usually the two only valid styles would be `ReScript` or `rescript`, the latter being the version for technical writing. We are using `Rescript` here, since it is essentially the capitalized version of `rescript`)
21+
22+
- Removed all functionality from `ReasonReact` and `ReactDOMRe` that is not needed for react-jsx v3 compatibility
23+
- Moved `React.SuspenseList` to `React.Experimental.SuspenseList` to be more consistent with our Experimental features
24+
25+
**Misc:**
26+
27+
- Renamed `HISTORY.md` to `Changes.md` (aligning with other core projects, like genType)

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Sander, 2020 The ReScript Project
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.

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## rescript-react
2+
3+
> The Official ReScript Bindings for ReactJS
4+
5+
```
6+
npm install @rescript-lang/rescript-react
7+
```
8+
9+
**Quick Links:**
10+
11+
- [Introduction](https://rescript-lang.org/docs/react/latest/introduction)
12+
- [Installation](https://rescript-lang.org/docs/react/latest/installation)
13+
14+
### Requirements
15+
16+
- bs-platform v8.4+
17+
- ReactJS v17+
18+
- ReScript -> react-jsx v4+
19+
- **Optimized for ReScript syntax usage**
20+
21+
### Development
22+
23+
```
24+
npm install
25+
26+
# Starts the ReScript compiler in watchmode
27+
npm start
28+
```
29+
30+
### Acknowledgements
31+
32+
This project is the next evolution of the original [reason-react](https://github.com/reasonml/reason-react) bindings.

bsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "rescript-react",
3+
"reason": { "react-jsx": 3 },
4+
"sources": [
5+
{"dir": "src", "subdirs": true},
6+
{ "dir": "test", "type": "dev" }
7+
],
8+
"package-specs": [{ "module": "commonjs", "in-source": true }],
9+
"suffix": ".bs.js",
10+
"bs-dev-dependencies": ["reason-test-framework"],
11+
"bsc-flags": ["-bs-no-version-header"]
12+
}

0 commit comments

Comments
 (0)