opal-rails 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -2
- data/README.md +19 -9
- data/bin/sandbox-setup +1 -1
- data/lib/generators/opal/install/install_generator.rb +4 -2
- data/lib/generators/opal/install/templates/initializer.rb +22 -0
- data/lib/opal/rails/version.rb +1 -1
- 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: 165e5b957c73079681eae29566b10478bddd1bb0a959d7cc2ce772ffe5778b85
|
4
|
+
data.tar.gz: 4f6dd4337a2f84796852b4ceb87e15decb2ae85afdc1c5012c1f0ab586c08e1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4537a41a8f9c848acbf0a440aa1767d5f40737dca75e62e8711efd860a369a44d8c093c2d981ee759090b135b42720a35953f65a559be21fbd86c04763ed9f8d
|
7
|
+
data.tar.gz: '05853c6bb0945b217118c92af19694771a3b8fe35207fe8c2ca1e4906b652808fab63beb25e0b96efdc00f1c979abfa9e1ad36864afe35ad1e58b94db0bccb58'
|
data/CHANGELOG.md
CHANGED
@@ -18,9 +18,24 @@ Whitespace conventions:
|
|
18
18
|
- 1 spaces before normal text
|
19
19
|
-->
|
20
20
|
|
21
|
-
## [2.0](https://github.com/opal/opal-rails/compare/v1.1.2...v2.0.0) - unreleased
|
22
21
|
|
23
|
-
|
22
|
+
|
23
|
+
## [2.0.1](https://github.com/opal/opal-rails/compare/v2.0.0...v2.0.1) - 2021-03-03
|
24
|
+
|
25
|
+
|
26
|
+
### Added
|
27
|
+
|
28
|
+
- The install generator now will add an `opal.rb` initializer with a default compiler configuration and the template assign support disabled
|
29
|
+
|
30
|
+
### Fixed
|
31
|
+
|
32
|
+
- The install generator was missing a newline when changing the app layout
|
33
|
+
|
34
|
+
|
35
|
+
## [2.0.0](https://github.com/opal/opal-rails/compare/v1.1.2...v2.0.0) - 2021-02-23
|
36
|
+
|
37
|
+
*This is a major version, since a number of dependencies are going to be opt-in and support for older Rails
|
38
|
+
and Sprockets versions is dropped*
|
24
39
|
|
25
40
|
### Added
|
26
41
|
|
data/README.md
CHANGED
@@ -32,27 +32,37 @@ bin/rails opal:install
|
|
32
32
|
|
33
33
|
### Configuration
|
34
34
|
|
35
|
-
|
35
|
+
#### For the compiler
|
36
|
+
|
37
|
+
Add your configuration for the compiler:
|
38
|
+
|
39
|
+
`config/initializers/opal.rb`
|
36
40
|
|
37
41
|
```ruby
|
38
42
|
# Compiler options
|
39
|
-
Rails.application.config.opal.
|
40
|
-
Rails.application.config.opal.
|
41
|
-
Rails.application.config.opal.
|
42
|
-
Rails.application.config.opal.
|
43
|
+
Rails.application.config.opal.method_missing_enabled = true
|
44
|
+
Rails.application.config.opal.const_missing_enabled = true
|
45
|
+
Rails.application.config.opal.arity_check_enabled = true
|
46
|
+
Rails.application.config.opal.freezing_stubs_enabled = true
|
43
47
|
Rails.application.config.opal.dynamic_require_severity = :ignore
|
48
|
+
```
|
49
|
+
|
50
|
+
Check out the full list of the available configuration options at: [lib/opal/config.rb](https://github.com/opal/opal/blob/master/lib/opal/config.rb).
|
44
51
|
|
45
|
-
|
52
|
+
#### For template assigns
|
46
53
|
|
47
|
-
|
48
|
-
|
54
|
+
Add your configuration for rendering assigns when using the template handler from actions:
|
55
|
+
|
56
|
+
`config/initializers/opal.rb`
|
57
|
+
|
58
|
+
```ruby
|
49
59
|
Rails.application.config.opal.assigns_in_templates = true
|
50
60
|
Rails.application.config.opal.assigns_in_templates = :locals # only locals
|
51
61
|
Rails.application.config.opal.assigns_in_templates = :ivars # only instance variables
|
52
62
|
```
|
53
63
|
|
54
|
-
For a full list of the available configuration options for the compiler please refer to: [lib/opal/config.rb](https://github.com/opal/opal/blob/master/lib/opal/config.rb).
|
55
64
|
|
65
|
+
Local and instance variables will be sent down to the view after converting their values to JSON.
|
56
66
|
|
57
67
|
|
58
68
|
## Usage
|
data/bin/sandbox-setup
CHANGED
@@ -4,9 +4,11 @@ class Opal::InstallGenerator < Rails::Generators::Base
|
|
4
4
|
def configure_sprockets
|
5
5
|
append_to_file 'app/assets/config/manifest.js', '//= link_directory ../javascript .js'
|
6
6
|
template "application.js.rb", "app/assets/javascript/application.js.rb"
|
7
|
+
template "initializer.rb", "config/initializers/opal.rb"
|
7
8
|
|
8
9
|
# Add the javascript tag to the application head tag
|
9
|
-
gsub_file 'app/views/layouts/application.html.erb', %r{
|
10
|
-
'\1 <%= javascript_include_tag "application", "data-turbolinks-track": "reload"
|
10
|
+
gsub_file 'app/views/layouts/application.html.erb', %r{(\n *)</head>},
|
11
|
+
'\1 <%= javascript_include_tag "application", "data-turbolinks-track": "reload" %>' \
|
12
|
+
'\1</head>'
|
11
13
|
end
|
12
14
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Check out the full list of the available configuration options at
|
2
|
+
# https://github.com/opal/opal/blob/master/lib/opal/config.rb
|
3
|
+
|
4
|
+
Rails.application.configure do
|
5
|
+
# We suggest keeping the configuration above as default for all environments,
|
6
|
+
# disabling some of them might slightly reduce the bundle size or reduce performance
|
7
|
+
# by degrading some ruby features.
|
8
|
+
config.opal.method_missing_enabled = true
|
9
|
+
config.opal.const_missing_enabled = true
|
10
|
+
config.opal.arity_check_enabled = true
|
11
|
+
config.opal.freezing_stubs_enabled = true
|
12
|
+
config.opal.dynamic_require_severity = :ignore
|
13
|
+
|
14
|
+
# To enable passing assigns from the controller to the opal template handler
|
15
|
+
# change the following configuration to one of these values:
|
16
|
+
#
|
17
|
+
# - true # both locals and instance variables
|
18
|
+
# - :locals # only locals
|
19
|
+
# - :ivars # only instance variables
|
20
|
+
#
|
21
|
+
config.opal.assigns_in_templates = false
|
22
|
+
end
|
data/lib/opal/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elia Schito
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -221,6 +221,7 @@ files:
|
|
221
221
|
- lib/generators/opal/install/USAGE
|
222
222
|
- lib/generators/opal/install/install_generator.rb
|
223
223
|
- lib/generators/opal/install/templates/application.js.rb
|
224
|
+
- lib/generators/opal/install/templates/initializer.rb
|
224
225
|
- lib/opal-rails.rb
|
225
226
|
- lib/opal/rails.rb
|
226
227
|
- lib/opal/rails/engine.rb
|