Updating For Beta 12
Beta 12 packs several new features for extension developers, but also continues our cleanup efforts which results in a few changes, so please read this guide carefully to find out whether your extensions are affected. We invested extra effort to introduce new functionality in a backward-compatible manner or first deprecate functionality before it will be removed in the next release, in line with our versioning recommendations.
tip
If you need help applying these changes or using new features, please start a discussion on the community forum or Discord chat.
Deprecations / Upcoming breaking changes
- Reminder: In previous versions of Flarum, an extensions' main file was named
bootstrap.php. This name will no longer be supported in the stable 0.1 release. Make sure your extension uses the nameextend.php. - PHP 7.1 support will be dropped in beta.13.
- Using library classes from the
Zendnamespace is now deprecated and will be removed in beta.13. Use theLaminasnamespace instead. See PR #1963. - The
Flarum\Util\Str::slug()method has been deprecated. UseIlluminate\Support\Str::slug()instead. - The
Flarum\Event\ConfigureMiddlewarehas been deprecated. We finally have a proper replacement - see "New Features" below. Therefore, it will be removed in beta.13. - If you implement the
Flarum\Mail\DriverInterface:- Returning a plain array of field names from the
availableSettings()method is deprecated, but still supported. It must now return an array of field names mapping to their type. See the inline documentation for more details. - Implement the
validate()method that will be required in beta.13. See its documentation. - Implement the
canSend()method that will be required in beta.13. See its documentation.
- Returning a plain array of field names from the
New Features
- New PHP extenders:
Flarum\Extend\Middlewareoffers methods for adding, removing or replacing middleware in our three middleware stacks (api, forum, admin). We also added documentation for this feature.Flarum\Extend\ErrorHandlinglets you configure status codes and other aspects of our error handling stack depending on error types or exception classes.
- JavaScript:
- The
flarum/components/Selectcomponent now supports adisabledprop. See PR #1978.
- The
Other changes / Recommendations
- The
TextFormatterlibrary has been updated to (at least) version 2.3.6. If you are using it (likely through our ownFlarum\Formatter\Formatterclass), we recommend scanning the library's changelog. - The JS
slug()helper from theflarum/utils/stringmodule should only be used to suggest slugs to users, not enforce them. It does not employ any sophisticated transliteration logic like its PHP counterpart.