Skip to content

Releases: dry-rb/dry-view

v0.7.1

08 Feb 11:52
Compare
Choose a tag to compare

Fixed

  • Template not found errors properly show configured paths (@adam12 in #144)

Changed

  • Compatible with Ruby 2.7/3.0 keyword argument handling (@flash-gordon in 4e7cefb)
  • dry-equalizer dependency dropped in favor of dry-core (@solnic)

Compare v0.7.0...v0.7.1

v0.7.0

05 Mar 22:48
Compare
Choose a tag to compare

0.7.0 / 2019-03-06

Added

  • Raise a Dry::View::UndefinedConfigError when a view is called but no paths have been configured (timriley in #130)

Changed

  • [BREAKING] Move Dry::View::Renderer::TemplateNotFoundError to Dry::View::TemplateNotFoundError (timriley in #130)
  • [BREAKING] Dry::View::UndefinedConfigError is raised instead of Dry::View::UndefinedTemplateError when a view is called but no template has been configured (timriley in #130)
  • Stop searching upwards through parent directories when rendering a view's template (as opposed to partials) (timriley in #130)
  • Stop searching in shared/ subdirectories when rendering a view's template (as opposed to partials) (timriley in #130)
  • Adjust template lookup cache keys to ensure no false hits (timriley in #130)

Fixed

  • Avoid a SystemStackError when a view is configured with a template that cannot be found on the filesystem (timriley in #129)

Compare v0.6.0...v0.7.0

v0.6.0

12 Feb 11:23
Compare
Choose a tag to compare

0.6.0 / 2019-01-30

Added

  • [BREAKING] Dry::View#call now returns a Dry::View::Rendered instance, which carries both the rendered output (accessible via #to_s or #to_str) as well as all of the view's locals, wrapped in their view parts (accessible via #locals or individually via #[]) (timriley in #72)
  • [BREAKING] Added Dry::View::PartBuilder (renamed from Dry::View::Decorator), which resolves part classes from a namespace configured via View's part_namespace setting. A custom part builder can be specified via a View's part_builder setting. (timriley in #80)
  • [BREAKING] Context classes can now declare decorated attributes just like part classes, via .decorate class-level API. Context classes are now required to inherit from Dry::View::Context. Dry::View::Context provides a #with method for creating copies of itself while preserving the rendering details needed for decorated attributes to work (timriley in #89 and #91)
  • Customizable scope objects, which work like view parts, but instead of encapsulating a single value, they encapsulate a whole template or partial and all of its locals. Scopes can be created via #scope method in templates, parts, as well as scope classes themselves. Scope classes are resolved via a View's scope_builder setting, which defaults to an instance of Dry::View::ScopeBuilder.
  • Added inflector setting to View, which is used by the part and scope builders to resolve classes for a given part or scope name. Defaults to Dry::Inflector.new (timriley in #80 and #90)
  • Exposures can be sent to the layout template when defined with layout: true option (GustavoCaso in #87)
  • Exposures can be left undecorated by a part when defined with decorate: false option (timriley in #88)
  • Part classes have access to the current template format via a private #_format method (timriley in #118)
  • Added "Tilt adapter" layer, to ensure a rendering engine compatible with dry-view's features is being used. Added adapters for "haml" and "erb" templates to ensure that "hamlit-block" and "erbse" are required and used as engines (unlike their more common counterparts, both of these engines support the implicit block capturing that is a central part of dry-view rendering behaviour) (timriley in #106)
  • Added renderer_engine_mapping setting to View, which allows an explicit engine class to be provided for the rendering of a given type of template (e.g. config.renderer_engine_mapping = {erb: Tilt::ErubiTemplate}) (timriley in #106)

Changed

  • [BREAKING] Dry::View::Controller renamed to Dry::View (timriley in #115)
  • [BREAKING] Dry::View context setting renamed to default_context (GustavoCaso in #86)
  • Exposure values are wrapped in their view parts before being made available as exposure dependencies (timriley in #80)
  • Exposures can access current context object through context: block or method parameter (timriley in #119)
  • Improved performance due to caching various lookups (timriley and GustavoCaso in #97)
  • Part#inspect output simplified to include only name and value (timriley in #98)
  • Attribute decoration in Part now achieved via a prepended module, which means it is possible to decorate an attribute provided by an instance method directly on the part class, which wasn't possible with the previous method_missing-based approach (timriley in #110)
  • Part classes can be initialized with missing name: and rendering: values, which can be useful for unit testing Part methods that don't use any rendering facilities (timriley in #116)

Fixed

  • Preserve renderer options when chdir-ing (timriley in 889ac7b)

Compare v0.5.3...v0.6.0

0.5.3

21 Oct 22:18
Compare
Choose a tag to compare

0.5.3 / 2018-10-22

Added

  • renderer_options setting for configuring tilt-based renderer (liseki in #62)

Changed

  • Part objects wrap values more transparently, via added #respond_to_missing? (liseki in #63)

0.5.2

12 Jun 23:11
Compare
Choose a tag to compare

0.5.2 / 2018-06-13

Changed

  • Only truthy view part attributes are decorated (timriley)

Compare v0.5.0...v0.5.1

0.5.1

19 Feb 23:11
Compare
Choose a tag to compare

Added

  • Exposures are inherited from parent view controller classes (GustavoCaso)

Compare v0.5.0...v0.5.1

0.5.0 / 2018-01-23

0.5.0

23 Jan 11:59
Compare
Choose a tag to compare

Added

  • Support for parts with decorated attributes (timriley + GustavoCaso)
  • Ability to easily create another part instance via Part#new (GustavoCaso)

Compare v0.4.0...v0.5.0