hanami-view 2.3.0 → 3.0.0.rc1
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/CHANGELOG.md +404 -183
- data/LICENSE +20 -0
- data/README.md +17 -22
- data/hanami-view.gemspec +19 -19
- data/lib/hanami/view/context.rb +11 -0
- data/lib/hanami/view/decorated_attributes.rb +0 -2
- data/lib/hanami/view/erb/filters/block.rb +2 -1
- data/lib/hanami/view/erb/filters/trimming.rb +14 -8
- data/lib/hanami/view/erb/parser.rb +5 -1
- data/lib/hanami/view/exposure.rb +16 -10
- data/lib/hanami/view/exposures.rb +6 -2
- data/lib/hanami/view/helpers/escape_helper.rb +3 -2
- data/lib/hanami/view/helpers/number_formatting_helper.rb +2 -4
- data/lib/hanami/view/helpers/tag_helper/tag_builder.rb +10 -7
- data/lib/hanami/view/helpers/tag_helper.rb +1 -3
- data/lib/hanami/view/html.rb +0 -2
- data/lib/hanami/view/html_safe_string_buffer.rb +1 -1
- data/lib/hanami/view/part.rb +2 -5
- data/lib/hanami/view/part_builder.rb +7 -9
- data/lib/hanami/view/renderer.rb +78 -28
- data/lib/hanami/view/rendering.rb +38 -22
- data/lib/hanami/view/rendering_missing.rb +11 -14
- data/lib/hanami/view/scope.rb +29 -15
- data/lib/hanami/view/scope_builder.rb +6 -6
- data/lib/hanami/view/tilt/haml_adapter.rb +1 -1
- data/lib/hanami/view/tilt/slim_adapter.rb +1 -1
- data/lib/hanami/view/version.rb +1 -2
- data/lib/hanami/view.rb +63 -31
- metadata +14 -53
data/CHANGELOG.md
CHANGED
|
@@ -1,325 +1,546 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Break Versioning](https://www.taoensso.com/break-versioning).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
### Deprecated
|
|
15
|
+
|
|
16
|
+
### Removed
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
### Security
|
|
21
|
+
|
|
22
|
+
[Unreleased]: https://github.com/hanami/view/compare/v3.0.0.rc1...HEAD
|
|
23
|
+
|
|
24
|
+
## [3.0.0.rc1] - 2026-06-16
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- Track the currently-rendering template name. (@timriley in #277)
|
|
29
|
+
|
|
30
|
+
Expose the topmost entry as `Hanami::View::Rendering#current_template_name` and the full stack as `#current_template_names`. Entries are the resolved path of the file actually being rendered, relative to its configured `paths` directory, with format/engine extensions stripped. For example, `render("form")` from inside `posts/show.html.erb` reports `"posts/_form"`; a layout at `layouts/app.html.erb` reports `"layouts/app"`.
|
|
31
|
+
|
|
32
|
+
Convenience accessors are available as `Hanami::View::Scope#_template_name` (with `template_name` as a convenience alias) and `Hanami::View::Context#current_template_name`. The current template name can be used to enable such behaviors as lazy/relative key lookups for i18n view helpers.
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- **BREAKING:** Default to undecorated exposures. (@timriley in #274)
|
|
37
|
+
|
|
38
|
+
Decorate your exposures with the new `.decorate` method, or the `decorate: true` option for `.expose`. Default back to decorated exposures via `config.decorate_exposures = true`.
|
|
39
|
+
- Cache the view's resolved configuration as a frozen `Data` snapshot (via dry-configurable's `#to_data`) at initialization, avoiding repeated config lookups on the rendering hot path for improved memory usage and speed. (@cllns in #276)
|
|
40
|
+
- Require Ruby 3.3 or newer.
|
|
41
|
+
|
|
42
|
+
[3.0.0.rc1]: https://github.com/hanami/view/compare/v2.3.1...v3.0.0.rc1
|
|
43
|
+
|
|
44
|
+
## [2.3.1] - 2025-11-22
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
|
|
48
|
+
- Pass through all input arguments when exposure procs receive a keyword splat. (@jaredcwhite in #269)
|
|
49
|
+
|
|
50
|
+
[2.3.1]: https://github.com/hanami/view/compare/v2.3.0...v2.3.1
|
|
51
|
+
|
|
52
|
+
## [2.3.0] - 2025-11-12
|
|
6
53
|
|
|
7
54
|
### Fixed
|
|
8
55
|
|
|
9
56
|
- Avoid warnings (from deprecated `URI::RFC3986_PARSER.extract`) in escape helper. (@timriley in #267)
|
|
10
57
|
|
|
11
|
-
|
|
58
|
+
[2.3.0]: https://github.com/hanami/view/compare/v2.3.0.beta2...v2.3.0
|
|
59
|
+
|
|
60
|
+
## [2.3.0.beta2] - 2025-10-17
|
|
12
61
|
|
|
13
62
|
### Changed
|
|
14
63
|
|
|
15
|
-
- Drop support for Ruby 3.1
|
|
64
|
+
- Drop support for Ruby 3.1.
|
|
65
|
+
|
|
66
|
+
[2.3.0.beta2]: https://github.com/hanami/view/compare/v2.3.0.beta1...v2.3.0.beta2
|
|
67
|
+
|
|
68
|
+
## [2.3.0.beta1] - 2025-10-03
|
|
16
69
|
|
|
17
|
-
|
|
70
|
+
[2.3.0.beta1]: https://github.com/hanami/view/compare/v2.2.1...v2.3.0.beta1
|
|
18
71
|
|
|
19
|
-
##
|
|
72
|
+
## [2.2.1] - 2025-03-17
|
|
20
73
|
|
|
21
74
|
### Fixed
|
|
22
75
|
|
|
23
|
-
- Allow multiple named scopes to be built in a single rendering (via a fix to internal scope class cache keys) (@swilgosz in #253)
|
|
76
|
+
- Allow multiple named scopes to be built in a single rendering (via a fix to internal scope class cache keys). (@swilgosz in #253)
|
|
77
|
+
|
|
78
|
+
[2.2.1]: https://github.com/hanami/view/compare/v2.2.0...v2.2.1
|
|
79
|
+
|
|
80
|
+
## [2.2.0] - 2024-11-05
|
|
24
81
|
|
|
25
|
-
|
|
82
|
+
[2.2.0]: https://github.com/hanami/view/compare/v2.2.0.rc1...v2.2.0
|
|
26
83
|
|
|
27
|
-
##
|
|
84
|
+
## [2.2.0.rc1] - 2024-10-29
|
|
28
85
|
|
|
29
|
-
|
|
86
|
+
[2.2.0.rc1]: https://github.com/hanami/view/compare/v2.2.0.beta2...v2.2.0.rc1
|
|
30
87
|
|
|
31
|
-
##
|
|
88
|
+
## [2.2.0.beta2] - 2024-09-25
|
|
89
|
+
|
|
90
|
+
[2.2.0.beta2]: https://github.com/hanami/view/compare/v2.2.0.beta1...v2.2.0.beta2
|
|
91
|
+
|
|
92
|
+
## [2.2.0.beta1] - 2024-07-16
|
|
32
93
|
|
|
33
94
|
### Changed
|
|
34
95
|
|
|
35
|
-
- Drop support for Ruby 3.0
|
|
96
|
+
- Drop support for Ruby 3.0.
|
|
97
|
+
|
|
98
|
+
[2.2.0.beta1]: https://github.com/hanami/view/compare/v2.1.0...v2.2.0.beta1
|
|
36
99
|
|
|
37
|
-
##
|
|
100
|
+
## [2.1.0] - 2024-02-27
|
|
38
101
|
|
|
39
|
-
|
|
102
|
+
[2.1.0]: https://github.com/hanami/view/compare/v2.1.0.rc3...v2.1.0
|
|
103
|
+
|
|
104
|
+
## [2.1.0.rc3] - 2024-02-16
|
|
40
105
|
|
|
41
106
|
### Changed
|
|
42
|
-
- [Tim Riley] Remove unneeded concurrent-ruby gem dependency.
|
|
43
107
|
|
|
44
|
-
|
|
108
|
+
- Remove unneeded concurrent-ruby gem dependency. (Tim Riley)
|
|
109
|
+
|
|
110
|
+
[2.1.0.rc3]: https://github.com/hanami/view/compare/v2.1.0.rc2...v2.1.0.rc3
|
|
111
|
+
|
|
112
|
+
## [2.1.0.rc2] - 2023-11-08
|
|
45
113
|
|
|
46
114
|
### Changed
|
|
47
|
-
- [Tim Riley] Remove `LayoutNotFoundError` and raise `TemplateNotFoundError` for all kinds of missing templates, including layouts.
|
|
48
115
|
|
|
49
|
-
|
|
116
|
+
- Remove `LayoutNotFoundError` and raise `TemplateNotFoundError` for all kinds of missing templates, including layouts. (Tim Riley)
|
|
117
|
+
|
|
118
|
+
[2.1.0.rc2]: https://github.com/hanami/view/compare/v2.1.0.rc1...v2.1.0.rc2
|
|
119
|
+
|
|
120
|
+
## [2.1.0.rc1] - 2023-11-01
|
|
50
121
|
|
|
51
122
|
### Fixed
|
|
52
|
-
- [Tim Riley] Include methods from helper modules as public (#242)
|
|
53
|
-
Replace `module_function` with `extend self` to allow helper methods to remain directly usable on their modules, but to also let those methods remain public when the module is included in a class.
|
|
54
|
-
This will allow an intermediary `helpers` object to be created for view parts (inside full Hanami apps) to access the standard helpers.
|
|
55
123
|
|
|
56
|
-
|
|
124
|
+
- Include methods from helper modules as public. Replace `module_function` with `extend self` to allow helper methods to remain directly usable on their modules, but to also let those methods remain public when the module is included in a class. This will allow an intermediary `helpers` object to be created for view parts (inside full Hanami apps) to access the standard helpers. (Tim Riley in #242)
|
|
125
|
+
|
|
126
|
+
[2.1.0.rc1]: https://github.com/hanami/view/compare/v2.1.0.beta2...v2.1.0.rc1
|
|
127
|
+
|
|
128
|
+
## [2.1.0.beta2] - 2023-10-04
|
|
57
129
|
|
|
58
130
|
### Added
|
|
59
|
-
- [Luca Guidi] Add `Hanami::View::Rendered#match?`, `#match`, and `#include?` to make it more specs friendly.
|
|
60
|
-
- [Philip Arndt] Make `Hanami::View#call` to accept `layout:` keyword argument to specify the layout to use during the rendering.
|
|
61
131
|
|
|
62
|
-
|
|
132
|
+
- Add `Hanami::View::Rendered#match?`, `#match`, and `#include?` to make it more specs friendly. (Luca Guidi)
|
|
133
|
+
- Make `Hanami::View#call` to accept `layout:` keyword argument to specify the layout to use during the rendering. (Philip Arndt)
|
|
134
|
+
|
|
135
|
+
[2.1.0.beta2]: https://github.com/hanami/view/compare/v2.1.0.beta1...v2.1.0.beta2
|
|
136
|
+
|
|
137
|
+
## [2.1.0.beta1] - 2023-06-29
|
|
63
138
|
|
|
64
139
|
### Added
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
`scope_builder` as the default class to use when no value-specific part or scope classes can be
|
|
72
|
-
found. These settings default to `Hanami::View::Part` and `Hanami::View::Scope` respectively (#227)
|
|
73
|
-
- [Tim Riley] Introduce `Hanami::View::Helpers::EscapeHelper`, `Hanami::View::Helpers::TagHelper`,
|
|
74
|
-
`Hanami::View::Helpers::LinkToHelper`, `Hanami::View::Helpers::NumberFormattingHelper`. These
|
|
75
|
-
helper modules may optionally be mixed into your Part and Scope classes to provide additional
|
|
76
|
-
conveniences when authoring your views. To do this by default, create your own
|
|
77
|
-
`Hanaim::View::Part` and `Hanami::View::Scope` subclasses that include these modules, and then
|
|
78
|
-
configure these as the `part_class` and `scope_class` for your views. (#229)
|
|
140
|
+
|
|
141
|
+
- Introduce new ERB engine, `Hanami::View::ERB`, now used by default for ERB templates; the erbse gem is no longer a requirement. (Tim Riley in #226)
|
|
142
|
+
- Introduce `Hanami::View::HTML::SafeString`, returned when calling `String#html_safe`, also introduced via a `Hanami::View::HTML::StringExtensions` module prepended onto `String`. (Tim Riley in #226)
|
|
143
|
+
- Auto-escape HTML based on whether it is `#html_safe?` in ERB, Haml and Slim templates. (Tim Riley in #226)
|
|
144
|
+
- Add `part_class` and `scope_class` settings, used by the standard `part_builder` and `scope_builder` as the default class to use when no value-specific part or scope classes can be found. These settings default to `Hanami::View::Part` and `Hanami::View::Scope` respectively. (Tim Riley in #227)
|
|
145
|
+
- Introduce `Hanami::View::Helpers::EscapeHelper`, `Hanami::View::Helpers::TagHelper`, `Hanami::View::Helpers::LinkToHelper`, `Hanami::View::Helpers::NumberFormattingHelper`. These helper modules may optionally be mixed into your Part and Scope classes to provide additional conveniences when authoring your views. To do this by default, create your own `Hanaim::View::Part` and `Hanami::View::Scope` subclasses that include these modules, and then configure these as the `part_class` and `scope_class` for your views. (Tim Riley in #229)
|
|
79
146
|
|
|
80
147
|
### Changed
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
- [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
##
|
|
148
|
+
|
|
149
|
+
- Use Zeitwerk for code loading; you should now require `require "hanami/view"` just once. (Tim Riley in #233)
|
|
150
|
+
- Change `Context` interface: custom context subclasses now have complete control over their `#initialize` (no longer need to receive `**options` or call `super`); though any mutable ivars should be duped in a custom `#initialize_copy` as required. (Tim Riley in #223)
|
|
151
|
+
- Change `PartBuilder` and `ScopeBuilder` interfaces to consist of static methods only. (Tim Riley in #223)
|
|
152
|
+
- Finalize the view class config when calling `.new` for the first time. (Tim Riley in #223)
|
|
153
|
+
- Consolidate all internal caches to a single `View.cache`. (Tim Riley in #223)
|
|
154
|
+
- [Internal] Various refactorings to improve rendering performance. (Tim Riley in #223)
|
|
155
|
+
|
|
156
|
+
[2.1.0.beta1]: https://github.com/hanami/view/compare/v2.0.0.alpha8...v2.1.0.beta1
|
|
157
|
+
|
|
158
|
+
## [2.0.0.alpha8] - 2022-05-19
|
|
92
159
|
|
|
93
160
|
### Added
|
|
94
|
-
|
|
161
|
+
|
|
162
|
+
- Access a hash of template locals via accessing `locals` inside any template. (Tim Riley)
|
|
95
163
|
|
|
96
164
|
### Changed
|
|
97
|
-
- [Tim Riley] Removed automatic integration of `Hanami::View` subclasses with their surrounding Hanami application. View base classes within Hanami apps should inherit from `Hanami::Application::View` instead.
|
|
98
165
|
|
|
99
|
-
|
|
166
|
+
- Removed automatic integration of `Hanami::View` subclasses with their surrounding Hanami application. View base classes within Hanami apps should inherit from `Hanami::Application::View` instead. (Tim Riley)
|
|
167
|
+
|
|
168
|
+
[2.0.0.alpha8]: https://github.com/hanami/view/compare/v2.0.0.alpha7...v2.0.0.alpha8
|
|
169
|
+
|
|
170
|
+
## [2.0.0.alpha7] - 2022-03-08
|
|
100
171
|
|
|
101
172
|
### Added
|
|
102
|
-
|
|
103
|
-
-
|
|
173
|
+
|
|
174
|
+
- Automatically inject the app's `settings` and `assets` components (if present) into instances of `Hanami::View::ApplicationContext`. (Luca Guidi)
|
|
175
|
+
- Temporarily added to `Hanami::View::ApplicationContext` the `#content_for`, `#current_path` `#csrf_token` helpers, ported from the hanami-2-application-template. Some of those helpers will be moved to `hanami-helpers` gem in a later release. (Luca Guidi)
|
|
104
176
|
|
|
105
177
|
### Changed
|
|
106
|
-
- [Sean Collins] For views within an Hanami application, changed default location for templates from "web/templates" to "templates"
|
|
107
|
-
- [Luca Guidi] For views within an Hanami application, the default `part_namespace` is now `"view/parts"` (previously `"views/parts"`)
|
|
108
178
|
|
|
109
|
-
|
|
110
|
-
-
|
|
179
|
+
- For views within an Hanami application, changed default location for templates from "web/templates" to "templates". (Sean Collins)
|
|
180
|
+
- For views within an Hanami application, the default `part_namespace` is now `"view/parts"` (previously `"views/parts"`). (Luca Guidi)
|
|
181
|
+
|
|
182
|
+
### Fixed
|
|
183
|
+
|
|
184
|
+
- Application-level configuration is now applied to `Hanami::View` subclasses, no matter how deep their inheritance chain (e.g. app base view -> slice base view -> slice view). (Luca Guidi)
|
|
185
|
+
|
|
186
|
+
[2.0.0.alpha7]: https://github.com/hanami/view/compare/v2.0.0.alpha6...v2.0.0.alpha7
|
|
187
|
+
|
|
188
|
+
## [2.0.0.alpha6] - 2022-02-10
|
|
111
189
|
|
|
112
|
-
## v2.0.0.alpha6 - 2022-02-10
|
|
113
190
|
### Added
|
|
114
|
-
|
|
191
|
+
|
|
192
|
+
- Official support for Ruby: MRI 3.0 and 3.1. (Luca Guidi)
|
|
115
193
|
|
|
116
194
|
### Changed
|
|
117
|
-
- [Luca Guidi] Drop support for Ruby: MRI 2.3, 2.4, 2.5, 2.6, and 2.7.
|
|
118
195
|
|
|
119
|
-
|
|
196
|
+
- Drop support for Ruby: MRI 2.3, 2.4, 2.5, 2.6, and 2.7. (Luca Guidi)
|
|
197
|
+
|
|
198
|
+
[2.0.0.alpha6]: https://github.com/hanami/view/compare/v2.0.0.alpha5...v2.0.0.alpha6
|
|
199
|
+
|
|
200
|
+
## [2.0.0.alpha5] - 2022-01-12
|
|
201
|
+
|
|
120
202
|
### Added
|
|
121
|
-
- [Marc Busqué] Automatically provide access to Hanami application routes helper as `routes` in default application view context (`Hanami::View::ApplicationContext`)
|
|
122
203
|
|
|
123
|
-
|
|
204
|
+
- Automatically provide access to Hanami application routes helper as `routes` in default application view context (`Hanami::View::ApplicationContext`). (Marc Busqué)
|
|
205
|
+
|
|
206
|
+
[2.0.0.alpha5]: https://github.com/hanami/view/compare/v2.0.0.alpha3...v2.0.0.alpha5
|
|
207
|
+
|
|
208
|
+
## [2.0.0.alpha3] - 2021-11-09
|
|
209
|
+
|
|
124
210
|
### Added
|
|
125
|
-
|
|
211
|
+
|
|
212
|
+
- Raise `LayoutNotFoundError` exception with friendlier, more specific error message when layouts cannot be found. (Pablo Vicente)
|
|
126
213
|
|
|
127
214
|
### Changed
|
|
128
|
-
- [Tim Riley] (Internal) Updated settings to use updated dry-configurable `setting` 0.13.0 API
|
|
129
215
|
|
|
130
|
-
|
|
216
|
+
- (Internal) Updated settings to use updated dry-configurable `setting` 0.13.0 API. (Tim Riley)
|
|
217
|
+
|
|
218
|
+
[2.0.0.alpha3]: https://github.com/hanami/view/compare/v2.0.0.alpha2...v2.0.0.alpha3
|
|
219
|
+
|
|
220
|
+
## [2.0.0.alpha2] - 2021-05-04
|
|
221
|
+
|
|
131
222
|
### Changed
|
|
132
|
-
- [Tim Riley] Replaced entire gem with dry-view (now renamed to hanami-view). See [dry-view's documentation](https://dry-rb.org/gems/dry-view/) for its capabilities and [the dry-view changelog](CHANGELOG.dry-view.md) for its history.
|
|
133
223
|
|
|
134
|
-
|
|
224
|
+
- Replaced entire gem with dry-view (now renamed to hanami-view). See [dry-view's documentation](https://dry-rb.org/gems/dry-view/) for its capabilities and [the dry-view changelog](CHANGELOG.dry-view.md) for its history. (Tim Riley)
|
|
225
|
+
|
|
226
|
+
[2.0.0.alpha2]: https://github.com/hanami/view/compare/v1.3.1...v2.0.0.alpha2
|
|
227
|
+
|
|
228
|
+
## [1.3.1] - 2019-01-18
|
|
229
|
+
|
|
135
230
|
### Added
|
|
136
|
-
- [Luca Guidi] Official support for Ruby: MRI 2.6
|
|
137
|
-
- [Luca Guidi] Support `bundler` 2.0+
|
|
138
231
|
|
|
139
|
-
|
|
232
|
+
- Official support for Ruby: MRI 2.6. (Luca Guidi)
|
|
233
|
+
- Support `bundler` 2.0+. (Luca Guidi)
|
|
234
|
+
|
|
235
|
+
[1.3.1]: https://github.com/hanami/view/compare/v1.3.0...v1.3.1
|
|
236
|
+
|
|
237
|
+
## [1.3.0] - 2018-10-24
|
|
238
|
+
|
|
239
|
+
[1.3.0]: https://github.com/hanami/view/compare/v1.3.0.beta1...v1.3.0
|
|
240
|
+
|
|
241
|
+
## [1.3.0.beta1] - 2018-08-08
|
|
140
242
|
|
|
141
|
-
## v1.3.0.beta1 - 2018-08-08
|
|
142
243
|
### Fixed
|
|
143
|
-
- [Ferdinand Niedermann] Ensure to set `:disable_escape` option only for Slim and don't let Tilt to emit a warning for other template engines.
|
|
144
|
-
- [glaszig] Ensure partial rendering to respect `format` overriding
|
|
145
244
|
|
|
146
|
-
|
|
245
|
+
- Ensure to set `:disable_escape` option only for Slim and don't let Tilt to emit a warning for other template engines. (Ferdinand Niedermann)
|
|
246
|
+
- Ensure partial rendering to respect `format` overriding. (glaszig)
|
|
247
|
+
|
|
248
|
+
[1.3.0.beta1]: https://github.com/hanami/view/compare/v1.2.1...v1.3.0.beta1
|
|
249
|
+
|
|
250
|
+
## [1.2.1] - 2018-10-16
|
|
251
|
+
|
|
147
252
|
### Added
|
|
148
|
-
|
|
253
|
+
|
|
254
|
+
- Introduced new, backward compatible, signature to render a layout for testing purposes (eg. `ApplicationLayout.new({ format: :html }, "contents").render`). (Luca Guidi)
|
|
149
255
|
|
|
150
256
|
### Fixed
|
|
151
|
-
- [Luca Guidi] Ensure layout to be rendered when using HAML 5
|
|
152
|
-
- [Luca Guidi] Ensure to raise `NoMethodError` when an unknown method is invoked by a view/template
|
|
153
257
|
|
|
154
|
-
|
|
258
|
+
- Ensure layout to be rendered when using HAML 5. (Luca Guidi)
|
|
259
|
+
- Ensure to raise `NoMethodError` when an unknown method is invoked by a view/template. (Luca Guidi)
|
|
260
|
+
|
|
261
|
+
[1.2.1]: https://github.com/hanami/view/compare/v1.2.0...v1.2.1
|
|
262
|
+
|
|
263
|
+
## [1.2.0] - 2018-04-06
|
|
264
|
+
|
|
265
|
+
[1.2.0]: https://github.com/hanami/view/compare/v1.2.0.rc2...v1.2.0
|
|
266
|
+
|
|
267
|
+
## [1.2.0.rc2] - 2018-04-06
|
|
268
|
+
|
|
269
|
+
[1.2.0.rc2]: https://github.com/hanami/view/compare/v1.2.0.rc1...v1.2.0.rc2
|
|
155
270
|
|
|
156
|
-
##
|
|
271
|
+
## [1.2.0.rc1] - 2018-03-30
|
|
157
272
|
|
|
158
|
-
|
|
273
|
+
[1.2.0.rc1]: https://github.com/hanami/view/compare/v1.2.0.beta2...v1.2.0.rc1
|
|
159
274
|
|
|
160
|
-
##
|
|
275
|
+
## [1.2.0.beta2] - 2018-03-23
|
|
161
276
|
|
|
162
|
-
|
|
277
|
+
[1.2.0.beta2]: https://github.com/hanami/view/compare/v1.2.0.beta1...v1.2.0.beta2
|
|
278
|
+
|
|
279
|
+
## [1.2.0.beta1] - 2018-02-28
|
|
280
|
+
|
|
281
|
+
[1.2.0.beta1]: https://github.com/hanami/view/compare/v1.1.2...v1.2.0.beta1
|
|
282
|
+
|
|
283
|
+
## [1.1.2] - 2018-04-10
|
|
163
284
|
|
|
164
|
-
## v1.1.2 - 2018-04-10
|
|
165
285
|
### Fixed
|
|
166
|
-
- [Luca Guidi] Ensure to be able to use `exposures` even when they aren't duplicable objects
|
|
167
286
|
|
|
168
|
-
|
|
287
|
+
- Ensure to be able to use `exposures` even when they aren't duplicable objects. (Luca Guidi)
|
|
288
|
+
|
|
289
|
+
[1.1.2]: https://github.com/hanami/view/compare/v1.1.1...v1.1.2
|
|
290
|
+
|
|
291
|
+
## [1.1.1] - 2018-02-27
|
|
292
|
+
|
|
169
293
|
### Added
|
|
170
|
-
|
|
294
|
+
|
|
295
|
+
- Official support for Ruby: MRI 2.5. (Luca Guidi)
|
|
171
296
|
|
|
172
297
|
### Fixed
|
|
173
|
-
- [Alfonso Uceda] Ensure that `exposures` are properly overwritten for partials when `locals:` option is used
|
|
174
298
|
|
|
175
|
-
|
|
299
|
+
- Ensure that `exposures` are properly overwritten for partials when `locals:` option is used. (Alfonso Uceda)
|
|
300
|
+
|
|
301
|
+
[1.1.1]: https://github.com/hanami/view/compare/v1.1.0...v1.1.1
|
|
302
|
+
|
|
303
|
+
## [1.1.0] - 2017-10-25
|
|
304
|
+
|
|
305
|
+
[1.1.0]: https://github.com/hanami/view/compare/v1.1.0.rc1...v1.1.0
|
|
306
|
+
|
|
307
|
+
## [1.1.0.rc1] - 2017-10-16
|
|
176
308
|
|
|
177
|
-
|
|
309
|
+
[1.1.0.rc1]: https://github.com/hanami/view/compare/v1.1.0.beta3...v1.1.0.rc1
|
|
178
310
|
|
|
179
|
-
##
|
|
311
|
+
## [1.1.0.beta3] - 2017-10-04
|
|
312
|
+
|
|
313
|
+
[1.1.0.beta3]: https://github.com/hanami/view/compare/v1.1.0.beta2...v1.1.0.beta3
|
|
314
|
+
|
|
315
|
+
## [1.1.0.beta2] - 2017-10-03
|
|
180
316
|
|
|
181
|
-
## v1.1.0.beta2 - 2017-10-03
|
|
182
317
|
### Added
|
|
183
|
-
- [Luca Guidi] Added `Hanami::Layout#local` to safely access locals from layouts
|
|
184
318
|
|
|
185
|
-
|
|
319
|
+
- Added `Hanami::Layout#local` to safely access locals from layouts. (Luca Guidi)
|
|
320
|
+
|
|
321
|
+
[1.1.0.beta2]: https://github.com/hanami/view/compare/v1.1.0.beta1...v1.1.0.beta2
|
|
322
|
+
|
|
323
|
+
## [1.1.0.beta1] - 2017-08-11
|
|
324
|
+
|
|
186
325
|
### Fixed
|
|
187
|
-
- [yjukaku] Raise `Hanami::View::UnknownRenderTypeError` when an argument different from `:template` or `:partial` is passed to `render`
|
|
188
326
|
|
|
189
|
-
|
|
327
|
+
- Raise `Hanami::View::UnknownRenderTypeError` when an argument different from `:template` or `:partial` is passed to `render`. (yjukaku)
|
|
328
|
+
|
|
329
|
+
[1.1.0.beta1]: https://github.com/hanami/view/compare/v1.0.1...v1.1.0.beta1
|
|
330
|
+
|
|
331
|
+
## [1.0.1] - 2017-08-04
|
|
332
|
+
|
|
190
333
|
### Added
|
|
191
|
-
- [Luca Guidi] Compatibility with `haml` 5.0
|
|
192
334
|
|
|
193
|
-
|
|
335
|
+
- Compatibility with `haml` 5.0. (Luca Guidi)
|
|
336
|
+
|
|
337
|
+
[1.0.1]: https://github.com/hanami/view/compare/v1.0.0...v1.0.1
|
|
338
|
+
|
|
339
|
+
## [1.0.0] - 2017-04-06
|
|
194
340
|
|
|
195
|
-
|
|
341
|
+
[1.0.0]: https://github.com/hanami/view/compare/v1.0.0.rc1...v1.0.0
|
|
342
|
+
|
|
343
|
+
## [1.0.0.rc1] - 2017-03-31
|
|
344
|
+
|
|
345
|
+
[1.0.0.rc1]: https://github.com/hanami/view/compare/v1.0.0.beta2...v1.0.0.rc1
|
|
346
|
+
|
|
347
|
+
## [1.0.0.beta2] - 2017-03-17
|
|
196
348
|
|
|
197
|
-
## v1.0.0.beta2 - 2017-03-17
|
|
198
349
|
### Changed
|
|
199
|
-
- [Luca Guidi] Remove deprecated `Hanami::View::Rendering::LayoutScope#content`
|
|
200
350
|
|
|
201
|
-
|
|
351
|
+
- Remove deprecated `Hanami::View::Rendering::LayoutScope#content`. (Luca Guidi)
|
|
352
|
+
|
|
353
|
+
[1.0.0.beta2]: https://github.com/hanami/view/compare/v1.0.0.beta1...v1.0.0.beta2
|
|
354
|
+
|
|
355
|
+
## [1.0.0.beta1] - 2017-02-14
|
|
356
|
+
|
|
202
357
|
### Added
|
|
203
|
-
- [Luca Guidi] Official support for Ruby: MRI 2.4
|
|
204
|
-
- [Vladimir Dralo] Allow `View#initialize` to splat keyword arguments
|
|
205
358
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
359
|
+
- Official support for Ruby: MRI 2.4. (Luca Guidi)
|
|
360
|
+
- Allow `View#initialize` to splat keyword arguments. (Vladimir Dralo)
|
|
361
|
+
|
|
362
|
+
[1.0.0.beta1]: https://github.com/hanami/view/compare/v0.8.0...v1.0.0.beta1
|
|
363
|
+
|
|
364
|
+
## [0.8.0] - 2016-11-15
|
|
209
365
|
|
|
210
366
|
### Changed
|
|
211
|
-
- [Luca Guidi] Official support for Ruby: MRI 2.3+ and JRuby 9.1.5.0+
|
|
212
367
|
|
|
213
|
-
|
|
214
|
-
### Added
|
|
215
|
-
- [Luca Guidi] Introduced `#local` for views, layouts and templates. It allows to safely access locals without raising errors in case the referenced local is missing.
|
|
368
|
+
- Official support for Ruby: MRI 2.3+ and JRuby 9.1.5.0+. (Luca Guidi)
|
|
216
369
|
|
|
217
370
|
### Fixed
|
|
218
|
-
|
|
219
|
-
-
|
|
220
|
-
|
|
371
|
+
|
|
372
|
+
- Ensure `Rendering::NullLocal` to work with HAML templates. (Luca Guidi)
|
|
373
|
+
|
|
374
|
+
[0.8.0]: https://github.com/hanami/view/compare/v0.7.0...v0.8.0
|
|
375
|
+
|
|
376
|
+
## [0.7.0] - 2016-07-22
|
|
377
|
+
|
|
378
|
+
### Added
|
|
379
|
+
|
|
380
|
+
- Introduced `#local` for views, layouts and templates. It allows to safely access locals without raising errors in case the referenced local is missing. (Luca Guidi)
|
|
221
381
|
|
|
222
382
|
### Changed
|
|
223
|
-
– [Luca Guidi] Drop support for Ruby 2.0 and 2.1. Official support for JRuby 9.0.5.0+.
|
|
224
|
-
– [Luca Guidi] Deprecate `#content` in favor of `#local`.
|
|
225
383
|
|
|
226
|
-
|
|
384
|
+
- Drop support for Ruby 2.0 and 2.1. Official support for JRuby 9.0.5.0+. (Luca Guidi)
|
|
385
|
+
- Deprecate `#content` in favor of `#local`. (Luca Guidi)
|
|
386
|
+
|
|
387
|
+
### Fixed
|
|
388
|
+
|
|
389
|
+
- Find the correct partial in case of deeply nested templates. (nessur)
|
|
390
|
+
- Ensure `Hanami::Presenter` to respect method visibility of wrapped object. (Marcello Rocha)
|
|
391
|
+
- Ensure to use new registry when loading the framework. (Luca Guidi)
|
|
392
|
+
|
|
393
|
+
[0.7.0]: https://github.com/hanami/view/compare/v0.6.1...v0.7.0
|
|
394
|
+
|
|
395
|
+
## [0.6.1] - 2016-02-05
|
|
396
|
+
|
|
227
397
|
### Changed
|
|
228
|
-
|
|
398
|
+
|
|
399
|
+
- Preload partial templates in order to boost performances for partials rendering (2x faster). (Steve Hook)
|
|
229
400
|
|
|
230
401
|
### Fixed
|
|
231
|
-
- [Luca Guidi] Disable Slim autoescape to use `Hanami::View`'s feature
|
|
232
402
|
|
|
233
|
-
|
|
403
|
+
- Disable Slim autoescape to use `Hanami::View`'s feature. (Luca Guidi)
|
|
404
|
+
|
|
405
|
+
[0.6.1]: https://github.com/hanami/view/compare/v0.6.0...v0.6.1
|
|
406
|
+
|
|
407
|
+
## [0.6.0] - 2016-01-22
|
|
408
|
+
|
|
234
409
|
### Changed
|
|
235
|
-
- [Luca Guidi] Renamed the project
|
|
236
410
|
|
|
237
|
-
|
|
411
|
+
- Renamed the project. (Luca Guidi)
|
|
412
|
+
|
|
413
|
+
[0.6.0]: https://github.com/hanami/view/compare/v0.5.0...v0.6.0
|
|
414
|
+
|
|
415
|
+
## [0.5.0] - 2016-01-12
|
|
416
|
+
|
|
238
417
|
### Added
|
|
239
|
-
- [Luca Guidi] Added `Lotus::View::Configuration#default_encoding` to set the encoding for templates
|
|
240
418
|
|
|
241
|
-
|
|
242
|
-
- [Luca Guidi] Let exceptions to be raised as they occur in rendering context. This fixes misleading backtraces for exceptions.
|
|
243
|
-
- [Martin Rubi] Raise a `Lotus::View::MissingTemplateError` when rendering a missing partial from a template
|
|
244
|
-
- [Luca Guidi] Fix for `template.erb is not valid US-ASCII (Encoding::InvalidByteSequenceError)` when system encoding is not set
|
|
419
|
+
- Added `Lotus::View::Configuration#default_encoding` to set the encoding for templates. (Luca Guidi)
|
|
245
420
|
|
|
246
421
|
### Changed
|
|
247
|
-
- [Liam Dawson] Introduced `Lotus::View::Error` and let all the framework exceptions to inherit from it.
|
|
248
422
|
|
|
249
|
-
|
|
423
|
+
- Introduced `Lotus::View::Error` and let all the framework exceptions to inherit from it. (Liam Dawson)
|
|
424
|
+
|
|
425
|
+
### Fixed
|
|
426
|
+
|
|
427
|
+
- Let exceptions to be raised as they occur in rendering context. This fixes misleading backtraces for exceptions. (Luca Guidi)
|
|
428
|
+
- Raise a `Lotus::View::MissingTemplateError` when rendering a missing partial from a template. (Martin Rubi)
|
|
429
|
+
- Fix for `template.erb is not valid US-ASCII (Encoding::InvalidByteSequenceError)` when system encoding is not set. (Luca Guidi)
|
|
430
|
+
|
|
431
|
+
[0.5.0]: https://github.com/hanami/view/compare/v0.4.4...v0.5.0
|
|
432
|
+
|
|
433
|
+
## [0.4.4] - 2015-09-30
|
|
434
|
+
|
|
250
435
|
### Added
|
|
251
|
-
- [Luca Guidi] Autoescape for layout helpers.
|
|
252
436
|
|
|
253
|
-
|
|
437
|
+
- Autoescape for layout helpers. (Luca Guidi)
|
|
438
|
+
|
|
439
|
+
[0.4.4]: https://github.com/hanami/view/compare/v0.4.3...v0.4.4
|
|
440
|
+
|
|
441
|
+
## [0.4.3] - 2015-07-10
|
|
442
|
+
|
|
254
443
|
### Fixed
|
|
255
|
-
- [Farrel Lifson] Force partial finder to be explicit when to templates have the same name.
|
|
256
444
|
|
|
257
|
-
|
|
445
|
+
- Force partial finder to be explicit when to templates have the same name. (Farrel Lifson)
|
|
446
|
+
|
|
447
|
+
[0.4.3]: https://github.com/hanami/view/compare/v0.4.2...v0.4.3
|
|
448
|
+
|
|
449
|
+
## [0.4.2] - 2015-06-23
|
|
450
|
+
|
|
258
451
|
### Fixed
|
|
259
|
-
- [Tom Kadwill] Ensure views to use methods defined by the associated layout.
|
|
260
452
|
|
|
261
|
-
|
|
453
|
+
- Ensure views to use methods defined by the associated layout. (Tom Kadwill)
|
|
454
|
+
|
|
455
|
+
[0.4.2]: https://github.com/hanami/view/compare/v0.4.1...v0.4.2
|
|
456
|
+
|
|
457
|
+
## [0.4.1] - 2015-05-22
|
|
458
|
+
|
|
262
459
|
### Added
|
|
263
|
-
- [Luca Guidi] Introduced `#content` to render optional contents in a different context (eg. a view sets a page specific javascript in the application template footer).
|
|
264
460
|
|
|
265
|
-
|
|
461
|
+
- Introduced `#content` to render optional contents in a different context (eg. a view sets a page specific javascript in the application template footer). (Luca Guidi)
|
|
462
|
+
|
|
463
|
+
[0.4.1]: https://github.com/hanami/view/compare/v0.4.0...v0.4.1
|
|
464
|
+
|
|
465
|
+
## [0.4.0] - 2015-03-23
|
|
466
|
+
|
|
266
467
|
### Changed
|
|
267
|
-
|
|
268
|
-
-
|
|
468
|
+
|
|
469
|
+
- Autoescape concrete and virtual methods from presenters. (Luca Guidi)
|
|
470
|
+
- Autoescape concrete and virtual methods from views. (Luca Guidi)
|
|
269
471
|
|
|
270
472
|
### Fixed
|
|
271
|
-
- [Tom Kadwill] Improve error message for undefined method in view
|
|
272
|
-
- [Luca Guidi] Ensure that layouts will include modules from `Configuration#prepare`
|
|
273
473
|
|
|
274
|
-
|
|
474
|
+
- Improve error message for undefined method in view. (Tom Kadwill)
|
|
475
|
+
- Ensure that layouts will include modules from `Configuration#prepare`. (Luca Guidi)
|
|
476
|
+
|
|
477
|
+
[0.4.0]: https://github.com/hanami/view/compare/v0.3.0...v0.4.0
|
|
478
|
+
|
|
479
|
+
## [0.3.0] - 2014-12-23
|
|
480
|
+
|
|
275
481
|
### Added
|
|
276
|
-
|
|
277
|
-
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
280
|
-
-
|
|
281
|
-
-
|
|
282
|
-
-
|
|
283
|
-
-
|
|
482
|
+
|
|
483
|
+
- When duplicate the framework, also duplicate `Presenter`. (Trung Lê)
|
|
484
|
+
- Introduced `Scope#class`, `#inspect`, `LayoutScope#class` and `#inspect`. (Benny Klotz)
|
|
485
|
+
- Introduced `Configuration#prepare`. (Alfonso Uceda Pompa & Trung Lê)
|
|
486
|
+
- Implemented "respond to" logic for `Lotus::View::Scope` (`respond_to?` and `respond_to_missing?`). (Luca Guidi)
|
|
487
|
+
- Implemented "respond to" logic for `Lotus::Layout` (`respond_to?` and `respond_to_missing?`). (Luca Guidi)
|
|
488
|
+
- Allow view concrete methods that accept a block to be invoked from templates. (Jeremy Stephens)
|
|
489
|
+
- Implemented "respond to" logic for `Lotus::Presenter` (`respond_to?` and `respond_to_missing?`). (Peter Suschlik)
|
|
490
|
+
- Official support for Ruby 2.2. (Luca Guidi)
|
|
284
491
|
|
|
285
492
|
### Changed
|
|
286
|
-
|
|
493
|
+
|
|
494
|
+
- Raise an exception when a layout doesn't have an associated template. (Alfonso Uceda Pompa)
|
|
287
495
|
|
|
288
496
|
### Fixed
|
|
289
|
-
- [Luca Guidi] Ensure that concrete methods in layouts are available in templates
|
|
290
|
-
- [Luca Guidi] Ensure to associate the right layout to a view in case fo duplicated framework
|
|
291
|
-
- [Luca Guidi] Safe override of Ruby's top level methods in Scope. (Eg. use `select` from a view, not from `::Kernel`)
|
|
292
497
|
|
|
293
|
-
|
|
498
|
+
- Ensure that concrete methods in layouts are available in templates. (Luca Guidi)
|
|
499
|
+
- Ensure to associate the right layout to a view in case fo duplicated framework. (Luca Guidi)
|
|
500
|
+
- Safe override of Ruby's top level methods in Scope. (Eg. use `select` from a view, not from `::Kernel`). (Luca Guidi)
|
|
501
|
+
|
|
502
|
+
[0.3.0]: https://github.com/hanami/view/compare/v0.2.0...v0.3.0
|
|
503
|
+
|
|
504
|
+
## [0.2.0] - 2014-06-23
|
|
505
|
+
|
|
294
506
|
### Added
|
|
295
|
-
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
507
|
+
|
|
508
|
+
- Introduced `Configuration#duplicate`. (Luca Guidi)
|
|
509
|
+
- Introduced `Configuration#layout` to define the layout that all the views will use. (Luca Guidi)
|
|
510
|
+
- Introduced `Configuration#load_paths` to define several sources where to lookup for templates. (Luca Guidi)
|
|
511
|
+
- Introduced `Configuration#root` to define the root path where to find templates. (Luca Guidi)
|
|
512
|
+
- Introduced `Lotus::View::Configuration`. (Luca Guidi)
|
|
513
|
+
- Allow view concrete methods with arity > 0 to be invoked from templates. (Grant Ammons)
|
|
514
|
+
- Official support for Ruby 2.1. (Luca Guidi)
|
|
302
515
|
|
|
303
516
|
### Changed
|
|
304
|
-
|
|
305
|
-
-
|
|
306
|
-
-
|
|
517
|
+
|
|
518
|
+
- `Rendering::TemplatesFinder` now look recursively for templates, starting from the root. (Luca Guidi)
|
|
519
|
+
- Removed `View.layout=`. (Luca Guidi)
|
|
520
|
+
- Removed `View.root=`. (Luca Guidi)
|
|
307
521
|
|
|
308
522
|
### Fixed
|
|
309
|
-
- [Luca Guidi] Ensure outermost locals to not shadow innermost inside templates/partials
|
|
310
523
|
|
|
311
|
-
|
|
524
|
+
- Ensure outermost locals to not shadow innermost inside templates/partials. (Luca Guidi)
|
|
525
|
+
|
|
526
|
+
[0.2.0]: https://github.com/hanami/view/compare/v0.1.0...v0.2.0
|
|
527
|
+
|
|
528
|
+
## [0.1.0] - 2014-03-23
|
|
529
|
+
|
|
312
530
|
### Added
|
|
313
|
-
|
|
314
|
-
-
|
|
315
|
-
-
|
|
316
|
-
-
|
|
317
|
-
-
|
|
318
|
-
-
|
|
319
|
-
-
|
|
320
|
-
-
|
|
321
|
-
-
|
|
322
|
-
-
|
|
323
|
-
-
|
|
324
|
-
-
|
|
325
|
-
-
|
|
531
|
+
|
|
532
|
+
- Allow custom rendering policy via `Action#render` override. This bypasses the template lookup and rendering. (Luca Guidi)
|
|
533
|
+
- Introduced `Lotus::Presenter`. (Luca Guidi)
|
|
534
|
+
- Introduced templates rendering from templates and layouts. (Luca Guidi)
|
|
535
|
+
- Introduced partials rendering from templates and layouts. (Luca Guidi)
|
|
536
|
+
- Introduced layouts support. (Luca Guidi)
|
|
537
|
+
- Introduced `Lotus::View.load!` as entry point to load views and templates. (Luca Guidi)
|
|
538
|
+
- Allow to setup template name via `View.template`. (Luca Guidi)
|
|
539
|
+
- Rendering context also considers locals passed to the constructor. (Luca Guidi)
|
|
540
|
+
- Introduced `View.format` as DSL to declare which format to handle. (Luca Guidi)
|
|
541
|
+
- Introduced view subclasses as way to handle different formats (mime types). (Luca Guidi)
|
|
542
|
+
- Introduced multiple templates per each View. (Luca Guidi)
|
|
543
|
+
- Implemented basic rendering with templates. (Luca Guidi)
|
|
544
|
+
- Official support for Ruby 2.0. (Luca Guidi)
|
|
545
|
+
|
|
546
|
+
[0.1.0]: https://github.com/hanami/view/releases/tag/v0.1.0
|