Friday, July 8, 2016

🌵 This Wild Week in Rails 🌵: Rails 4.2.7/4.1.16, new tag helpers syntax and more!

Posted by jonatack

Hola desperados!

Jon (aka Juan el bandido) here saying “Howdy” from the Navarro desert near Pamplona 🇪🇸 to bring you outlaws a back-slappin’ sagebrush issue of This Wild Week in Rails 🌵.

We’ll be covering a selection of the past 2 weeks’ commits. That’s a dadgummit lotta ground to cover, so pack a saddlebag o’ water, watch out fer rattlesnakes, and dontcha hesitate to click through to the pull requests for more info!

Giddyup!

This Week’s Rails Contributors

Let rip some proper hootin’ & hollerin’ fer these 38 heroic wranglerswho contributed to Rails this week, including 8 first-timers! Check out the current issues and the contributing guide if ye’d like to join ‘em!

Rails 4.2.7.rc1 and 4.1.16.rc1 released, gold fever ensues

These two release candidates hit the trail this week. The final release of Rails 4.1.16 should be on its way shortly if no regressions are found. It will probably be the last release of Rails 4.1, so please take some time soon to upgrade your application to Rails 4.2 or Rails 5.

New syntax for Action View tag helpers

Building on an implementation proposal by DHH, new syntactical sugar has been introduced for tag helpers that supports HTML5 markup by default and avoids positional parameters. See the PR for details and code examples as well as #25289 for the groundwork and discussion.

Updated and improved Rails Guides

Many vital documentation contributions were made these past 2 weeks, including completion of the Rails Testing Guide (yeehaw!) and updates for Rails 5.

Improved

Cleaner, simpler stack traces

Scheduled for Rails 5.1, this commit aims to clean up noisy stack traces and log only the traces relevant to the developer. The discussion in the PR and in #25343 is worth reading.

Update Action View tag helpers attributes

This commit brings the boolean attributes for the Action View tag helpers up to date with the current w3.org spec, while dropping autobuffer in favor of preload and removing pubdate.

Raise on nested time travel helpers

Nested time travel calls in tests can lead to confusion in time stubbing. To discourage this practice, Rails now raises on nested travel and travel_to time helper calls.

Fixed

Use correct timezone when parsing dates in json

Time specified in ISO 8601 format without Z should be parsed as local time, yet until now it was treated as UTC. This commit fixes the problem by parsing time using the timezone specified in the application config. Additionally, YYYY-MM-DD format is now parsed as Date , not DateTime as it was until now.

Ported to Rails 5-0-stable since this is a potential breaking change.

Routes using as option now work with GET requests

This fix adds the option to the end of the URL path rather than the query params. The PR discussion contains an example of checking impact on performance and working around it. Backported to 5-0-stable.

Don’t reap reassigned connections

This fix ensures that concurrent invocations of the connection reaper cannot allocate the same connection to two threads. Backported to 5-0-stable.

Fix race condition with websocket stream writes

ActionCable::Connection::Stream now safeguards against concurrent writes to a websocket connection from multiple threads. Backported to 5-0-stable.

Close hijacked I/O socket after use

ActionCable::Connection::Stream now properly closes hijacked sockets when the connection was shut down. Backported to 5-0-stable.

Fix adding implicitly-rendered template digests to ETags

Modifying an implicitly-rendered template for a controller action using fresh_when or stale? now correctly results in a new ETag value.

Fix Type::Date#serialize to consistently return a date object

Type::Date#serialize now properly casts values to date objects when making where and find queries on a date field. Backported to 5-0-stable.

New

New middleware for debugging reloading/executing deadlocks

Backported to 5-0-stable, this PR adds new ActionDispatch::DebugLocks middleware that can be used to diagnose deadlocks in the autoload interlock.

Enable using rake notes with other directories

Developers and gems can now use rake notes to extract notes from other directories (like /spec) by registering them with the SourceAnnotationExtractor.

Wrappin’ Up, Ye Saddle Bums

Luddy Mussy, ah’m all sewn up! That’s all for This Wild Week in Rails 🌵. Der wuz more improvements than we had room to cover here, so doncher hesitate to check ‘em out!

‘Til next week, amigos!