Yii news 2020, issue 7

Published on November 11, 2020 by Alexander Makarov
Admin

Hello everyone! It is another issue of Yii news. As usual, we have Yii 2 releases, Yii 3 updates, important Yii 1 updates and other news. Have a good read and stay healthy. - Alexander Makarov

Foundation

Since last time I had to spend some time taking care about the foundation. Notable, the way funds are transferred from GitHub Sponsors to OpenCollective. They went from GitHub alright but where to was a big question. It took time to figure it out but now it's solved.

Another foundation-related thing is that the author of httpsoft/http-message, Evgeniy Zyubin, will likely join the team full-time to speed things up if/when I'll find extra funds for it.

Infrastructure

We're constantly improving testing process of all the packages:

  • Added Roave backwards compatibility check to packages with stable versions. It verifies that public API is not broken compared to the latest stable version.
  • We are further moving from Travis to GitHub actions for both Yii 2 and Yii 3. They proved to be awesome and Travis recently cut OpenSource support, so it is great we have started early.
  • We decided not to send coverage from PHPUnit to Scrutinizer CI anymore but generate it with Scrutinizer itself. It is way faster with the same result.
  • Psalm proved to be very useful. Highly recommend it for your projects as well.
  • Colors were added to GitHub actions console. Looks way better!

A few adjustments were made to the website. Mostly these are GitHub API deprecation fixes and minor frontend adjustments.

Yii 2 and Yii 1 PHPUnit compatibility patches were extracted into separate repository so in case you need to test your application on PHP 5.3 - PHP 8 range, these will be handy.

🔷 Yii 1

🔷 Yii 2

Yii 2.0.39 was released enhancing dependency injection container and fixing more PHP 8 compatibility issues.

From the less visible improvements, we've changed the way annotations are generated for magic properties so now some IDEs, including PhpStorm, will recognize read-only and write-only properties.

The following extensions were released as well:

🔶 Yii 3

The following package releases were made since last time:

Overall plan is to prepare the packages listed in this Trello card.

There are multiple interesting decisions:

  • All stable releases will start with 1.0.0. Previously a variant of starting with 3.0.0 was discussed.
  • Yii 3.0 packages will support PHP 7.4.
  • Default configurations were added to majority of packages. Most will work without any extra configuration or with minimal of configuration.
  • Configuration providers are mostly removed from packages and apps.

There is a Trello board with tasks we're working on including ones not reflected in GitHub issues.

Nearly every package received cleanup, PHP 8 compatibility and bug fixes. Below are some selected highlights.

New packages

Some new packages were created both as a result of extracting common parts of existing packages and new ideas.

Development tool

  • Dependencies were revised and Dockerfile was added.
  • Ability to semi-automatic release tagging was implemented.

Composer config plugin

Temporary PHP 8 support was added. It's not the same as our AST effort and is meant to ease checking things for PHP 8 while we're finishing AST version.

Container and factory

Cache

Bulma

  • More docs, better naming.
  • Added ability to use icons in dropdown menu.
  • All widgets were made immutable.

Router

  • Router internals and configuration were both made simpler by extracting routes collection into separate class.
  • UrlMatcherInterface::getLastMatchedRequest() was removed and getCurrentUri() was added.
  • UrlMatcher is now optional which is handy for console applications.

Application templates and demo

  • NodeJs is no more required. Assets are fetched from asset packagist.
  • Configs were significantly cleaned up. In the app, they were split per-package.
  • Self-referencing container definition hack was removed.
  • Swagger was added to yii-demo. It can be accessed via /swagger.
  • Multiple refactorings were made in yii-demo.
  • yii-demo PSR-7 implementation was switched to httpsoft/http-message.

Var dumper

Files

Cycle

  • File schema is now writeable and supports multiple files to read from.
  • Our own DI container / factory are now used so Cycle integration is now PHP 8 compatible.

Data

DBAL and ActiveRecord

Both DBAL and ActiveRecord ported from Yii 2 have lots of refactoring to be done despite functionally they were significantly cleaned up and mostly work.

Arrays

HTML

Debugger

Queue

Translator

i18n packages were deprecated, translator packages were introduced with adjusted design.

📙 New and adjusted docs

📚 Reading recommendations and other news

❤️ Thank you!

I'd like to thank all backers and contributors making Yii 3 possible. We are moving it forward together.

👍 Special thanks for Yii 3 code contributions goes to: