piral-riot 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 +10 -22
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -22,19 +22,21 @@ The extension slot component to be used in Riot.js component.
22
22
 
23
23
  ## Usage
24
24
 
25
- ::: summary: For pilet authors
25
+ ::: summary: Modern Use (recommended)
26
26
 
27
- You can use the `fromRiot` function from the Pilet API to convert your Riot.js components to components usable by your Piral instance.
27
+ The recommended way is to use `piral-riot` from your pilets. In this case, no registration in the Piral instance is required.
28
28
 
29
29
  Example use:
30
30
 
31
31
  ```ts
32
32
  import { PiletApi } from '<name-of-piral-instance>';
33
+ import { fromRiot, createRiotExtension } from 'piral-riot/convert';
33
34
  import { createRiotPage } from './page';
34
35
 
35
36
  export function setup(piral: PiletApi) {
36
- const RiotPage = createRiotPage(piral.RiotExtension);
37
- piral.registerPage('/sample', piral.fromRiot(RiotPage));
37
+ const Extension = createRiotExtension(piral);
38
+ const RiotPage = createRiotPage(Extension);
39
+ piral.registerPage('/sample', fromRiot(RiotPage));
38
40
  }
39
41
  ```
40
42
 
@@ -43,24 +45,11 @@ Within Riot components the Piral Riot extension component can be used by referri
43
45
  ```html
44
46
  <riot-extension name="name-of-extension"></riot-extension>
45
47
  ```
46
-
47
- Alternatively, if `piral-riot` has not been added to the Piral instance you can install and use the package also from a pilet directly.
48
-
49
- ```ts
50
- import { PiletApi } from '<name-of-piral-instance>';
51
- import { fromRiot, createRiotExtension } from 'piral-riot/convert';
52
- import { createRiotPage } from './page';
53
-
54
- export function setup(piral: PiletApi) {
55
- const Extension = createRiotExtension(piral);
56
- const RiotPage = createRiotPage(Extension);
57
- piral.registerPage('/sample', fromRiot(RiotPage));
58
- }
59
- ```
60
-
61
48
  :::
62
49
 
63
- ::: summary: For Piral instance developers
50
+ ::: summary: Legacy Use
51
+
52
+ For backwards compatibility, you can also install `piral-riot` in your Piral instance.
64
53
 
65
54
  Using Riot.js with Piral is as simple as installing `piral-riot` and `riot@^4`.
66
55
 
@@ -89,9 +78,8 @@ The `riot` package should be shared with the pilets via the *package.json*:
89
78
  }
90
79
  }
91
80
  ```
92
-
93
81
  :::
94
82
 
95
83
  ## License
96
84
 
97
- Piral is released using the MIT license. For more information see the [license file](./LICENSE).
85
+ 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-riot",
3
- "version": "1.9.0-beta.8182",
3
+ "version": "1.9.0-beta.8196",
4
4
  "description": "Plugin for integrating Riot.js components in Piral.",
5
5
  "keywords": [
6
6
  "piral",
@@ -51,8 +51,8 @@
51
51
  "test": "echo \"Error: run tests from root\" && exit 1"
52
52
  },
53
53
  "devDependencies": {
54
- "piral-core": "1.9.0-beta.8182",
54
+ "piral-core": "1.9.0-beta.8196",
55
55
  "riot": "^4.7.2"
56
56
  },
57
- "gitHead": "495aa779b7e4482a1515f1e5a2a591f907c6a052"
57
+ "gitHead": "73f7d0d90884d0b1dc1cc5ed7965f0cb0bc48a20"
58
58
  }