piral-svelte 1.9.0-beta.8186 → 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.
- package/README.md +8 -19
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -18,18 +18,19 @@ Transforms a standard Svelte component into a component that can be used in Pira
|
|
|
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-svelte` 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 { fromSvelte } from 'piral-svelte/convert';
|
|
29
30
|
import SveltePage from './Page.svelte';
|
|
30
31
|
|
|
31
32
|
export function setup(piral: PiletApi) {
|
|
32
|
-
piral.registerPage('/sample',
|
|
33
|
+
piral.registerPage('/sample', fromSvelte(SveltePage));
|
|
33
34
|
}
|
|
34
35
|
```
|
|
35
36
|
|
|
@@ -39,18 +40,6 @@ Within Svelte components the Piral Svelte extension component can be used by ref
|
|
|
39
40
|
<svelte-extension name="name-of-extension"></svelte-extension>
|
|
40
41
|
```
|
|
41
42
|
|
|
42
|
-
Alternatively, if `piral-svelte` 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 { fromSvelte } from 'piral-svelte/convert';
|
|
47
|
-
import SveltePage from './Page.svelte';
|
|
48
|
-
|
|
49
|
-
export function setup(piral: PiletApi) {
|
|
50
|
-
piral.registerPage('/sample', fromSvelte(SveltePage));
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
43
|
How you built your Svelte-pilet is up to you. If you use Webpack then the bundler options such as `piral-cli-webpack` or `piral-cli-webpack5` can be leveraged. In these cases you'd need to install the `svelte-loader` package and create a custom *webpack.config.js*:
|
|
55
44
|
|
|
56
45
|
```sh
|
|
@@ -111,10 +100,11 @@ module.exports = config => {
|
|
|
111
100
|
return config;
|
|
112
101
|
};
|
|
113
102
|
```
|
|
114
|
-
|
|
115
103
|
:::
|
|
116
104
|
|
|
117
|
-
::: summary:
|
|
105
|
+
::: summary: Legacy Use
|
|
106
|
+
|
|
107
|
+
For backwards compatibility, you can also install `piral-svelte` in your Piral instance.
|
|
118
108
|
|
|
119
109
|
Using Svelte with Piral is as simple as installing `piral-svelte`. In the pilets using Svelte, `svelte` and `parcel-plugin-svelte` should be installed, too.
|
|
120
110
|
|
|
@@ -131,7 +121,6 @@ const instance = createInstance({
|
|
|
131
121
|
// ...
|
|
132
122
|
});
|
|
133
123
|
```
|
|
134
|
-
|
|
135
124
|
:::
|
|
136
125
|
|
|
137
126
|
## Pilet Usage
|
|
@@ -187,4 +176,4 @@ Furthermore, since Svelte distributes its source code as ES6 we need to change t
|
|
|
187
176
|
|
|
188
177
|
## License
|
|
189
178
|
|
|
190
|
-
Piral is released using the MIT license. For more information see the [license file](./LICENSE).
|
|
179
|
+
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-svelte",
|
|
3
|
-
"version": "1.9.0-beta.
|
|
3
|
+
"version": "1.9.0-beta.8196",
|
|
4
4
|
"description": "Plugin for integrating Svelte components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"piral-core": "1.9.0-beta.
|
|
56
|
+
"piral-core": "1.9.0-beta.8196"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "73f7d0d90884d0b1dc1cc5ed7965f0cb0bc48a20"
|
|
59
59
|
}
|