You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hyperstack configuration is set in an initializer.
4
4
5
-
This gem is used internally by other [Hyperloop](http://ruby-hyperloop.io) gems for keeping config settings, and for registering client side autoload requirements.
5
+
> Note: You will need to stop and start your Rails server when changing this configuration.
6
6
7
-
To indicate gems to be autoloaded on client side:
7
+
Example configuration:
8
8
9
9
```ruby
10
-
require'hyperloop-config'
11
-
Hyperloop.import 'my-gem-name'
12
-
Hyperloop.imports 'my-gem-name'# same as above
13
-
Hyperloop.import 'my-gem-name', server_only:true
14
-
Hyperloop.import 'my-gem-name', client_only:true
15
-
Hyperloop.import 'path', tree:true# same as saying require_tree 'path' in a manifest file
16
-
Hyperloop.import_tree 'path'# same as above
17
-
Hyperloop.import 'asset_name'# same as saying require 'asset_name' in a manifest file
Once a gem file spec does a `Hyperloop.import` the listed gem will be automatically added to the `hyperloop-loader` manifest. This means all you do is add a gem
21
-
to rails, and it will get sent on to the client (plus any other dependencies you care to require.)
38
+
The listed gem will be automatically added to the `hyperstack-loader` manifest. This means all you do is add a gem to Rails, and it will get sent on to the client (plus any other dependencies you care to require.)
22
39
23
-
The require method can be used in the hyperloop initializer as well to add code to the manifest (i.e. add a gem to that is not using Hyperloop.import)
40
+
The require method can be used in the Hyperstack initializer as well to add code to the manifest (i.e. add a gem to that is not using Hyperstack.import)
24
41
25
42
To define an initializer:
26
43
27
44
```ruby
28
-
moduleHyperloop
45
+
moduleHyperstack
29
46
on_config_reset do
30
47
# anything you want to run when initialization begins
31
48
end
@@ -37,7 +54,7 @@ module Hyperloop
37
54
define_setting :default_prerendering_mode, :on
38
55
39
56
define_setting(:transport, :none) do |transport|
40
-
# value of transport is whatever the user set in the initializer,
57
+
# value of transport is whatever the user set in the initializer
0 commit comments