svelte-on-rails 0.0.45 → 1.0.1
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 +26 -17
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc4a6377868a5a06f7160c6e9a543ce94fbff469a3152051a9ac4091f37e3659
|
4
|
+
data.tar.gz: 2b451e6217380df53a0f1163347e320ea932386c6ba794916dd2edc07e2de037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bc7158bcec98b8566f280e8f2034d58d3f1bc64257ac7a54919c3e7247e8068ac282fabfdfa370422cd61173d780ef62be130b38dab290b5f73d8a050807723
|
7
|
+
data.tar.gz: 2504cdf6ada8a93a69dd67bd9b56fb54f1d6260d909ec91437b08df16af705700425194fd65ad56f83a990427b023b52f3cc8ed03421a0bda1b0622332454b68
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Svelte on Rails
|
2
2
|
|
3
|
-
Seamless and
|
3
|
+
Seamless and rock-solid integration of Svelte Components into Rails views, based on `vite_rails`.
|
4
4
|
|
5
5
|
By default, and when installed together with `@hotwired/turbo-rails`, it renders
|
6
6
|
svelte components on the first request server side («SSR») and for subsequent
|
@@ -11,14 +11,12 @@ This way svelte works perfectly together with turbo. You will never notice
|
|
11
11
|
this unpleasant «blink» on the frontend and is optimised for maximum
|
12
12
|
performance. SSR compilation is done by vite.
|
13
13
|
|
14
|
-
All this is developed on Rails-7 together with `vite_rails`.
|
15
|
-
|
16
14
|
Thanks to [shakacode](https://github.com/shakacode/react_on_rails)
|
17
15
|
and [ElMassimo](https://github.com/ElMassimo) for inspiring and helping me with their gems.
|
18
16
|
|
19
17
|
**STATUS** This gem is in early development but ready to use for curious developers.
|
20
|
-
It has a 100% test coverage, all tests pass
|
21
|
-
|
18
|
+
It has a 100% test coverage, all tests pass.
|
19
|
+
It is not yet implemented on my customer projects, but this will follow soon.
|
22
20
|
|
23
21
|
If you have issues, please open one and contributors are welcome!
|
24
22
|
|
@@ -34,9 +32,7 @@ If you have issues, please open one and contributors are welcome!
|
|
34
32
|
|
35
33
|
## Installation from cero
|
36
34
|
|
37
|
-
|
38
|
-
|
39
|
-
If you want to start from a new rails app, follow theese tutorials
|
35
|
+
With haml, vite, svelte and turbo:
|
40
36
|
|
41
37
|
```bash
|
42
38
|
rails new my-test-app --skip-javascript
|
@@ -75,14 +71,17 @@ And there is the option `--force` that would not ask you whether it should overw
|
|
75
71
|
This means, if you want all, except haml, you can run:
|
76
72
|
|
77
73
|
```bash
|
78
|
-
rails g svelte_on_rails:install --vite --turbo --svelte --hello-world
|
74
|
+
rails g svelte_on_rails:install --vite --turbo --svelte --hello-world
|
79
75
|
```
|
80
76
|
|
81
|
-
The installer is written carefully: It does not overwrite a file without asking
|
82
|
-
|
77
|
+
The installer is written carefully: It does not overwrite a file without asking
|
78
|
+
and tells you all what he is doing.
|
83
79
|
|
84
80
|
At the end, you just have to (re-) start your server
|
85
|
-
and you will see a Svelte component.
|
81
|
+
and you will see a Svelte Hello World component.
|
82
|
+
|
83
|
+
This hello world has a second page where the most common import statements are demonstrated,
|
84
|
+
separated for server and client side rendering.
|
86
85
|
|
87
86
|
Then, you can run
|
88
87
|
|
@@ -120,12 +119,13 @@ Both should return the same html. And your global styles should be applied same
|
|
120
119
|
for both cases. For 95% of use cases this is the case.
|
121
120
|
|
122
121
|
For check the **ssr pipeline** you can pass the options `ssr: true` and `hydrate: false`
|
123
|
-
to the view helper.
|
122
|
+
to the view helper. This way you will see a «dead» html (no javascript is working).
|
124
123
|
|
125
124
|
For check the **client side pipeline** you can pass the option `ssr: false` and
|
126
125
|
`hydrate: true` to the view helper.
|
127
126
|
|
128
|
-
If both are looking similar, you are good to go.
|
127
|
+
If both are looking similar, you are good to go. Then, remove theese options, the defaults are
|
128
|
+
`ssr: :auto` and `hydrate: true`.
|
129
129
|
|
130
130
|
### Import statements
|
131
131
|
|
@@ -191,19 +191,28 @@ rails svelte_on_rails:remove_hello_world
|
|
191
191
|
|
192
192
|
Contributors welcome!
|
193
193
|
|
194
|
-
|
194
|
+
**Download the code and run the tests**
|
195
|
+
|
196
|
+
Download the source code from the repository, and within the project folder run:
|
195
197
|
|
196
198
|
```bash
|
197
199
|
rake svelte_on_rails:create_contributor_configs_file
|
198
200
|
```
|
199
201
|
and define a `generated_test_app_folder_path` (required) for apps, generated for the testings.
|
200
202
|
|
201
|
-
For development of the **npm package @csedl/svelte-on-rails**
|
202
|
-
|
203
|
+
For development of the **npm package @csedl/svelte-on-rails** (optional) please download the source code of the
|
204
|
+
npm package and set
|
205
|
+
`local_npm_package_path` and set the path to the npm package on your local machine.
|
203
206
|
This will cause the installer, to install the npm package from a local path instead from the npm registry.
|
204
207
|
|
208
|
+
Then run the tests and start contributing.
|
209
|
+
|
205
210
|
Tests are based on the included templates, like the `hello world template` and on the installer.
|
206
211
|
|
212
|
+
Here I learned how to write tests! Testing installers is heavy, you will read about it in the
|
213
|
+
test_helpers. But I have done my best to give all the code a clear structure.
|
214
|
+
I hope you like it, and improvements are welcome.
|
215
|
+
|
207
216
|
**Installer tests** starting with completely destroy the rails app within the `generated_test_app_path`,
|
208
217
|
generating a new rails app and running the installer and test by `playwright` if the components are working.
|
209
218
|
|
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:
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Sedlmair
|
@@ -95,5 +95,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
requirements: []
|
96
96
|
rubygems_version: 3.6.7
|
97
97
|
specification_version: 4
|
98
|
-
summary:
|
98
|
+
summary: Seamless and rock-solid integration of Svelte Components into Rails views,
|
99
|
+
based on vite_rails.
|
99
100
|
test_files: []
|