svelte-on-rails 0.0.4 → 0.0.5
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/README.md +15 -14
- metadata +2 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e44ccc4689a527118303fecadbf493f88f3ac7c697aa11a9d63d7b481df0631c
|
4
|
+
data.tar.gz: e4db1b64136757c45a80a080c43e6624d9ad45a3069398a57056c7826d2ec7e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8ee735aff772931a5f7fd44d61ff4bf57b997b3264399ad50a227fccde6bc38d468b5c35691f0ca29a9074faf4b299618d760b7e72b232bba2b795e1ae2e333
|
7
|
+
data.tar.gz: 966685f0dfab7e6ced316b7f2ebfa51a589b0c4881ad23e4364edfad1637e2188a565bf5973a169167c7cd287e82c0c102b4c4edc6cb65cc2ef44bbf35fe86d1
|
data/README.md
CHANGED
@@ -5,15 +5,16 @@ Can render server-side, always or only on first request, and
|
|
5
5
|
handle subsequent turbo requests as custom elements without shadow-dom.
|
6
6
|
Server-side compilation via rollup.
|
7
7
|
|
8
|
-
Server-side rendering is the bottleneck
|
9
|
-
this gem is in
|
10
|
-
|
8
|
+
Server-side rendering is the bottleneck on such a pipeline.
|
9
|
+
Although rollup is powerful, this gem is in an early state
|
10
|
+
and there are certainly limitations.
|
11
|
+
So please always test your components early if they pass ssr.
|
11
12
|
|
12
13
|
I have written everything in ESM syntax.
|
13
|
-
Although the common-js plugin is installed, I
|
14
|
-
so `require`
|
15
|
-
To check which import statements work, please check the components
|
16
|
-
`spec/rails-vite-test-app/app/frontend/javascript/components` gem.
|
14
|
+
Although the common-js plugin is installed, I have not tested it,
|
15
|
+
so for example `require` may not work in Svelte components.
|
16
|
+
To check which import statements work, please check the components
|
17
|
+
in the `spec/rails-vite-test-app/app/frontend/javascript/components` gem.
|
17
18
|
|
18
19
|
This all is developed on Rails-7 together with `vite_rails`.
|
19
20
|
|
@@ -40,9 +41,9 @@ and run
|
|
40
41
|
$ rails svelte_on_rails:install
|
41
42
|
```
|
42
43
|
|
43
|
-
|
44
|
+
This will create a little config file, please read the comments there.
|
44
45
|
|
45
|
-
|
46
|
+
Set up the npm module [@csedl/svelte-on-rails](https://www.npmjs.com/package/@csedl/svelte-on-rails) on the client side.
|
46
47
|
|
47
48
|
## Usage
|
48
49
|
|
@@ -68,7 +69,7 @@ Works with `hotwired/turbo` only
|
|
68
69
|
|
69
70
|
By passing the `render_server_side: :auto` option to the view helper,
|
70
71
|
it checks if the request is an initial request (request header `X-Turbo-Request-ID` is not present),
|
71
|
-
then does nothing server-side
|
72
|
+
then does nothing server-side except add a tag. Assuming the filename is `HelloWorld.svelte`:
|
72
73
|
|
73
74
|
```haml
|
74
75
|
= svelte_component("HelloWorld", message: "Property from the server", render_server_side: :auto, class: "box")
|
@@ -78,10 +79,10 @@ Added Svelte-Tag for custom element: «<hello-world-svelte class='box svelte-com
|
|
78
79
|
|
79
80
|
If configured on the npm module, it instaniates a custom element and adopts it to the element.
|
80
81
|
|
81
|
-
This works perfectly with hotwired/turbo because the custom elements are
|
82
|
-
first page load and survive page visits from turbo.
|
83
|
-
has the `%hello-world` tag, the component will appear immediately.
|
84
|
-
This is not a default setting
|
82
|
+
This works perfectly with hotwired/turbo because the custom elements are
|
83
|
+
built on the first page load and survive page visits from turbo.
|
84
|
+
If you then visit a page that has the `%hello-world` tag, the component will appear immediately.
|
85
|
+
This is not a default setting as it requires more configuration.
|
85
86
|
|
86
87
|
## Styles
|
87
88
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svelte-on-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Sedlmair
|
@@ -1415,7 +1415,5 @@ requirements: []
|
|
1415
1415
|
rubygems_version: 3.1.6
|
1416
1416
|
signing_key:
|
1417
1417
|
specification_version: 4
|
1418
|
-
summary:
|
1419
|
-
always or only on first request, and handle subsequent turbo requests as custom
|
1420
|
-
elements without shadow-dom. Server-side compilation via rollup.
|
1418
|
+
summary: Seamlessly integrate Svelte Components into Rails views.
|
1421
1419
|
test_files: []
|