react-components-rails 1.0.0.beta1 → 1.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -3
- data/README.md +8 -2
- data/lib/react-components-rails.rb +3 -0
- data/package.json +20 -17
- data/pnpm-lock.yaml +1078 -0
- data/react-components-rails.gemspec +2 -2
- data/src/index.ts +38 -9
- data/tsconfig.json +11 -8
- metadata +4 -17
- data/yarn.lock +0 -5101
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8ba858d748c6f96a4537c328a9181cf4a16a4b73d951f5623993cf0c38f4998
|
4
|
+
data.tar.gz: 3c9516b00e4d060d1ab45b4cf57e8721dffdc9f683e8fd469f8960ce435b8b34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52b8286cec7712a22c21fa99f7b06a3520e7e97f97afa1e655d90f44d45dd7c04470aaa37c1cf04ae4d01d6eb5facd1e42406ebe0a9571f9225f95d68c46a0c1
|
7
|
+
data.tar.gz: 69b40924f14cbef646d6b4081e24693482359b5140a860422c62bbae889095bc58e9cd2acf6255a538590012f2d3123b96f87bf81e67abde233f779fe6093d02
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
react-components-rails (1.0.0.
|
4
|
+
react-components-rails (1.0.0.beta2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -11,7 +11,6 @@ GEM
|
|
11
11
|
parser (3.1.1.0)
|
12
12
|
ast (~> 2.4.1)
|
13
13
|
rainbow (3.1.1)
|
14
|
-
rake (13.0.6)
|
15
14
|
regexp_parser (2.2.1)
|
16
15
|
rexml (3.2.5)
|
17
16
|
rubocop (1.25.1)
|
@@ -29,11 +28,11 @@ GEM
|
|
29
28
|
unicode-display_width (2.1.0)
|
30
29
|
|
31
30
|
PLATFORMS
|
31
|
+
arm64-darwin-21
|
32
32
|
x86_64-darwin-21
|
33
33
|
|
34
34
|
DEPENDENCIES
|
35
35
|
bundler (~> 2.3)
|
36
|
-
rake (~> 13.0)
|
37
36
|
react-components-rails!
|
38
37
|
rubocop
|
39
38
|
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ React-Components-Rails makes it easy to use [React](https://reactjs.org/) with y
|
|
9
9
|
First, you need to add this gem to your Rails app Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem 'react-components-rails', "~> 1.0.0.beta.
|
12
|
+
gem 'react-components-rails', "~> 1.0.0.beta.2"
|
13
13
|
```
|
14
14
|
|
15
15
|
Once done, run `bundle` to install the gem.
|
@@ -33,7 +33,7 @@ In your app entry file, import your components as well as `react-components-rail
|
|
33
33
|
import Hello from "components/hello"
|
34
34
|
import ReactComponentsRails from "react-components-rails"
|
35
35
|
|
36
|
-
ReactComponentsRails.setup({ Hello }) // ES6 shorthand for {Hello: Hello}
|
36
|
+
ReactComponentsRails.setup({ Hello }) // ES6 shorthand for { Hello: Hello }
|
37
37
|
```
|
38
38
|
|
39
39
|
### Rendering from a view
|
@@ -73,6 +73,12 @@ You can also pass any of the usual arguments to `render` in this call: `layout`,
|
|
73
73
|
|
74
74
|
It should be supported out of the box, if supported by your Javascript stack. Please refer to your Javascript compiler/bundler documentation to do so.
|
75
75
|
|
76
|
+
## React versions
|
77
|
+
|
78
|
+
This package tries to support both the legacy React DOM interface (`ReactDOM.render`) and the new one introduced in React 18 (`ReactDOM.createRoot`).
|
79
|
+
|
80
|
+
The installed React version is tested at runtime by trying to import `react-dom/client`. If the import succeeds then the new API is used, otherwise we fallback to the legacy API.
|
81
|
+
|
76
82
|
<!--
|
77
83
|
## Development
|
78
84
|
|
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-components-rails",
|
3
|
-
"version": "1.0.0-beta.
|
3
|
+
"version": "1.0.0-beta.2",
|
4
4
|
"homepage": "https://github.com/renchap/react-components-rails",
|
5
5
|
"repository": "renchap/react-components-rails",
|
6
6
|
"author": {
|
@@ -11,18 +11,21 @@
|
|
11
11
|
"type": "module",
|
12
12
|
"source": "src/index.ts",
|
13
13
|
"exports": {
|
14
|
-
"require": "./dist/
|
15
|
-
"default": "./dist/
|
14
|
+
"require": "./dist/index.cjs",
|
15
|
+
"default": "./dist/index.js"
|
16
16
|
},
|
17
|
-
"main": "./dist/
|
18
|
-
"
|
19
|
-
"
|
17
|
+
"main": "./dist/index.cjs",
|
18
|
+
"types": "dist/index.d.ts",
|
19
|
+
"files": [
|
20
|
+
"dist/",
|
21
|
+
"src/"
|
22
|
+
],
|
20
23
|
"scripts": {
|
21
|
-
"build": "
|
22
|
-
"dev": "
|
24
|
+
"build": "tsup src/index.ts --dts --sourcemap --format esm --target es6 --minify && tsup src/index.ts --sourcemap --format cjs --target es5 --minify",
|
25
|
+
"dev": "tsup watch"
|
23
26
|
},
|
24
27
|
"dependencies": {
|
25
|
-
"@types/lodash": "^4.14.
|
28
|
+
"@types/lodash": "^4.14.182",
|
26
29
|
"lodash": "^4.17.21"
|
27
30
|
},
|
28
31
|
"peerDependencies": {
|
@@ -30,15 +33,15 @@
|
|
30
33
|
"react-dom": ">= 0.14"
|
31
34
|
},
|
32
35
|
"devDependencies": {
|
33
|
-
"@
|
34
|
-
"@types/react
|
35
|
-
"
|
36
|
-
"prettier": "^2.
|
37
|
-
"react": "^
|
38
|
-
"react-dom": "^
|
39
|
-
"
|
36
|
+
"@swc/core": "^1.2.231",
|
37
|
+
"@types/react": "^18.0.17",
|
38
|
+
"@types/react-dom": "^18.0.6",
|
39
|
+
"prettier": "^2.7.1",
|
40
|
+
"react": "^18.2.0",
|
41
|
+
"react-dom": "^18.2.0",
|
42
|
+
"tsup": "^6.2.2",
|
43
|
+
"typescript": "^4.7.4"
|
40
44
|
},
|
41
|
-
"packageManager": "yarn@3.2.0",
|
42
45
|
"prettier": {
|
43
46
|
"semi": false
|
44
47
|
}
|