piral-react 1.9.0-beta.8182 → 1.9.0-beta.8196

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.
Files changed (2) hide show
  1. package/README.md +8 -19
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -28,18 +28,19 @@ The extension slot component to be used in React 16+ components.
28
28
 
29
29
  ## Usage
30
30
 
31
- ::: summary: For pilet authors
31
+ ::: summary: Modern Use (recommended)
32
32
 
33
- You can use the `fromReact` function from the Pilet API to convert your React 16+ components to components usable by your Piral instance.
33
+ The recommended way is to use `piral-react` from your pilets. In this case, no registration in the Piral instance is required.
34
34
 
35
35
  Example use:
36
36
 
37
37
  ```ts
38
38
  import { PiletApi } from '<name-of-piral-instance>';
39
+ import { fromReact } from 'piral-react/convert';
39
40
  import { ReactPage } from './ReactPage';
40
41
 
41
42
  export function setup(piral: PiletApi) {
42
- piral.registerPage('/sample', piral.fromReact(ReactPage));
43
+ piral.registerPage('/sample', fromReact(ReactPage));
43
44
  }
44
45
  ```
45
46
 
@@ -48,22 +49,11 @@ Within React 16+ components the Piral React 16+ extension component can be used
48
49
  ```jsx
49
50
  <ReactExtension name="name-of-extension" />
50
51
  ```
51
-
52
- Alternatively, if `piral-react` has not been added to the Piral instance you can install and use the package also from a pilet directly.
53
-
54
- ```ts
55
- import { PiletApi } from '<name-of-piral-instance>';
56
- import { fromReact } from 'piral-react/convert';
57
- import { ReactPage } from './ReactPage';
58
-
59
- export function setup(piral: PiletApi) {
60
- piral.registerPage('/sample', fromReact(ReactPage));
61
- }
62
- ```
63
-
64
52
  :::
65
53
 
66
- ::: summary: For Piral instance developers
54
+ ::: summary: Legacy Use
55
+
56
+ For backwards compatibility, you can also install `piral-react` in your Piral instance.
67
57
 
68
58
  Using React 16+ with Piral is as simple as installing `piral-react` and `react`. For `react` add the following two packages to your project's dependencies:
69
59
 
@@ -103,9 +93,8 @@ The `react` package (or whatever alias you've chosen) should be shared with the
103
93
  }
104
94
  }
105
95
  ```
106
-
107
96
  :::
108
97
 
109
98
  ## License
110
99
 
111
- Piral is released using the MIT license. For more information see the [license file](./LICENSE).
100
+ Piral is released using the MIT license. For more information see the [license file](./LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-react",
3
- "version": "1.9.0-beta.8182",
3
+ "version": "1.9.0-beta.8196",
4
4
  "description": "Plugin for integrating React 16+ components in Piral.",
5
5
  "keywords": [
6
6
  "piral",
@@ -54,7 +54,7 @@
54
54
  "test": "echo \"Error: run tests from root\" && exit 1"
55
55
  },
56
56
  "devDependencies": {
57
- "piral-core": "1.9.0-beta.8182"
57
+ "piral-core": "1.9.0-beta.8196"
58
58
  },
59
- "gitHead": "495aa779b7e4482a1515f1e5a2a591f907c6a052"
59
+ "gitHead": "73f7d0d90884d0b1dc1cc5ed7965f0cb0bc48a20"
60
60
  }