Twill just surpassed 10k installs and today, version 1.2.2 is available with a significant amount of improvements and bug fixes thanks to the efforts of 21 contributors: Amr Noman, Antoine Doury, Antonin Caudron, Antonio Carlos Ribeiro, Bram Mittendorff, Daniel Ramos, Dmitrii Larionov, Fernando Petrelli, Franca Winter, Gilbert Moufflet, Jarred Bishop, Lorren Gordon, Nikhil Trivedi, Pablo Barrios, Quentin Renard, Rafael Milewski, Ray Tri, Riaan Laubscher, Stevan Pavlović, Yanhao Li, Žiga Pavlin.
Glide support for local image rendering
Glide is an open source image rendering service that integrates well with Twill and Laravel. It is a self-hosted option for local development and/or production websites and apps that have limited needs for image resizing and cropping. For image-heavy production websites and apps, we still recommend Imgix or a similar third party service, or at least setting up a CDN on top of your images.
The media and file libraries
local endpoint type has also been completely reworked to work with Laravel default public storage location. Remember to run
php artisan storage:link locally and as part of your deployment process if you are using local uploads rather than S3.
To try out Glide on a fresh Twill app, it is as simple as updating 2 environment variables:
Of course, more configuration variables are available through the new
glide key of Twill's configuration. See the default configuration here.
Making repeaters happy again
Repeaters had a couple of issues that are now fixed in this release:
- repeaters in forms are now updating the initially created database record instead of needlessly creating a new record each time their parent model gets updated
- repeaters in blocks are now restored correctly when restoring a past revision
- medias and files fields support has been improved
Different images per language support
You can now globally enable the ability for your content editors to provide different images per language in the media form field using the
media_library.translated_form_fields configuration key (defaults to
false). The user experience is exactly the same as our other translatable field. When rendering in a template or API, you can fallback to the default language if no image has been selected for the current language.
Cleaning up internals
Lead by community member Stevan Pavlović, an effort to clean Twill internals begins with this release. Laravel helpers and facades are getting replaced by dependency injection or at least, for now, to avoid consequent breaking changes, by fully qualified imports.
And a lot more in the changelog below!
HOW TO UPDATE
To update, you will need to run
composer update in your project and then run the new Twill provided artisan command:
twill:update. This will generates new database migrations and invite you to migrate your database. Those new migrations are safe to run as they check for the existence (or inexistence) of tables and columns in your database before doing anything. If you are upgrading from an earlier version than
1.2, you will need to update your
composer.json file first:
NOTE ABOUT UPCOMING LARAVEL 6 AND SEMANTIC VERSIONING
Taylor Otwell also explained why v6 instead of v5.9 since the next release is not a paradigm shift for the framework: Laravel is adopting semantic versioning (
major.minor.patch) and for simplicity, we will make that shift as well.
Right now, Laravel and Twill are following romantic versioning (
paradigm.major.minor). This is why Twill 1.2.2 is not just about patches but new features and improvements too.
Moving forward, once Laravel 6 is released, a release with breaking changes will be considered major, which would mean Twill 2.0.0 right now. A release with new features would be 1.3.0, and patches would be 1.2.3.
You can start using Composer's caret version range (
^1.2.2) now if you'd like to benefit from new features without fearing breaking changes on your next
composer update! If you'd rather stick to a stricter way of requiring Twill versions (fair enough, we do that in Twill's npm dependencies for your own safety), you will have to update your
composer.json file to get new features rather than patches only.
- Local image rendering service using Glide
🖼(6e427fc, e878b9a, 2a54c03, 0e8adb8)
- Support for translated medias field and extra metadatas (d16386e, 484c3c1, e384dad, 5b28acf, 4db1ff4)
- Support for maxlength counter on WYSIWYG form fields (d6301ff, 93af391, c916e76)
- Support for block groups (57bed47)
- Configuration option to prefix s3 uploads (#290) (b85df5a)
- Helper to dump ready to use SQL queries (87e2050)
- Option to provide a custom static permalink under the form's title editor (f9c6ed7)
twill:updatecommand and new database migrations for 1.2.2 (b251ffa)
- Fix media and file local libraries: local disk is now defined automatically by Twill, and configured to work seamlessly with Glide (10b9cc7, 52cabe3, ff1add8, 10aa2c5, 876c93a)
- Fix repeaters issues with restoration, update, medias and files fields support (7ec4256, 6425a3f, c2703b2, 60a239b, 7e348f4)
- Fix #32: markdown based mail notifications breaking in host Laravel apps (c0239ad)
- Fix authorization gates conflicts (d2036f2, b08b121)
- Fix default Quill.js WYSIWYG theme rendering (e593ac6)
- Fix browser when a selected item is deleted (5e08513)
- Fix global search input misbehavior (31fef7c)
- Fix publish button label copy when publishing is not available (82ec2c8)
- Fix Twill dev script console errors by disabling host check in hot script (0707f5b)
- Fix Twill provided blocks validation rule (cc277f5)
- Fix support for custom app namespace (#280) (eb780a5)
- Fix canvas rendered cropped image no-cache hack (#261) (ebe4450)
- Fix S3 uploader signature function calls (#259) (41828cd)
- Fix missing header method exception in ValidateBackHistory middleware (#234) (2ee1080)
- Fix media metadata helper issues (1b07f49)
- Fix some documentation typos (df870b5, a6dda85)
- Fix some styling bugs (faa4f89, 77e4d2d)
- Fix dashboard settings: activity option was not used (f67ca2e)
- Twill's CLI now automatically format the provided module name to be valid:
Article, you name it, will now correctly generate file for an
articlesTwill module with the correct stub replacements. (3e5d6e9)
- Forms extensibility improvements (d2f4008, 7382c64, a06b7a8)
- Switch from push() to save() when creating/updating models (661e5cf)
- Add more Language code to label mappings (#299) (d842b44)
- Support more languages in frontend slugify function (2f65628)
- Improved support for Quill.js toolbar modules on the
wysiwygform field (e593ac6, ff9a831, 3f675d2)
- Improve support for translatable.use_property_fallback (15a9331)
- Use morphClass consistently in browsers (4ec38c2)
- Use module controller defined scopes when counting by status (56a2d3a)
- Code quality (replace helpers and facades by dependency injection when possible or fully qualified facades) (6f449ac, 89687c1, 9554a0c, b0a3297, 358ca41, 86192a1, 21068eb, d443309, 05bdfa2, 80a0f91, 5acb7f1, 49b2c66, 7625fb3, 1dea3d9, 6972435, d597f71, 1de922b, 37b4fd2, 6092fba, 6fe254a, 5044c8e, f9e2b5c, c9ef6b5, bcc7730, 2b3f6d3, df3650a, a6106b7, 6b5c49a, d80ef94, c889c11, 4f80c83, 6f4e9c9)