react-components-rails 1.0.0.beta1 → 1.0.0.beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +22 -21
- data/pnpm-lock.yaml +1064 -0
- data/react-components-rails.gemspec +3 -3
- data/src/index.ts +86 -38
- data/tsconfig.json +12 -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: c1d7d3cf2e6a1a031361b2cc056e9aef369c2f26eda0463fa9f40158a1e21301
|
4
|
+
data.tar.gz: aa3a97e407e6fe6bbacbe4c4b312c13ee7214190daac3459e388513ab0e28ffd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e45d02f71d0a19ded76e7e77e507a765e843d5f1055b5c77b663d7207d215248b2c46c64e5b435cc2d1ed86a3286d8142469b26eb041fc5624f0cf1722bf7c3
|
7
|
+
data.tar.gz: 6e24bece53a89c2a077024e559d511b7cddf9285cf503d1ce111ae93caaa9555ac5070dd725273ed54bb738926b8285e95fc109178db0f7b012f0b4252215c64
|
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.beta4)
|
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.4"
|
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.4",
|
4
4
|
"homepage": "https://github.com/renchap/react-components-rails",
|
5
5
|
"repository": "renchap/react-components-rails",
|
6
6
|
"author": {
|
@@ -8,37 +8,38 @@
|
|
8
8
|
"email": "renchap@gmail.com"
|
9
9
|
},
|
10
10
|
"license": "MIT",
|
11
|
-
"type": "module",
|
12
11
|
"source": "src/index.ts",
|
13
12
|
"exports": {
|
14
|
-
"
|
15
|
-
"
|
13
|
+
"import": "./dist/index.js",
|
14
|
+
"require": "./dist/index.cjs",
|
15
|
+
"default": "./dist/index.js"
|
16
16
|
},
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
17
|
+
"type": "module",
|
18
|
+
"main": "./dist/index.cjs",
|
19
|
+
"types": "dist/index.d.ts",
|
20
|
+
"files": [
|
21
|
+
"dist/",
|
22
|
+
"src/"
|
23
|
+
],
|
20
24
|
"scripts": {
|
21
|
-
"build": "
|
22
|
-
"dev": "
|
23
|
-
},
|
24
|
-
"dependencies": {
|
25
|
-
"@types/lodash": "^4.14.179",
|
26
|
-
"lodash": "^4.17.21"
|
25
|
+
"build": "tsup src/index.ts --dts --sourcemap --format esm --target es6 --minify && tsup src/index.ts --sourcemap --format cjs --target es5 --minify",
|
26
|
+
"dev": "tsup watch"
|
27
27
|
},
|
28
|
+
"dependencies": {},
|
28
29
|
"peerDependencies": {
|
29
30
|
"react": ">= 0.14",
|
30
31
|
"react-dom": ">= 0.14"
|
31
32
|
},
|
32
33
|
"devDependencies": {
|
33
|
-
"@
|
34
|
-
"@types/react
|
35
|
-
"
|
36
|
-
"prettier": "^2.
|
37
|
-
"react": "^
|
38
|
-
"react-dom": "^
|
39
|
-
"
|
34
|
+
"@swc/core": "^1.2.231",
|
35
|
+
"@types/react": "^18.0.17",
|
36
|
+
"@types/react-dom": "^18.0.6",
|
37
|
+
"prettier": "^2.7.1",
|
38
|
+
"react": "^18.2.0",
|
39
|
+
"react-dom": "^18.2.0",
|
40
|
+
"tsup": "^6.2.2",
|
41
|
+
"typescript": "^4.7.4"
|
40
42
|
},
|
41
|
-
"packageManager": "yarn@3.2.0",
|
42
43
|
"prettier": {
|
43
44
|
"semi": false
|
44
45
|
}
|