piral-elm 1.9.0-beta.8186 → 1.9.0-beta.8209
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.
- package/README.md +8 -19
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -18,18 +18,19 @@ Transforms a standard Elm component into a component that can be used in Piral,
|
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
::: summary:
|
|
21
|
+
::: summary: Modern Use (recommended)
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The recommended way is to use `piral-elm` from your pilets. In this case, no registration in the Piral instance is required.
|
|
24
24
|
|
|
25
25
|
Example use:
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
28
|
import { PiletApi } from '<name-of-piral-instance>';
|
|
29
|
+
import { fromElm } from 'piral-elm/convert';
|
|
29
30
|
import Elm from './Page.elm';
|
|
30
31
|
|
|
31
32
|
export function setup(piral: PiletApi) {
|
|
32
|
-
piral.registerPage('/sample',
|
|
33
|
+
piral.registerPage('/sample', fromElm(Elm.Page));
|
|
33
34
|
}
|
|
34
35
|
```
|
|
35
36
|
|
|
@@ -38,22 +39,11 @@ Within Elm components the Piral Elm extension component can be used by referring
|
|
|
38
39
|
```html
|
|
39
40
|
<elm-extension name="name-of-extension"></elm-extension>
|
|
40
41
|
```
|
|
41
|
-
|
|
42
|
-
Alternatively, if `piral-elm` has not been added to the Piral instance you can install and use the package also from a pilet directly.
|
|
43
|
-
|
|
44
|
-
```ts
|
|
45
|
-
import { PiletApi } from '<name-of-piral-instance>';
|
|
46
|
-
import { fromElm } from 'piral-elm/convert';
|
|
47
|
-
import Elm from './Page.elm';
|
|
48
|
-
|
|
49
|
-
export function setup(piral: PiletApi) {
|
|
50
|
-
piral.registerPage('/sample', fromElm(Elm.Page));
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
42
|
:::
|
|
55
43
|
|
|
56
|
-
::: summary:
|
|
44
|
+
::: summary: Legacy Use
|
|
45
|
+
|
|
46
|
+
For backwards compatibility, you can also install `piral-elm` in your Piral instance.
|
|
57
47
|
|
|
58
48
|
Using Elm with Piral is as simple as installing `piral-elm`.
|
|
59
49
|
|
|
@@ -70,7 +60,6 @@ const instance = createInstance({
|
|
|
70
60
|
// ...
|
|
71
61
|
});
|
|
72
62
|
```
|
|
73
|
-
|
|
74
63
|
:::
|
|
75
64
|
|
|
76
65
|
## Pilet Usage
|
|
@@ -156,4 +145,4 @@ Either way an *elm.json* will be created in the pilet root folder. It will look
|
|
|
156
145
|
|
|
157
146
|
## License
|
|
158
147
|
|
|
159
|
-
Piral is released using the MIT license. For more information see the [license file](./LICENSE).
|
|
148
|
+
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-elm",
|
|
3
|
-
"version": "1.9.0-beta.
|
|
3
|
+
"version": "1.9.0-beta.8209",
|
|
4
4
|
"description": "Plugin for integrating Elm components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"piral-core": "1.9.0-beta.
|
|
54
|
+
"piral-core": "1.9.0-beta.8209"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "6ae23abba61e76479bc06b76454c38957bc0e79e"
|
|
57
57
|
}
|