svelte-on-rails 8.1.0 → 9.1.0
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 -50
- data/lib/generators/showcase_generator.rb +128 -0
- data/lib/generators/svelte_on_rails/install/install_generator.rb +1 -111
- data/lib/generators/svelte_on_rails/update/update_generator.rb +21 -0
- data/lib/svelte-on-rails.rb +2 -1
- data/lib/svelte_on_rails/installer/hello_world.rb +7 -26
- data/lib/svelte_on_rails/installer/utils.rb +8 -15
- data/lib/svelte_on_rails/lib/development_utils.rb +0 -29
- data/lib/svelte_on_rails/lib/utils.rb +6 -0
- data/lib/svelte_on_rails/lib/view_helper_support.rb +2 -0
- data/lib/svelte_on_rails/renderer/render-backup.js +26 -0
- data/lib/svelte_on_rails/renderer/render.js +61 -13
- data/lib/svelte_on_rails/renderer/renderer.rb +7 -4
- data/lib/svelte_on_rails/renderer/utils.js +40 -40
- data/lib/tasks/svelte_on_rails_tasks.rake +13 -51
- data/templates/config_base/config/svelte_on_rails.yml +1 -1
- data/templates/config_base/vite-ssr.config.ts +8 -3
- data/templates/showcase/app/channels/application_cable/channel.rb +4 -0
- data/templates/showcase/app/channels/application_cable/connection.rb +5 -0
- data/templates/showcase/app/controllers/svelte_on_rails_showcase_controller.rb +65 -0
- data/templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/JavascriptImport.svelte +7 -0
- data/templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/JpgImport.svelte +15 -0
- data/templates/{all_features_test/app/frontend/javascript/components → showcase/app/frontend/javascript/svelte_on_rails_showcase}/ParentWithChild.svelte +1 -1
- data/templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/PngImport.svelte +16 -0
- data/templates/{all_features_test/app/frontend/javascript/components → showcase/app/frontend/javascript/svelte_on_rails_showcase}/ReceiveFromChannel.svelte +5 -3
- data/templates/{all_features_test/app/frontend/javascript/components → showcase/app/frontend/javascript/svelte_on_rails_showcase}/SvelteOnRailsHelloWorld.svelte +4 -4
- data/templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/SvgRawImport.svelte +7 -0
- data/templates/showcase/app/views/svelte_on_rails_showcase/_nav.html.erb +13 -0
- data/templates/showcase/app/views/svelte_on_rails_showcase/backend_frontend_rendered.html.erb +37 -0
- data/templates/showcase/app/views/svelte_on_rails_showcase/index.html.erb +9 -0
- data/templates/{all_features_test/app/views/svelte_on_rails_hello_world → showcase/app/views/svelte_on_rails_showcase}/ssr_auto_rendered.html.erb +2 -2
- data/templates/{all_features_test/app/views/svelte_on_rails_hello_world → showcase/app/views/svelte_on_rails_showcase}/web_socket.html.erb +1 -1
- metadata +28 -24
- data/lib/svelte_on_rails/installer/vite.rb +0 -95
- data/templates/all_features_test/app/controllers/svelte_on_rails_hello_world_controller.rb +0 -62
- data/templates/all_features_test/app/frontend/javascript/components/JavascriptImport.svelte +0 -7
- data/templates/all_features_test/app/frontend/javascript/components/JpgImport.svelte +0 -7
- data/templates/all_features_test/app/frontend/javascript/components/PngImport.svelte +0 -7
- data/templates/all_features_test/app/frontend/javascript/components/SvgRawImport.svelte +0 -7
- data/templates/all_features_test/app/views/svelte_on_rails_hello_world/_nav.html.erb +0 -13
- data/templates/all_features_test/app/views/svelte_on_rails_hello_world/backend_frontend_rendered.html.erb +0 -37
- data/templates/all_features_test/app/views/svelte_on_rails_hello_world/index.html.erb +0 -9
- /data/templates/{all_features_test → showcase}/app/channels/svelte_on_rails_channel.rb +0 -0
- /data/templates/{all_features_test → showcase}/app/frontend/initializers/actionCable.js +0 -0
- /data/templates/{all_features_test/app/frontend/images/svelte-on-rails-hello-world-england.png → showcase/app/frontend/javascript/svelte_on_rails_showcase/england.png} +0 -0
- /data/templates/{all_features_test/app/frontend/images/svelte-on-rails-hello-world-face-smile-wink.svg → showcase/app/frontend/javascript/svelte_on_rails_showcase/face-smile-wink.svg} +0 -0
- /data/templates/{all_features_test/app/frontend/javascript → showcase/app/frontend/javascript/svelte_on_rails_showcase}/nestedJavascript.js +0 -0
- /data/templates/{all_features_test/app/frontend/javascript → showcase/app/frontend/javascript/svelte_on_rails_showcase}/nestedJavascriptToggled.js +0 -0
- /data/templates/{all_features_test/app/frontend/javascript/components → showcase/app/frontend/javascript/svelte_on_rails_showcase}/sub/NestedComponent.svelte +0 -0
- /data/templates/{all_features_test/app/frontend/images/svelte-on-rails-hello-world-switzerland.jpg → showcase/app/frontend/javascript/svelte_on_rails_showcase/switzerland.jpg} +0 -0
- /data/templates/{all_features_test/app/views/svelte_on_rails_hello_world → showcase/app/views/svelte_on_rails_showcase}/_styles.html.erb +0 -0
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: 9.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christian Sedlmair
|
|
@@ -29,7 +29,9 @@ extensions: []
|
|
|
29
29
|
extra_rdoc_files: []
|
|
30
30
|
files:
|
|
31
31
|
- README.md
|
|
32
|
+
- lib/generators/showcase_generator.rb
|
|
32
33
|
- lib/generators/svelte_on_rails/install/install_generator.rb
|
|
34
|
+
- lib/generators/svelte_on_rails/update/update_generator.rb
|
|
33
35
|
- lib/svelte-on-rails.rb
|
|
34
36
|
- lib/svelte_on_rails/action_cable.rb
|
|
35
37
|
- lib/svelte_on_rails/active_record_extensions.rb
|
|
@@ -41,43 +43,45 @@ files:
|
|
|
41
43
|
- lib/svelte_on_rails/installer/npm.rb
|
|
42
44
|
- lib/svelte_on_rails/installer/svelte.rb
|
|
43
45
|
- lib/svelte_on_rails/installer/utils.rb
|
|
44
|
-
- lib/svelte_on_rails/installer/vite.rb
|
|
45
46
|
- lib/svelte_on_rails/lib/development_utils.rb
|
|
46
47
|
- lib/svelte_on_rails/lib/to_svelte.rb
|
|
47
48
|
- lib/svelte_on_rails/lib/utils.rb
|
|
48
49
|
- lib/svelte_on_rails/lib/view_helper_support.rb
|
|
49
50
|
- lib/svelte_on_rails/railtie.rb
|
|
51
|
+
- lib/svelte_on_rails/renderer/render-backup.js
|
|
50
52
|
- lib/svelte_on_rails/renderer/render.js
|
|
51
53
|
- lib/svelte_on_rails/renderer/renderer.rb
|
|
52
54
|
- lib/svelte_on_rails/renderer/utils.js
|
|
53
55
|
- lib/svelte_on_rails/turbo_stream.rb
|
|
54
56
|
- lib/svelte_on_rails/view_helpers.rb
|
|
55
57
|
- lib/tasks/svelte_on_rails_tasks.rake
|
|
56
|
-
- templates/all_features_test/app/channels/svelte_on_rails_channel.rb
|
|
57
|
-
- templates/all_features_test/app/controllers/svelte_on_rails_hello_world_controller.rb
|
|
58
|
-
- templates/all_features_test/app/frontend/images/svelte-on-rails-hello-world-england.png
|
|
59
|
-
- templates/all_features_test/app/frontend/images/svelte-on-rails-hello-world-face-smile-wink.svg
|
|
60
|
-
- templates/all_features_test/app/frontend/images/svelte-on-rails-hello-world-switzerland.jpg
|
|
61
|
-
- templates/all_features_test/app/frontend/initializers/actionCable.js
|
|
62
|
-
- templates/all_features_test/app/frontend/javascript/components/JavascriptImport.svelte
|
|
63
|
-
- templates/all_features_test/app/frontend/javascript/components/JpgImport.svelte
|
|
64
|
-
- templates/all_features_test/app/frontend/javascript/components/ParentWithChild.svelte
|
|
65
|
-
- templates/all_features_test/app/frontend/javascript/components/PngImport.svelte
|
|
66
|
-
- templates/all_features_test/app/frontend/javascript/components/ReceiveFromChannel.svelte
|
|
67
|
-
- templates/all_features_test/app/frontend/javascript/components/SvelteOnRailsHelloWorld.svelte
|
|
68
|
-
- templates/all_features_test/app/frontend/javascript/components/SvgRawImport.svelte
|
|
69
|
-
- templates/all_features_test/app/frontend/javascript/components/sub/NestedComponent.svelte
|
|
70
|
-
- templates/all_features_test/app/frontend/javascript/nestedJavascript.js
|
|
71
|
-
- templates/all_features_test/app/frontend/javascript/nestedJavascriptToggled.js
|
|
72
|
-
- templates/all_features_test/app/views/svelte_on_rails_hello_world/_nav.html.erb
|
|
73
|
-
- templates/all_features_test/app/views/svelte_on_rails_hello_world/_styles.html.erb
|
|
74
|
-
- templates/all_features_test/app/views/svelte_on_rails_hello_world/backend_frontend_rendered.html.erb
|
|
75
|
-
- templates/all_features_test/app/views/svelte_on_rails_hello_world/index.html.erb
|
|
76
|
-
- templates/all_features_test/app/views/svelte_on_rails_hello_world/ssr_auto_rendered.html.erb
|
|
77
|
-
- templates/all_features_test/app/views/svelte_on_rails_hello_world/web_socket.html.erb
|
|
78
58
|
- templates/config_base/app/frontend/ssr/ssr.js
|
|
79
59
|
- templates/config_base/config/svelte_on_rails.yml
|
|
80
60
|
- templates/config_base/vite-ssr.config.ts
|
|
61
|
+
- templates/showcase/app/channels/application_cable/channel.rb
|
|
62
|
+
- templates/showcase/app/channels/application_cable/connection.rb
|
|
63
|
+
- templates/showcase/app/channels/svelte_on_rails_channel.rb
|
|
64
|
+
- templates/showcase/app/controllers/svelte_on_rails_showcase_controller.rb
|
|
65
|
+
- templates/showcase/app/frontend/initializers/actionCable.js
|
|
66
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/JavascriptImport.svelte
|
|
67
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/JpgImport.svelte
|
|
68
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/ParentWithChild.svelte
|
|
69
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/PngImport.svelte
|
|
70
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/ReceiveFromChannel.svelte
|
|
71
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/SvelteOnRailsHelloWorld.svelte
|
|
72
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/SvgRawImport.svelte
|
|
73
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/england.png
|
|
74
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/face-smile-wink.svg
|
|
75
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/nestedJavascript.js
|
|
76
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/nestedJavascriptToggled.js
|
|
77
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/sub/NestedComponent.svelte
|
|
78
|
+
- templates/showcase/app/frontend/javascript/svelte_on_rails_showcase/switzerland.jpg
|
|
79
|
+
- templates/showcase/app/views/svelte_on_rails_showcase/_nav.html.erb
|
|
80
|
+
- templates/showcase/app/views/svelte_on_rails_showcase/_styles.html.erb
|
|
81
|
+
- templates/showcase/app/views/svelte_on_rails_showcase/backend_frontend_rendered.html.erb
|
|
82
|
+
- templates/showcase/app/views/svelte_on_rails_showcase/index.html.erb
|
|
83
|
+
- templates/showcase/app/views/svelte_on_rails_showcase/ssr_auto_rendered.html.erb
|
|
84
|
+
- templates/showcase/app/views/svelte_on_rails_showcase/web_socket.html.erb
|
|
81
85
|
homepage: https://svelte-on-rails.dev
|
|
82
86
|
licenses:
|
|
83
87
|
- MIT
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
module SvelteOnRails
|
|
2
|
-
|
|
3
|
-
module Installer
|
|
4
|
-
|
|
5
|
-
module Vite
|
|
6
|
-
|
|
7
|
-
def self.install_vite(version_specifier: 'latest')
|
|
8
|
-
iu = SvelteOnRails::Installer::Utils
|
|
9
|
-
|
|
10
|
-
puts '-' * 80
|
|
11
|
-
|
|
12
|
-
gu = SvelteOnRails::GemUtils
|
|
13
|
-
if gu.check_gem_version('vite_rails')
|
|
14
|
-
puts "vite_rails already installed, skipping this part."
|
|
15
|
-
else
|
|
16
|
-
|
|
17
|
-
# check non-existence
|
|
18
|
-
|
|
19
|
-
iu.check_file_not_exists('config/vite.json')
|
|
20
|
-
iu.check_file_not_exists('vite.config.ts')
|
|
21
|
-
iu.check_folder_not_exists('app/frontend')
|
|
22
|
-
|
|
23
|
-
# install
|
|
24
|
-
|
|
25
|
-
gu.install_gem('vite_rails')
|
|
26
|
-
|
|
27
|
-
Dir.chdir(Rails.root) do
|
|
28
|
-
puts '++ running «bundle exec vite install» ++'
|
|
29
|
-
`bundle exec vite install`
|
|
30
|
-
puts '++ vite installer finished ++'
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# check existence
|
|
36
|
-
|
|
37
|
-
iu.check_file_exists('config/vite.json')
|
|
38
|
-
iu.check_file_exists('vite.config.ts')
|
|
39
|
-
iu.check_file_exists('package.json')
|
|
40
|
-
iu.check_file_exists('package-lock.json')
|
|
41
|
-
iu.check_file_exists('app/frontend/entrypoints/application.js')
|
|
42
|
-
iu.check_folder_exists('app/frontend')
|
|
43
|
-
|
|
44
|
-
# check npm package version
|
|
45
|
-
|
|
46
|
-
ni = SvelteOnRails::Installer::Npm
|
|
47
|
-
ni.install_or_update_package('vite', version_specifier: version_specifier)
|
|
48
|
-
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def self.configure_for_svelte(vite_plugin_svelte_version_specifier: nil)
|
|
52
|
-
|
|
53
|
-
# add import statement
|
|
54
|
-
|
|
55
|
-
js_i = SvelteOnRails::Installer::Javascript
|
|
56
|
-
pkg = '@sveltejs/vite-plugin-svelte'
|
|
57
|
-
npm_i = SvelteOnRails::Installer::Npm
|
|
58
|
-
npm_i.install_or_update_package(pkg, version_specifier: vite_plugin_svelte_version_specifier)
|
|
59
|
-
|
|
60
|
-
# add plugin
|
|
61
|
-
|
|
62
|
-
file_path = 'vite.config.ts'
|
|
63
|
-
|
|
64
|
-
if File.read(file_path).match?(/svelte/)
|
|
65
|
-
puts "Svelte seams already configured in vite.config.ts, skipping here."
|
|
66
|
-
else
|
|
67
|
-
|
|
68
|
-
js_i.append_import_statement('vite.config.ts', pkg, "import {svelte} from '#{pkg}'")
|
|
69
|
-
|
|
70
|
-
# Regex to match the plugins array and locate RubyPlugin()
|
|
71
|
-
plugins_regex = /(plugins:\s*\[\s*)(\s*)RubyPlugin\(\),\s*([^\]]*?\])/m
|
|
72
|
-
|
|
73
|
-
# Check if plugins array with RubyPlugin exists
|
|
74
|
-
file_content = File.read(file_path)
|
|
75
|
-
unless file_content.match?(plugins_regex)
|
|
76
|
-
puts "Error: No plugins array with RubyPlugin() found in the input."
|
|
77
|
-
return file_content
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
# Insert svelte({}), after RubyPlugin() with proper indentation
|
|
81
|
-
modified_content = file_content.gsub(plugins_regex) do |match|
|
|
82
|
-
prefix = $1 # Start of plugins array (e.g., "plugins: [")
|
|
83
|
-
indent = ' ' # Indentation before RubyPlugin()
|
|
84
|
-
rest = $3 # Remaining plugins and closing bracket
|
|
85
|
-
"#{prefix}#{indent}RubyPlugin(),\n#{indent}svelte({}),\n#{indent}#{rest}"
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
File.write(file_path, modified_content)
|
|
89
|
-
puts "Updated vite.config.ts with svelte() plugin."
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
class SvelteOnRailsHelloWorldController < ApplicationController
|
|
2
|
-
|
|
3
|
-
def index
|
|
4
|
-
end
|
|
5
|
-
|
|
6
|
-
def web_socket_action
|
|
7
|
-
|
|
8
|
-
comp = 'ReceiveFromChannel'
|
|
9
|
-
|
|
10
|
-
case params['stream']
|
|
11
|
-
|
|
12
|
-
when 'action-cable-to-component'
|
|
13
|
-
SvelteOnRails::ActionCable.dispatch(
|
|
14
|
-
comp,
|
|
15
|
-
{ message: "#{SecureRandom.hex(2)} Sent by <span class='transfer'>ActionCable</span>: äöü🤣🌴🌍漢字", class: 'action-cable-to-component' },
|
|
16
|
-
event: 'stream-action'
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
when 'action-cable-to-element'
|
|
20
|
-
SvelteOnRails::ActionCable.dispatch(
|
|
21
|
-
comp,
|
|
22
|
-
{ message: "#{SecureRandom.hex(2)} <span class='transfer'>ActionCable to .my-custom-class / my-custom-event</span>", class: 'action-cable-to-element' },
|
|
23
|
-
selector: '.my-custom-class',
|
|
24
|
-
event: 'my-custom-event'
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
when 'action-cable-to-selector'
|
|
28
|
-
SvelteOnRails::ActionCable.dispatch_by_selector(
|
|
29
|
-
'.receive-by-selector',
|
|
30
|
-
{ message: "Sent by ActionCable/Selector: äöü🤣🌴🌍漢字", class: 'action-cable-to-selector' }
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
when 'turbo-stream-to-all-components'
|
|
34
|
-
SvelteOnRails::TurboStream.dispatch(
|
|
35
|
-
nil,
|
|
36
|
-
{ message: "Sent by TurboStream: äöü🤣🌴🌍漢字", class: 'turbo-stream-to-all-components' },
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
when 'turbo-stream-to-element'
|
|
40
|
-
SvelteOnRails::TurboStream.dispatch(
|
|
41
|
-
nil,
|
|
42
|
-
{ message: "Sent by TurboStream: äöü🤣🌴🌍漢字", class: 'turbo-stream-to-element' },
|
|
43
|
-
selector: '.my-custom-class',
|
|
44
|
-
event: 'my-custom-event'
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
when 'turbo-stream-to-selector'
|
|
48
|
-
SvelteOnRails::TurboStream.dispatch_by_selector(
|
|
49
|
-
'.receive-by-selector',
|
|
50
|
-
{ message: "Sent by TurboStream/Selector: äöü🤣🌴🌍漢字", class: 'turbo-stream-to-selector' }
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
else
|
|
54
|
-
raise 'Unknown stream'
|
|
55
|
-
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
render plain: "dispatched: #{params['stream']}"
|
|
59
|
-
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<div class="nav">
|
|
2
|
-
<%= link_to 'Hello World', '/svelte_on_rails_hello_world/index' %>
|
|
3
|
-
|
|
|
4
|
-
<%= link_to 'Backend/Frontend Test', '/svelte_on_rails_hello_world/backend_frontend_rendered' %>
|
|
5
|
-
|
|
|
6
|
-
<%= link_to 'SSR-Auto rendered (default)', '/svelte_on_rails_hello_world/ssr_auto_rendered' %>
|
|
7
|
-
|
|
|
8
|
-
<%= link_to 'Turbo Streams', '/svelte_on_rails_hello_world/web_socket' %>
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
<% turbo_id = request.headers['X-Turbo-Request-ID'] %>
|
|
12
|
-
<p class="<%= (turbo_id.present? ? 'turbo-request' : 'initial-request') %>"><%= (turbo_id.blank? ? 'This is a initial request' : "Turbo-Request-ID: #{turbo_id}") %></p>
|
|
13
|
-
<p>Rails.environment: <%= Rails.env %></p>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<%= render 'styles' %>
|
|
2
|
-
<style>
|
|
3
|
-
.svelte-component {
|
|
4
|
-
border: 1px solid lightgray;
|
|
5
|
-
padding: 10px;
|
|
6
|
-
margin: 10px;
|
|
7
|
-
width: 100px;
|
|
8
|
-
display: inline-block;
|
|
9
|
-
}
|
|
10
|
-
</style>
|
|
11
|
-
|
|
12
|
-
<%= render 'nav' %>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<h1>SSR / Client side rendering test</h1>
|
|
16
|
-
<p>After rendering both, client and server side rendered components, must look similar for making sure that on ssr:
|
|
17
|
-
:auto (which is default)
|
|
18
|
-
no unpleasant «blink» is appearing.</p>
|
|
19
|
-
<hr>
|
|
20
|
-
|
|
21
|
-
<% components = ['SvgRawImport', 'JpgImport', 'PngImport', 'JavascriptImport', 'ParentWithChild'] %>
|
|
22
|
-
|
|
23
|
-
<h3>Always rendered server side</h3>
|
|
24
|
-
<div class="ssr-only">
|
|
25
|
-
<% components.each do |component| %>
|
|
26
|
-
<%= svelte_component(component, {title: component}, options: {ssr: true, hydrate: false}) %>
|
|
27
|
-
<% end %>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<hr>
|
|
31
|
-
<h3>Always rendered client side</h3>
|
|
32
|
-
<p>Here you will see a unpleasant «blink» on the initial request.</p>
|
|
33
|
-
<div class="client-only">
|
|
34
|
-
<% components.each do |component| %>
|
|
35
|
-
<%= svelte_component(component, {title: component}, options: {ssr: false, hydrate: true}) %>
|
|
36
|
-
<% end %>
|
|
37
|
-
</div>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|