Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update new jsx transform apis, bind to Jsx in compiler, for JSX V4. #49

Merged
merged 37 commits into from
Sep 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2f9884a
update new jsx transform apis with Jsx module
mununki Jul 3, 2022
7d6b9d5
restore external binding for primitives
mununki Jul 4, 2022
2aa4d91
fix jsxFragment type
mununki Jul 4, 2022
9e0da07
add RescriptReact for ppx v4
mununki Jul 9, 2022
9c99211
fix typo
mununki Jul 9, 2022
7859a5d
bind type to JsxEvent
mununki Jul 19, 2022
dc7737c
add ErrorBoundary comp for ppx v4
mununki Jul 19, 2022
aeed8dc
bind ReactDOMStyle.t to JsxDOMStyle.t
mununki Jul 19, 2022
057e565
merge RescriptReact into React for V4 support
mununki Sep 2, 2022
b977ee8
upgrade package.json
mununki Sep 2, 2022
22dfd80
update changes and readme
mununki Sep 4, 2022
77bf2b3
fix readme
mununki Sep 4, 2022
d0cc22e
update installation in readme
mununki Sep 4, 2022
5d0fcab
Update Changes.md
cristianoc Sep 5, 2022
4f82de7
Update Changes.md
cristianoc Sep 5, 2022
cb28860
remove unecessary yarn.lock
mununki Sep 5, 2022
b7c0536
fix binding of react components for V4
mununki Sep 5, 2022
9ac34b0
fix released rescript version in deps
mununki Sep 5, 2022
85f4244
addKepProp function
mununki Sep 16, 2022
5fd8b75
Revert "addKepProp function"
mununki Sep 16, 2022
a4c31f8
add createElementWithKey
mununki Sep 19, 2022
6c8131d
Install latest compiler.
cristianoc Sep 19, 2022
219c6b0
Update nodejs.yml
cristianoc Sep 19, 2022
86401bc
add ReactV3 for backward compatibility
mununki Sep 19, 2022
814101b
fix typo createElementVariadicWithKey
mununki Sep 19, 2022
32809fc
add addKeyProp
mununki Sep 21, 2022
87e1521
private addKeyProp
mununki Sep 21, 2022
bf2f897
add React.fragment and ReactDOM.createElement
mununki Sep 23, 2022
5eacba1
update changelog
mununki Sep 23, 2022
adb9fc4
udpate doc and version
mununki Sep 24, 2022
1ae5b75
add comment to React_V3
mununki Sep 24, 2022
8ef74a4
Update Changes.md
cristianoc Sep 24, 2022
b3bfa61
Update package-lock.json
cristianoc Sep 24, 2022
8d5fc11
Check in generated files.
cristianoc Sep 24, 2022
f4f3064
Remove reason-test-framework
cristianoc Sep 24, 2022
2bbe05d
Use compiler 10.1.0-alpha.2
cristianoc Sep 24, 2022
8d946e7
Remove jest.
cristianoc Sep 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ finalOutput/*.js
/docs/
*.log
.bsb.lock
/src/**/*.js
_esy
_build
*.install
*.bs.js
src/legacy/*.bs.js

# Editor
/.idea/
Expand Down
16 changes: 15 additions & 1 deletion Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@

## master

- Rewrite the `RescriptReactErrorBoundary` component implementation with `@react.component`, so it can be compatible with the changes of JSX PPX.
## 0.11.0-rc.1

- `RescriptReactErrorBoundary` component now implemented using `@react.component`, so it is compatible with JSX V4.

- `ReactV3` module added for backward compatibility to JSX V3. See [the V3 compatibility mode](https://github.com/rescript-lang/syntax/blob/master/cli/JSXV4.md)

**Breaking:**

- **IMPORTANT** The `React` module has been modified in a breaking way to support the new JSX PPX V4.

- Removed the deprecation attribute from apis of the new jsx transform (introduced in React v17).

- New version requirements:
- ReScript compiler V10.1+
- ReactJS v18.2.0+

## v0.10.3

Expand Down
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## rescript-react
## rescript-react

> The Official ReScript Bindings for ReactJS

Expand All @@ -12,6 +12,12 @@

### Installation

#### React-JSX transformation V4
cristianoc marked this conversation as resolved.
Show resolved Hide resolved

- [Documentation](https://github.com/rescript-lang/syntax/blob/master/cli/JSXV4.md)

The ReScript compiler V10.1+ is required.

```
npm install @rescript/react --save
```
Expand All @@ -20,20 +26,31 @@ In your `bsconfig.json`:

```
{
"reason": { "react-jsx": 3 },
"jsx": { "version": 4, "mode": "classic" },
"bs-dependencies": ["@rescript/react"]
}
```

If you want to try [the new jsx transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) which was introduced in React v17, set the `"mode": "automatic"`.

If you want to try build your project with JSX v3, see [the V3 compatibility mode](https://github.com/rescript-lang/syntax/blob/master/cli/JSXV4.md)

**Quick Links:**

- [Introduction](https://rescript-lang.org/docs/react/latest/introduction)

### Requirements

- bs-platform v8.3+
- ReactJS v16.8.1+
- **Optimized for ReScript syntax usage**
- v0.11.0+

- ReScript Compiler v10.1+
- ReactJS v18.2.0+

- v0.10.3

- bs-platform v8.3+
- ReactJS v16.8.1+
- **Optimized for ReScript syntax usage**

### Development

Expand Down
12 changes: 6 additions & 6 deletions bsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@rescript/react",
"reason": { "react-jsx": 3 },
"sources": [
{"dir": "src", "subdirs": true},
{ "dir": "test", "type": "dev" }
],
"jsx": {
"version": 4,
"mode": "classic"
},
"sources": [{ "dir": "src", "subdirs": true }],
"package-specs": [{ "module": "commonjs", "in-source": true }],
"suffix": ".bs.js",
"bs-dev-dependencies": ["reason-test-framework"],
"bs-dev-dependencies": [],
"bsc-flags": []
}