Skip to content

Releases: hotwired-laravel/turbo-laravel

1.6.0

18 Sep 18:34
a7c34ab
Compare
Choose a tag to compare

Changelog

  • NEW: The response macro now has return types which should help out autocompletion on some IDEs or when using the Laravel IDE Helper - by @nielsbauman (PRs #84 and #85)
  • NEW: We now support targeting multiple elements on Turbo Streams by @timvdalen. See documentation (#86)
  • NEW: On top of the multiple targets work mentioned above, we now have new appendAll(), prependAll(), updateAll(), replaceAll(), removeAll(), beforeAll, and afterAll methods that take a CSS class selector and the content (which can be a string, a View instance, or an instance of the HtmlSafe class) see the documentation - by @tonysm (#87)
  • NEW: You may create turbo streams responses or tags now using the new turbo_stream() and turbo_stream_view() helper functions. These ship as namespaced functions under the Tonysm\TurboLaravel namespace, but also as globally available functions (easier to use them in contexts like Blade views, for instance). These work the same as the Response::turboStream() and Response::turboStreamView() macros (in fact, the macros now use them), they are just shorter. Suggested by @bilogic implemented by me @tonysm. See the documentation (#92)
  • REMOVED: The --stimulus option was removed from the turbo:install command. It now only has the --jet for Jetstream installs and --alpine for Breeze installs. I'm working on a new package called Stimulus Laravel for the folks using Stimulus out there.

You may also have noticed that I am moving the documentation content to markdown files inside the docs/ folder. That's because I'm working on a new website where the docs will be hosted (and some more stuff I'm working on). So I'll keep the docs in the readme and inside the docs/ folder for now, but once it's ready, we'll only have them inside the docs/ folder.

Internal Breaking Changes

Some method signatures were changed to accommodate the new multiple targets behavior. We could have introduced the new targets attribute at the end method signature as nullable, but I've decided to change the order of the parameters, so the target and targets are closer to each other. Technically, this is a breaking change if you're extending BroadcastAction job class or manually creating these jobs. I didn't want to tag a major version because of this as I'm not aware of folks extending the internals of the package. If you do have an issue with that, please stick to the 1.5.x version and let me know.

This doesn't affect applications using the package normally, just those more advanced scenarios where folks are extending the internals here.

The signature changes were made to these classes:

1.5.1

03 Jul 00:12
c769ecb
Compare
Choose a tag to compare

Changelog

  • FIXED: Fixed the regex pattern to match the bootstrap JS import in the app.js

1.5.0

03 Jul 00:10
958cd1c
Compare
Choose a tag to compare

Changelog

  • CHANGED: The turbo:install command was broken since the new frontend change in Laravel. This version adapts the command to the new setup and keeps it working on old Laravel installs that use Mix. It works with Importmap Laravel as well, of course.

1.4.1

20 Jun 13:15
44f8028
Compare
Choose a tag to compare

Changelog

  • FIXED: Support to Laravel 8 was dropped without a major version bump, so I brought it back (#77)

1.4.0

19 Jun 00:35
b039398
Compare
Choose a tag to compare

Changelog

  • NEW: Added the Turbo Native Navigation routes for parity with the turbo-rails gem (docs and PR)

1.3.0

17 Jun 21:35
3937a8c
Compare
Choose a tag to compare

Changelog

  • NEW: The shorthand methods for building Turbo Streams all now accept either a model instance or a string as the first parameter to be used to derive the target. Optionally, you may pass a content variable to be rendered inside the Turbo Stream, which can be a string, an View instance, or an instance of a carefully handcrafted HtmlString (#74 and docs).
  • NEW: Documented the issue with Laravel's url()->previous() and Turbo Frames (docs)
  • BC: The channel name generated for a newly created model using the auto-broadcast feature was previously that model's broadcasting channel based on Laravel's conventions. However, no user will ever be listening on that channel (since the model was just created), so we're now defaulting to the basename of the model's class in plural, so if you have a model named App\Models\Comment, broadcasts for the newly created models will be sent to a private comments channel by default. You may specify the stream option in the $broadcasts property. The existing $broadcastTo property or broadcastTo() methods will have precedence over this (#74).
  • BC: The before and after shorthand stream builders were previously accepting a model instance and a target string. Now, the first parameter can be either a model instance of a string which will be used to derive the target of the Turbo Stream. Just like the other shorthand methods, you may also pass a string, a view, or an HtmlString instance as the second parameter for the content of the Turbo Stream. Without the content, you must specify the view/partial to render inside the Turbo Stream, otherwise an exception will be thrown. I consider this change a fix (#74)

Note: I consider both BC changes fixes, so I'm not tagging a major release. If you're relying on the previous behavior, take a closer look at the documentation and make the changes when you upgrade!

1.2.0

15 Jun 01:05
ee2c2ed
Compare
Choose a tag to compare

Changelog

  • NEW: new optional --alpine flag to the turbo:install command for when you want to install Alpine in a non-Jetstream context (maybe you're more into Breeze)
  • CHANGED: the turbo:install command now detects when you're using Importmap Laravel and installs the dependencies there accordingly instead of always assuming NPM

1.1.0

09 Feb 01:33
b258533
Compare
Choose a tag to compare

Changelog

  • CHANGED: Laravel 9 support

1.0.0

22 Dec 02:47
3e4ddaf
Compare
Choose a tag to compare

The first 1.0 release is here!! 🎉🎉🎉

Changelog

  • CHANGED: The Laravel Echo setup was commented out by default as users will likely not have the backend WS part of it set up when doing a fresh install of the package. Having it not commented out was only going to generate errors in the DevTools. So instead, it's now mentioned in the documentation to uncomment the Laravel Echo when setting up that part. Thanks to Espen Kristensen for the idea on Twitter.
  • CHANGED: The route guessing code was simplified quite a bit. Thanks to @sleicester. #42
  • NEW: There are now three new Blade components: <x-turbo-frame>, <x-turbo-stream>, and <x-turbo-stream-from> which can simplify using the custom HTML Elements a bit and also potentially improve the autocompletion part for IDEs since some can detect Blade components defined in packages. By @tonysm #41

0.18.0

11 Nov 02:56
44e2874
Compare
Choose a tag to compare

Changelog

  • FIXED: the previous way to opt-out of auto-wiring the Turbo middleware should was previously using a Facade and now it's using a config key