hanami-view 2.3.1 → 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 +399 -184
- 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 +5 -7
- 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 +62 -30
- metadata +14 -53
data/CHANGELOG.md
CHANGED
|
@@ -1,331 +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
|
|
6
45
|
|
|
7
46
|
### Fixed
|
|
8
47
|
|
|
9
48
|
- Pass through all input arguments when exposure procs receive a keyword splat. (@jaredcwhite in #269)
|
|
10
49
|
|
|
11
|
-
|
|
50
|
+
[2.3.1]: https://github.com/hanami/view/compare/v2.3.0...v2.3.1
|
|
51
|
+
|
|
52
|
+
## [2.3.0] - 2025-11-12
|
|
12
53
|
|
|
13
54
|
### Fixed
|
|
14
55
|
|
|
15
56
|
- Avoid warnings (from deprecated `URI::RFC3986_PARSER.extract`) in escape helper. (@timriley in #267)
|
|
16
57
|
|
|
17
|
-
|
|
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
|
|
18
61
|
|
|
19
62
|
### Changed
|
|
20
63
|
|
|
21
|
-
- 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
|
|
22
69
|
|
|
23
|
-
|
|
70
|
+
[2.3.0.beta1]: https://github.com/hanami/view/compare/v2.2.1...v2.3.0.beta1
|
|
24
71
|
|
|
25
|
-
##
|
|
72
|
+
## [2.2.1] - 2025-03-17
|
|
26
73
|
|
|
27
74
|
### Fixed
|
|
28
75
|
|
|
29
|
-
- 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)
|
|
30
77
|
|
|
31
|
-
|
|
78
|
+
[2.2.1]: https://github.com/hanami/view/compare/v2.2.0...v2.2.1
|
|
32
79
|
|
|
33
|
-
##
|
|
80
|
+
## [2.2.0] - 2024-11-05
|
|
34
81
|
|
|
35
|
-
|
|
82
|
+
[2.2.0]: https://github.com/hanami/view/compare/v2.2.0.rc1...v2.2.0
|
|
36
83
|
|
|
37
|
-
##
|
|
84
|
+
## [2.2.0.rc1] - 2024-10-29
|
|
85
|
+
|
|
86
|
+
[2.2.0.rc1]: https://github.com/hanami/view/compare/v2.2.0.beta2...v2.2.0.rc1
|
|
87
|
+
|
|
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
|
|
38
93
|
|
|
39
94
|
### Changed
|
|
40
95
|
|
|
41
|
-
- 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
|
|
42
99
|
|
|
43
|
-
##
|
|
100
|
+
## [2.1.0] - 2024-02-27
|
|
44
101
|
|
|
45
|
-
|
|
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
|
|
46
105
|
|
|
47
106
|
### Changed
|
|
48
|
-
- [Tim Riley] Remove unneeded concurrent-ruby gem dependency.
|
|
49
107
|
|
|
50
|
-
|
|
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
|
|
51
113
|
|
|
52
114
|
### Changed
|
|
53
|
-
- [Tim Riley] Remove `LayoutNotFoundError` and raise `TemplateNotFoundError` for all kinds of missing templates, including layouts.
|
|
54
115
|
|
|
55
|
-
|
|
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
|
|
56
121
|
|
|
57
122
|
### Fixed
|
|
58
|
-
- [Tim Riley] Include methods from helper modules as public (#242)
|
|
59
|
-
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.
|
|
60
|
-
This will allow an intermediary `helpers` object to be created for view parts (inside full Hanami apps) to access the standard helpers.
|
|
61
123
|
|
|
62
|
-
|
|
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
|
|
63
129
|
|
|
64
130
|
### Added
|
|
65
|
-
- [Luca Guidi] Add `Hanami::View::Rendered#match?`, `#match`, and `#include?` to make it more specs friendly.
|
|
66
|
-
- [Philip Arndt] Make `Hanami::View#call` to accept `layout:` keyword argument to specify the layout to use during the rendering.
|
|
67
131
|
|
|
68
|
-
|
|
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
|
|
69
138
|
|
|
70
139
|
### Added
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
`scope_builder` as the default class to use when no value-specific part or scope classes can be
|
|
78
|
-
found. These settings default to `Hanami::View::Part` and `Hanami::View::Scope` respectively (#227)
|
|
79
|
-
- [Tim Riley] Introduce `Hanami::View::Helpers::EscapeHelper`, `Hanami::View::Helpers::TagHelper`,
|
|
80
|
-
`Hanami::View::Helpers::LinkToHelper`, `Hanami::View::Helpers::NumberFormattingHelper`. These
|
|
81
|
-
helper modules may optionally be mixed into your Part and Scope classes to provide additional
|
|
82
|
-
conveniences when authoring your views. To do this by default, create your own
|
|
83
|
-
`Hanaim::View::Part` and `Hanami::View::Scope` subclasses that include these modules, and then
|
|
84
|
-
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)
|
|
85
146
|
|
|
86
147
|
### Changed
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
-
|
|
93
|
-
- [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
##
|
|
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
|
|
98
159
|
|
|
99
160
|
### Added
|
|
100
|
-
|
|
161
|
+
|
|
162
|
+
- Access a hash of template locals via accessing `locals` inside any template. (Tim Riley)
|
|
101
163
|
|
|
102
164
|
### Changed
|
|
103
|
-
- [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.
|
|
104
165
|
|
|
105
|
-
|
|
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
|
|
106
171
|
|
|
107
172
|
### Added
|
|
108
|
-
|
|
109
|
-
-
|
|
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)
|
|
110
176
|
|
|
111
177
|
### Changed
|
|
112
|
-
- [Sean Collins] For views within an Hanami application, changed default location for templates from "web/templates" to "templates"
|
|
113
|
-
- [Luca Guidi] For views within an Hanami application, the default `part_namespace` is now `"view/parts"` (previously `"views/parts"`)
|
|
114
178
|
|
|
115
|
-
|
|
116
|
-
-
|
|
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
|
|
117
189
|
|
|
118
|
-
## v2.0.0.alpha6 - 2022-02-10
|
|
119
190
|
### Added
|
|
120
|
-
|
|
191
|
+
|
|
192
|
+
- Official support for Ruby: MRI 3.0 and 3.1. (Luca Guidi)
|
|
121
193
|
|
|
122
194
|
### Changed
|
|
123
|
-
- [Luca Guidi] Drop support for Ruby: MRI 2.3, 2.4, 2.5, 2.6, and 2.7.
|
|
124
195
|
|
|
125
|
-
|
|
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
|
+
|
|
126
202
|
### Added
|
|
127
|
-
- [Marc Busqué] Automatically provide access to Hanami application routes helper as `routes` in default application view context (`Hanami::View::ApplicationContext`)
|
|
128
203
|
|
|
129
|
-
|
|
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
|
+
|
|
130
210
|
### Added
|
|
131
|
-
|
|
211
|
+
|
|
212
|
+
- Raise `LayoutNotFoundError` exception with friendlier, more specific error message when layouts cannot be found. (Pablo Vicente)
|
|
132
213
|
|
|
133
214
|
### Changed
|
|
134
|
-
- [Tim Riley] (Internal) Updated settings to use updated dry-configurable `setting` 0.13.0 API
|
|
135
215
|
|
|
136
|
-
|
|
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
|
+
|
|
137
222
|
### Changed
|
|
138
|
-
- [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.
|
|
139
223
|
|
|
140
|
-
|
|
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
|
+
|
|
141
230
|
### Added
|
|
142
|
-
- [Luca Guidi] Official support for Ruby: MRI 2.6
|
|
143
|
-
- [Luca Guidi] Support `bundler` 2.0+
|
|
144
231
|
|
|
145
|
-
|
|
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
|
|
146
242
|
|
|
147
|
-
## v1.3.0.beta1 - 2018-08-08
|
|
148
243
|
### Fixed
|
|
149
|
-
- [Ferdinand Niedermann] Ensure to set `:disable_escape` option only for Slim and don't let Tilt to emit a warning for other template engines.
|
|
150
|
-
- [glaszig] Ensure partial rendering to respect `format` overriding
|
|
151
244
|
|
|
152
|
-
|
|
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
|
+
|
|
153
252
|
### Added
|
|
154
|
-
|
|
253
|
+
|
|
254
|
+
- Introduced new, backward compatible, signature to render a layout for testing purposes (eg. `ApplicationLayout.new({ format: :html }, "contents").render`). (Luca Guidi)
|
|
155
255
|
|
|
156
256
|
### Fixed
|
|
157
|
-
- [Luca Guidi] Ensure layout to be rendered when using HAML 5
|
|
158
|
-
- [Luca Guidi] Ensure to raise `NoMethodError` when an unknown method is invoked by a view/template
|
|
159
257
|
|
|
160
|
-
|
|
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
|
|
270
|
+
|
|
271
|
+
## [1.2.0.rc1] - 2018-03-30
|
|
272
|
+
|
|
273
|
+
[1.2.0.rc1]: https://github.com/hanami/view/compare/v1.2.0.beta2...v1.2.0.rc1
|
|
161
274
|
|
|
162
|
-
##
|
|
275
|
+
## [1.2.0.beta2] - 2018-03-23
|
|
163
276
|
|
|
164
|
-
|
|
277
|
+
[1.2.0.beta2]: https://github.com/hanami/view/compare/v1.2.0.beta1...v1.2.0.beta2
|
|
165
278
|
|
|
166
|
-
##
|
|
279
|
+
## [1.2.0.beta1] - 2018-02-28
|
|
167
280
|
|
|
168
|
-
|
|
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
|
|
169
284
|
|
|
170
|
-
## v1.1.2 - 2018-04-10
|
|
171
285
|
### Fixed
|
|
172
|
-
- [Luca Guidi] Ensure to be able to use `exposures` even when they aren't duplicable objects
|
|
173
286
|
|
|
174
|
-
|
|
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
|
+
|
|
175
293
|
### Added
|
|
176
|
-
|
|
294
|
+
|
|
295
|
+
- Official support for Ruby: MRI 2.5. (Luca Guidi)
|
|
177
296
|
|
|
178
297
|
### Fixed
|
|
179
|
-
- [Alfonso Uceda] Ensure that `exposures` are properly overwritten for partials when `locals:` option is used
|
|
180
298
|
|
|
181
|
-
|
|
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
|
|
308
|
+
|
|
309
|
+
[1.1.0.rc1]: https://github.com/hanami/view/compare/v1.1.0.beta3...v1.1.0.rc1
|
|
310
|
+
|
|
311
|
+
## [1.1.0.beta3] - 2017-10-04
|
|
182
312
|
|
|
183
|
-
|
|
313
|
+
[1.1.0.beta3]: https://github.com/hanami/view/compare/v1.1.0.beta2...v1.1.0.beta3
|
|
184
314
|
|
|
185
|
-
##
|
|
315
|
+
## [1.1.0.beta2] - 2017-10-03
|
|
186
316
|
|
|
187
|
-
## v1.1.0.beta2 - 2017-10-03
|
|
188
317
|
### Added
|
|
189
|
-
- [Luca Guidi] Added `Hanami::Layout#local` to safely access locals from layouts
|
|
190
318
|
|
|
191
|
-
|
|
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
|
+
|
|
192
325
|
### Fixed
|
|
193
|
-
- [yjukaku] Raise `Hanami::View::UnknownRenderTypeError` when an argument different from `:template` or `:partial` is passed to `render`
|
|
194
326
|
|
|
195
|
-
|
|
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
|
+
|
|
196
333
|
### Added
|
|
197
|
-
- [Luca Guidi] Compatibility with `haml` 5.0
|
|
198
334
|
|
|
199
|
-
|
|
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
|
|
340
|
+
|
|
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
|
|
200
344
|
|
|
201
|
-
|
|
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
|
|
202
348
|
|
|
203
|
-
## v1.0.0.beta2 - 2017-03-17
|
|
204
349
|
### Changed
|
|
205
|
-
- [Luca Guidi] Remove deprecated `Hanami::View::Rendering::LayoutScope#content`
|
|
206
350
|
|
|
207
|
-
|
|
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
|
+
|
|
208
357
|
### Added
|
|
209
|
-
- [Luca Guidi] Official support for Ruby: MRI 2.4
|
|
210
|
-
- [Vladimir Dralo] Allow `View#initialize` to splat keyword arguments
|
|
211
358
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
|
215
365
|
|
|
216
366
|
### Changed
|
|
217
|
-
- [Luca Guidi] Official support for Ruby: MRI 2.3+ and JRuby 9.1.5.0+
|
|
218
367
|
|
|
219
|
-
|
|
220
|
-
### Added
|
|
221
|
-
- [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)
|
|
222
369
|
|
|
223
370
|
### Fixed
|
|
224
|
-
|
|
225
|
-
-
|
|
226
|
-
|
|
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)
|
|
227
381
|
|
|
228
382
|
### Changed
|
|
229
|
-
– [Luca Guidi] Drop support for Ruby 2.0 and 2.1. Official support for JRuby 9.0.5.0+.
|
|
230
|
-
– [Luca Guidi] Deprecate `#content` in favor of `#local`.
|
|
231
383
|
|
|
232
|
-
|
|
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
|
+
|
|
233
397
|
### Changed
|
|
234
|
-
|
|
398
|
+
|
|
399
|
+
- Preload partial templates in order to boost performances for partials rendering (2x faster). (Steve Hook)
|
|
235
400
|
|
|
236
401
|
### Fixed
|
|
237
|
-
- [Luca Guidi] Disable Slim autoescape to use `Hanami::View`'s feature
|
|
238
402
|
|
|
239
|
-
|
|
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
|
+
|
|
240
409
|
### Changed
|
|
241
|
-
- [Luca Guidi] Renamed the project
|
|
242
410
|
|
|
243
|
-
|
|
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
|
+
|
|
244
417
|
### Added
|
|
245
|
-
- [Luca Guidi] Added `Lotus::View::Configuration#default_encoding` to set the encoding for templates
|
|
246
418
|
|
|
247
|
-
|
|
248
|
-
- [Luca Guidi] Let exceptions to be raised as they occur in rendering context. This fixes misleading backtraces for exceptions.
|
|
249
|
-
- [Martin Rubi] Raise a `Lotus::View::MissingTemplateError` when rendering a missing partial from a template
|
|
250
|
-
- [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)
|
|
251
420
|
|
|
252
421
|
### Changed
|
|
253
|
-
- [Liam Dawson] Introduced `Lotus::View::Error` and let all the framework exceptions to inherit from it.
|
|
254
422
|
|
|
255
|
-
|
|
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
|
+
|
|
256
435
|
### Added
|
|
257
|
-
- [Luca Guidi] Autoescape for layout helpers.
|
|
258
436
|
|
|
259
|
-
|
|
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
|
+
|
|
260
443
|
### Fixed
|
|
261
|
-
- [Farrel Lifson] Force partial finder to be explicit when to templates have the same name.
|
|
262
444
|
|
|
263
|
-
|
|
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
|
+
|
|
264
451
|
### Fixed
|
|
265
|
-
- [Tom Kadwill] Ensure views to use methods defined by the associated layout.
|
|
266
452
|
|
|
267
|
-
|
|
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
|
+
|
|
268
459
|
### Added
|
|
269
|
-
- [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).
|
|
270
460
|
|
|
271
|
-
|
|
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
|
+
|
|
272
467
|
### Changed
|
|
273
|
-
|
|
274
|
-
-
|
|
468
|
+
|
|
469
|
+
- Autoescape concrete and virtual methods from presenters. (Luca Guidi)
|
|
470
|
+
- Autoescape concrete and virtual methods from views. (Luca Guidi)
|
|
275
471
|
|
|
276
472
|
### Fixed
|
|
277
|
-
- [Tom Kadwill] Improve error message for undefined method in view
|
|
278
|
-
- [Luca Guidi] Ensure that layouts will include modules from `Configuration#prepare`
|
|
279
473
|
|
|
280
|
-
|
|
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
|
+
|
|
281
481
|
### Added
|
|
282
|
-
|
|
283
|
-
-
|
|
284
|
-
-
|
|
285
|
-
-
|
|
286
|
-
-
|
|
287
|
-
-
|
|
288
|
-
-
|
|
289
|
-
-
|
|
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)
|
|
290
491
|
|
|
291
492
|
### Changed
|
|
292
|
-
|
|
493
|
+
|
|
494
|
+
- Raise an exception when a layout doesn't have an associated template. (Alfonso Uceda Pompa)
|
|
293
495
|
|
|
294
496
|
### Fixed
|
|
295
|
-
- [Luca Guidi] Ensure that concrete methods in layouts are available in templates
|
|
296
|
-
- [Luca Guidi] Ensure to associate the right layout to a view in case fo duplicated framework
|
|
297
|
-
- [Luca Guidi] Safe override of Ruby's top level methods in Scope. (Eg. use `select` from a view, not from `::Kernel`)
|
|
298
497
|
|
|
299
|
-
|
|
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
|
+
|
|
300
506
|
### Added
|
|
301
|
-
|
|
302
|
-
-
|
|
303
|
-
-
|
|
304
|
-
-
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
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)
|
|
308
515
|
|
|
309
516
|
### Changed
|
|
310
|
-
|
|
311
|
-
-
|
|
312
|
-
-
|
|
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)
|
|
313
521
|
|
|
314
522
|
### Fixed
|
|
315
|
-
- [Luca Guidi] Ensure outermost locals to not shadow innermost inside templates/partials
|
|
316
523
|
|
|
317
|
-
|
|
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
|
+
|
|
318
530
|
### Added
|
|
319
|
-
|
|
320
|
-
-
|
|
321
|
-
-
|
|
322
|
-
-
|
|
323
|
-
-
|
|
324
|
-
-
|
|
325
|
-
-
|
|
326
|
-
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
329
|
-
-
|
|
330
|
-
-
|
|
331
|
-
-
|
|
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
|