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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b437bee130ee620c17fd1874e37032e316f02e14bb6c90863534c9c3131776e3
4
- data.tar.gz: bbfe5547994bfbd95b7e886c998aa233eb7c850114449bf0e34659e0c3bf2652
3
+ metadata.gz: a6f9ed8c84f7e12aa7b5274e385b5993567d7555fd33bfa79dd14e521b15f42d
4
+ data.tar.gz: 26144ae39b7e5d75800391c8881a5d302e5c9afe11583c8c149a2d62f2a1544d
5
5
  SHA512:
6
- metadata.gz: 52bb2bd60cf155cab50966649643c675c4584367b8a7de2c6179bd0355e48952a05f10e6a5c67d5bd4f151d303bbea69b26937c36d10dff28e6364c434f7ba9d
7
- data.tar.gz: ab731d288b0b4e91c7d4df6f8935505e5c3e38799909112d5f3cc380924fa20e2f31787744c453111c7946b061d0499e7e0dee74411568f406aa475ee1005319
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` is for testing the installer: This folder, mainly, is emptied
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 running within your current ruby environment. If you want
252
- to test if a installer with a specific ruby version is running you must switch
253
- this by your development environment. And theese tests are killing all puma processes
254
- before and after run.
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
- #SvelteOnRails::RenderServerSide.reset_and_compile_all
72
+ SvelteOnRails::Compiler.reset_and_compile_all
73
73
  end
74
74
 
75
75
  desc "Build test app within spec/installer_tests"
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.32
4
+ version: 0.0.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Sedlmair