@rails/ujs
Advanced tools
Comparing version 6.1.4 to 7.0.0-alpha1
380
CHANGELOG.md
@@ -1,237 +0,148 @@ | ||
## Rails 6.1.4 (June 24, 2021) ## | ||
## Rails 7.0.0.alpha1 (September 15, 2021) ## | ||
* The `translate` helper now passes `default` values that aren't | ||
translation keys through `I18n.translate` for interpolation. | ||
* Improves the performance of ActionView::Helpers::NumberHelper formatters by avoiding the use of | ||
exceptions as flow control. | ||
*Jonathan Hefner* | ||
*Mike Dalessio* | ||
* Don't attach UJS form submission handlers to Turbo forms. | ||
* `preload_link_tag` properly inserts `as` attributes for files with `image` MIME types, such as JPG or SVG. | ||
*David Heinemeier Hansson* | ||
*Nate Berkopec* | ||
* Allow both `current_page?(url_hash)` and `current_page?(**url_hash)` on Ruby 2.7. | ||
* Add `weekday_options_for_select` and `weekday_select` helper methods. Also adds `weekday_select` to `FormBuilder`. | ||
*Ryuta Kamizono* | ||
*Drew Bragg*, *Dana Kashubeck*, *Kasper Timm Hansen* | ||
* Add `caching?` helper that returns whether the current code path is being cached and `uncacheable!` to denote helper methods that can't participate in fragment caching. | ||
## Rails 6.1.3.2 (May 05, 2021) ## | ||
*Ben Toews*, *John Hawthorn*, *Kasper Timm Hansen*, *Joel Hawksley* | ||
* No changes. | ||
* Add `include_seconds` option for `time_field`. | ||
<%= form.time_field :foo, include_seconds: false %> | ||
# => <input value="16:22" type="time" /> | ||
## Rails 6.1.3.1 (March 26, 2021) ## | ||
Default includes seconds: | ||
* No changes. | ||
<%= form.time_field :foo %> | ||
# => <input value="16:22:01.440" type="time" /> | ||
This allows you to take advantage of [different rendering options](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time#time_value_format) in some browsers. | ||
## Rails 6.1.3 (February 17, 2021) ## | ||
*Alex Ghiculescu* | ||
* No changes. | ||
* Improve error messages when template file does not exist at absolute filepath. | ||
*Ted Whang* | ||
## Rails 6.1.2.1 (February 10, 2021) ## | ||
* Add `:country_code` option to `sms_to` for consistency with `phone_to`. | ||
* No changes. | ||
*Jonathan Hefner* | ||
* OpenSSL constants are now used for Digest computations. | ||
## Rails 6.1.2 (February 09, 2021) ## | ||
*Dirkjan Bussink* | ||
* No changes. | ||
* The `translate` helper now passes `default` values that aren't | ||
translation keys through `I18n.translate` for interpolation. | ||
## Rails 6.1.1 (January 07, 2021) ## | ||
* Fix lazy translation in partial with block. | ||
*Marek Kasztelnik* | ||
* Avoid extra `SELECT COUNT` queries when rendering Active Record collections. | ||
*aar0nr* | ||
* Link preloading keep integrity hashes in the header. | ||
*Étienne Barrié* | ||
* Add `config.action_view.preload_links_header` to allow disabling of | ||
the `Link` header being added by default when using `stylesheet_link_tag` | ||
and `javascript_include_tag`. | ||
*Andrew White* | ||
* The `translate` helper now resolves `default` values when a `nil` key is | ||
specified, instead of always returning `nil`. | ||
*Jonathan Hefner* | ||
* Adds option `extname` to `stylesheet_link_tag` to skip default | ||
`.css` extension appended to the stylesheet path. | ||
## Rails 6.1.0 (December 09, 2020) ## | ||
Before: | ||
* SanitizeHelper.sanitized_allowed_attributes and SanitizeHelper.sanitized_allowed_tags | ||
call safe_list_sanitizer's class method | ||
```ruby | ||
stylesheet_link_tag "style.less" | ||
# <link href="/stylesheets/style.less.scss" rel="stylesheet"> | ||
``` | ||
Fixes #39586 | ||
After: | ||
*Taufiq Muhammadi* | ||
```ruby | ||
stylesheet_link_tag "style.less", extname: false, skip_pipeline: true, rel: "stylesheet/less" | ||
# <link href="/stylesheets/style.less" rel="stylesheet/less"> | ||
``` | ||
* Change form_with to generate non-remote forms by default. | ||
*Abhay Nikam* | ||
`form_with` would generate a remote form by default. This would confuse | ||
users because they were forced to handle remote requests. | ||
* Deprecate `render` locals to be assigned to instance variables. | ||
All new 6.1 applications will generate non-remote forms by default. | ||
When upgrading a 6.0 application you can enable remote forms by default by | ||
setting `config.action_view.form_with_generates_remote_forms` to `true`. | ||
*Petrik de Heus* | ||
* Yield translated strings to calls of `ActionView::FormBuilder#button` | ||
when a block is given. | ||
* Remove legacy default `media=screen` from `stylesheet_link_tag`. | ||
*Sean Doyle* | ||
*André Luis Leal Cardoso Junior* | ||
* Alias `ActionView::Helpers::Tags::Label::LabelBuilder#translation` to | ||
`#to_s` so that `form.label` calls can yield that value to their blocks. | ||
* Change `ActionView::Helpers::FormBuilder#button` to transform `formmethod` | ||
attributes into `_method="$VERB"` Form Data to enable varied same-form actions: | ||
*Sean Doyle* | ||
<%= form_with model: post, method: :put do %> | ||
<%= form.button "Update" %> | ||
<%= form.button "Delete", formmethod: :delete %> | ||
<% end %> | ||
<%# => <form action="posts/1"> | ||
=> <input type="hidden" name="_method" value="put"> | ||
=> <button type="submit">Update</button> | ||
=> <button type="submit" formmethod="post" name="_method" value="delete">Delete</button> | ||
=> </form> | ||
%> | ||
* Rename the new `TagHelper#class_names` method to `TagHelper#token_list`, | ||
and make the original available as an alias. | ||
token_list("foo", "foo bar") | ||
# => "foo bar" | ||
*Sean Doyle* | ||
* ARIA Array and Hash attributes are treated as space separated `DOMTokenList` | ||
values. This is useful when declaring lists of label text identifiers in | ||
`aria-labelledby` or `aria-describedby`. | ||
* Change `ActionView::Helpers::UrlHelper#button_to` to *always* render a | ||
`<button>` element, regardless of whether or not the content is passed as | ||
the first argument or as a block. | ||
tag.input type: 'checkbox', name: 'published', aria: { | ||
invalid: @post.errors[:published].any?, | ||
labelledby: ['published_context', 'published_label'], | ||
describedby: { published_errors: @post.errors[:published].any? } | ||
} | ||
#=> <input | ||
type="checkbox" name="published" aria-invalid="true" | ||
aria-labelledby="published_context published_label" | ||
aria-describedby="published_errors" | ||
> | ||
<%= button_to "Delete", post_path(@post), method: :delete %> | ||
# => <form action="/posts/1"><input type="hidden" name="_method" value="delete"><button type="submit">Delete</button></form> | ||
*Sean Doyle* | ||
<%= button_to post_path(@post), method: :delete do %> | ||
Delete | ||
<% end %> | ||
# => <form action="/posts/1"><input type="hidden" name="_method" value="delete"><button type="submit">Delete</button></form> | ||
* Remove deprecated `escape_whitelist` from `ActionView::Template::Handlers::ERB`. | ||
*Sean Doyle*, *Dusan Orlovic* | ||
*Rafael Mendonça França* | ||
* Add `config.action_view.preload_links_header` to allow disabling of | ||
the `Link` header being added by default when using `stylesheet_link_tag` | ||
and `javascript_include_tag`. | ||
* Remove deprecated `find_all_anywhere` from `ActionView::Resolver`. | ||
*Andrew White* | ||
*Rafael Mendonça França* | ||
* The `translate` helper now resolves `default` values when a `nil` key is | ||
specified, instead of always returning `nil`. | ||
* Remove deprecated `formats` from `ActionView::Template::HTML`. | ||
*Jonathan Hefner* | ||
*Rafael Mendonça França* | ||
* Add `config.action_view.image_loading` to configure the default value of | ||
the `image_tag` `:loading` option. | ||
* Remove deprecated `formats` from `ActionView::Template::RawFile`. | ||
By setting `config.action_view.image_loading = "lazy"`, an application can opt in to | ||
lazy loading images sitewide, without changing view code. | ||
*Rafael Mendonça França* | ||
*Jonathan Hefner* | ||
* Remove deprecated `formats` from `ActionView::Template::Text`. | ||
* `ActionView::Helpers::FormBuilder#id` returns the value | ||
of the `<form>` element's `id` attribute. With a `method` argument, returns | ||
the `id` attribute for a form field with that name. | ||
*Rafael Mendonça França* | ||
<%= form_for @post do |f| %> | ||
<%# ... %> | ||
* Remove deprecated `find_file` from `ActionView::PathSet`. | ||
<% content_for :sticky_footer do %> | ||
<%= form.button(form: f.id) %> | ||
<% end %> | ||
<% end %> | ||
*Rafael Mendonça França* | ||
*Sean Doyle* | ||
* Remove deprecated `rendered_format` from `ActionView::LookupContext`. | ||
* `ActionView::Helpers::FormBuilder#field_id` returns the value generated by | ||
the FormBuilder for the given attribute name. | ||
*Rafael Mendonça França* | ||
* Remove deprecated `find_file` from `ActionView::ViewPaths`. | ||
*Rafael Mendonça França* | ||
* Require that `ActionView::Base` subclasses implement `#compiled_method_container`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated support to pass an object that is not a `ActionView::LookupContext` as the first argument | ||
in `ActionView::Base#initialize`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated `format` argument `ActionView::Base#initialize`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated `ActionView::Template#refresh`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated `ActionView::Template#original_encoding`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated `ActionView::Template#variants`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated `ActionView::Template#formats`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated `ActionView::Template#virtual_path=`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated `ActionView::Template#updated_at`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated `updated_at` argument required on `ActionView::Template#initialize`. | ||
*Rafael Mendonça França* | ||
* Make `locals` argument required on `ActionView::Template#initialize`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated `ActionView::Template.finalize_compiled_template_methods`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated `config.action_view.finalize_compiled_template_methods` | ||
*Rafael Mendonça França* | ||
* Remove deprecated support to calling `ActionView::ViewPaths#with_fallback` with a block. | ||
*Rafael Mendonça França* | ||
* Remove deprecated support to passing absolute paths to `render template:`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated support to passing relative paths to `render file:`. | ||
*Rafael Mendonça França* | ||
* Remove support to template handlers that don't accept two arguments. | ||
*Rafael Mendonça França* | ||
* Remove deprecated pattern argument in `ActionView::Template::PathResolver`. | ||
*Rafael Mendonça França* | ||
* Remove deprecated support to call private methods from object in some view helpers. | ||
*Rafael Mendonça França* | ||
* `ActionView::Helpers::TranslationHelper#translate` accepts a block, yielding | ||
the translated text and the fully resolved translation key: | ||
<%= translate(".relative_key") do |translation, resolved_key| %> | ||
<span title="<%= resolved_key %>"><%= translation %></span> | ||
<%= form_for @post do |f| %> | ||
<%= f.label :title %> | ||
<%= f.text_field :title, aria: { describedby: f.field_id(:title, :error) } %> | ||
<%= tag.span("is blank", id: f.field_id(:title, :error) %> | ||
<% end %> | ||
@@ -241,106 +152,11 @@ | ||
* Ensure cache fragment digests include all relevant template dependencies when | ||
fragments are contained in a block passed to the render helper. Remove the | ||
virtual_path keyword arguments found in CacheHelper as they no longer possess | ||
any function following 1581cab. | ||
* Add `tag.attributes` to transform a Hash into HTML Attributes, ready to be | ||
interpolated into ERB. | ||
Fixes #38984. | ||
<input <%= tag.attributes(type: :text, aria: { label: "Search" }) %> > | ||
# => <input type="text" aria-label="Search"> | ||
*Aaron Lipman* | ||
*Sean Doyle* | ||
* Deprecate `config.action_view.raise_on_missing_translations` in favor of | ||
`config.i18n.raise_on_missing_translations`. | ||
New generalized configuration option now determines whether an error should be raised | ||
for missing translations in controllers and views. | ||
*fatkodima* | ||
* Instrument layout rendering in `TemplateRenderer#render_with_layout` as `render_layout.action_view`, | ||
and include (when necessary) the layout's virtual path in notification payloads for collection and partial renders. | ||
*Zach Kemp* | ||
* `ActionView::Base.annotate_rendered_view_with_filenames` annotates HTML output with template file names. | ||
*Joel Hawksley*, *Aaron Patterson* | ||
* `ActionView::Helpers::TranslationHelper#translate` returns nil when | ||
passed `default: nil` without a translation matching `I18n#translate`. | ||
*Stefan Wrobel* | ||
* `OptimizedFileSystemResolver` prefers template details in order of locale, | ||
formats, variants, handlers. | ||
*Iago Pimenta* | ||
* Added `class_names` helper to create a CSS class value with conditional classes. | ||
*Joel Hawksley*, *Aaron Patterson* | ||
* Add support for conditional values to TagBuilder. | ||
*Joel Hawksley* | ||
* `ActionView::Helpers::FormOptionsHelper#select` should mark option for `nil` as selected. | ||
```ruby | ||
@post = Post.new | ||
@post.category = nil | ||
# Before | ||
select("post", "category", none: nil, programming: 1, economics: 2) | ||
# => | ||
# <select name="post[category]" id="post_category"> | ||
# <option value="">none</option> | ||
# <option value="1">programming</option> | ||
# <option value="2">economics</option> | ||
# </select> | ||
# After | ||
select("post", "category", none: nil, programming: 1, economics: 2) | ||
# => | ||
# <select name="post[category]" id="post_category"> | ||
# <option selected="selected" value="">none</option> | ||
# <option value="1">programming</option> | ||
# <option value="2">economics</option> | ||
# </select> | ||
``` | ||
*bogdanvlviv* | ||
* Log lines for partial renders and started template renders are now | ||
emitted at the `DEBUG` level instead of `INFO`. | ||
Completed template renders are still logged at the `INFO` level. | ||
*DHH* | ||
* ActionView::Helpers::SanitizeHelper: support rails-html-sanitizer 1.1.0. | ||
*Juanito Fatas* | ||
* Added `phone_to` helper method to create a link from mobile numbers. | ||
*Pietro Moro* | ||
* annotated_source_code returns an empty array so TemplateErrors without a | ||
template in the backtrace are surfaced properly by DebugExceptions. | ||
*Guilherme Mansur*, *Kasper Timm Hansen* | ||
* Add autoload for SyntaxErrorInTemplate so syntax errors are correctly raised by DebugExceptions. | ||
*Guilherme Mansur*, *Gannon McGibbon* | ||
* `RenderingHelper` supports rendering objects that `respond_to?` `:render_in`. | ||
*Joel Hawksley*, *Natasha Umer*, *Aaron Patterson*, *Shawn Allen*, *Emily Plummer*, *Diana Mounter*, *John Hawthorn*, *Nathan Herald*, *Zaid Zawaideh*, *Zach Ahn* | ||
* Fix `select_tag` so that it doesn't change `options` when `include_blank` is present. | ||
*Younes SERRAJ* | ||
Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actionview/CHANGELOG.md) for previous changes. | ||
Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/actionview/CHANGELOG.md) for previous changes. |
{ | ||
"name": "@rails/ujs", | ||
"version": "6.1.4", | ||
"version": "7.0.0-alpha1", | ||
"description": "Ruby on Rails unobtrusive scripting adapter", | ||
@@ -5,0 +5,0 @@ "main": "lib/assets/compiled/rails-ujs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35907
1