svelte-on-rails 0.0.32 → 0.0.33
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 -5
- data/lib/tasks/svelte_on_rails_tasks.rake +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6f9ed8c84f7e12aa7b5274e385b5993567d7555fd33bfa79dd14e521b15f42d
|
4
|
+
data.tar.gz: 26144ae39b7e5d75800391c8881a5d302e5c9afe11583c8c149a2d62f2a1544d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb94092930ef3bb2b7ac5c3cb5fec13e63e7086d917b11fc29e3633431ffafb94be69171d908c8b56b63d4ee3ad8597856eff91371d7ed777a329856f10887af
|
7
|
+
data.tar.gz: a989e4e6bc29e6c25072ab61fb5bc748e15162f86eae30e6904eb26dfb894a534a744bf322baded1f35fdc2300dc11e245c63334002197e6c9ae1c36cb7a0c40
|
data/README.md
CHANGED
@@ -143,6 +143,24 @@ Among others there are
|
|
143
143
|
- `import { someFunction } from '../customJavascript.js';`
|
144
144
|
- `import Child from './Child.svelte';`
|
145
145
|
|
146
|
+
### Precompile assets
|
147
|
+
|
148
|
+
When the rails app runs `assets:precompile` a additional rake task is triggered: `rails svelte_on_rails:reset_and_compile_all`.
|
149
|
+
|
150
|
+
This is not absolutely necessary but it reduces the loading time of the very first calling of the first component.
|
151
|
+
So, on deploying or doing `rails assets:precompile` you shoud see something like:
|
152
|
+
|
153
|
+
```
|
154
|
+
--------------------------------------------------------------------------------
|
155
|
+
compiled 1/3: javascript/components/Pug.svelte
|
156
|
+
compiled 2/3: javascript/components/SvelteOnRailsHelloWorld.svelte
|
157
|
+
compiled 3/3: javascript/components/sub/NestedComponent.svelte
|
158
|
+
Svelte on Rails: Reset dist and compile-all executed
|
159
|
+
--------------------------------------------------------------------------------
|
160
|
+
```
|
161
|
+
|
162
|
+
on the console.
|
163
|
+
|
146
164
|
## Option `ssr: :auto`
|
147
165
|
|
148
166
|
`ssr: :auto` is the default option, as set on config file and can be overridden on the view helper.
|
@@ -244,14 +262,17 @@ This is mainly for testing the compiler.
|
|
244
262
|
|
245
263
|
**installer tests**
|
246
264
|
|
247
|
-
The folder `spec/installer_tests
|
265
|
+
The folder `spec/installer_tests`, mainly, is emptied
|
248
266
|
before test. Tests there are starting by `rails new` followed
|
249
267
|
by running the installer.
|
250
268
|
|
251
|
-
NOTE: Theese tests are
|
252
|
-
|
253
|
-
|
254
|
-
|
269
|
+
NOTE: Theese tests are dependend on your environment, including the running ruby version!
|
270
|
+
I am woring on `rvm` If you work on a different environment, tests may have to be adopted.
|
271
|
+
|
272
|
+
The current test cases including (among others):
|
273
|
+
|
274
|
+
- create a completely new rails app, running the full installer and check if a `hello World` component is visible and javascript is working.
|
275
|
+
- run `assets:precompile` within a rails app and check if the gem does its precompiling too.
|
255
276
|
|
256
277
|
Development helpers:
|
257
278
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
if defined?(Rails)
|
1
|
+
if defined?(Rails) && Rake::Task.task_defined?("assets:precompile")
|
2
2
|
Rake::Task["assets:precompile"].enhance do
|
3
|
-
puts '-'*80
|
3
|
+
puts '-' * 80
|
4
4
|
SvelteOnRails::Compiler.reset_and_compile_all
|
5
5
|
puts "Svelte on Rails: Reset dist and compile-all executed"
|
6
|
-
puts '-'*80
|
6
|
+
puts '-' * 80
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
@@ -69,7 +69,7 @@ namespace :svelte_on_rails do
|
|
69
69
|
|
70
70
|
desc "Compile all Svelte components"
|
71
71
|
task :reset_and_compile_all do
|
72
|
-
|
72
|
+
SvelteOnRails::Compiler.reset_and_compile_all
|
73
73
|
end
|
74
74
|
|
75
75
|
desc "Build test app within spec/installer_tests"
|