New features extract!
, partial!
, and test improvments.
Fix issue with locals referring to an earlier item when using it in collections.
Fix issue with send_data
not working due to the layout_patch
not accounting for
inline templates.
Revert the removal of virtual_path_of_template, and renamed it to
active_template_virtual_path
. The reason for the removal was because we tried
to replace it with "#{controller_path}/#{action_name}" in superglue for the
component identifier, but that proved a bit too hairy. We also expose the
method to all other template types as well, as using @virtual_path on HTML erbs
from the view seemed too private.
- PropsTemplate no longer adds a virtual_path_of_template method to your views.
This is used by Superglue's generated
application.json.props
. This is a backward breaking change. To migrate, simply change thecomponentIdentifer
in yourapplication.json.props
and update thepage_to_page_mapping.js
accordingly.
json.componentIdentifier "#{controller_path}/#{action_name}"
- PropsTemplate will no longer automatically
camelize(:lower)
on keys. Instead, be explicit about the keys we're serializing.
For example: json.currentUser
instead of json.current_user
. This
is backward breaking. To retain the current behavior, you can do this:
module PropsTemplateOverride
def format_key(key)
@key_cache ||= {}
@key_cache[key] ||= key.camelize(:lower)
@key_cache[key]
end
def result!
result = super
@key_cache = {}
result
end
::Props::BaseWithExtensions.prepend self
end
- Turn the local assigns
virtual_path_of_template
that didn't work into a method on the view
- Fix #1 issues templates without layouts were not rendering
- Refactor layout_patch to make a less invasive monkey patch
- Add ruby standard
- Add CONTRIBUTING.md
- Add support for Rails 7
- rename bzq to props_at
- Added testing for Ruby 3.0
- Moved PropsTemplate to own repo
- Use version.rb instead of VERSION file.