Open Collective
Open Collective
Loading
Yii news 2021, issue 1
Published on March 4, 2021 by Alexander Makarov

Hello, community!

This is the first issue of Yii news in 2021. First months of the year were productive and resulted in Yii 3 package releases and significant progress in yet unreleased packages. We have improved our toolset, solved more issues and removed some packages. All that while trying to fix the problem with funding and taking care of Yii 2.

Foundation and team

Despite 2020 was way too crazy, it was alright for Yii. We have got agreements on extension of Yii 1.1 EOL in exchange of filling up the foundation and some more one-time alike agreements.

That, along with our beloved long-term supporters, allowed us to increase development speed by buying out more time of core team members. We did really well leveraging all the funds available.

I was excited about speedy development process way too much not taking a closer look at financial part and, in January I was surprised in a bad way. I totally forgot about non-recurring nature of big part of foundation income and the budget available was not enough. Not to make it too bad I, personally, have temporarily stopped invoicing the OpenCollective foundation (helped for it not to be a total disaster) and started to actively look for ways to partner with both Yii and PHP companies. Got mixed results so far but I hope that it will improve.

In case you want to talk about possible partnership, please do not hesitate to contact me at [email protected].

🔷 Yii 2

Yii 2.0.41 was released with the great effort of Paweł Brzozowski and invaluable Robert Korulczyk code reviews. Many hours were, as well, spent on security side of the framework. As a result, majority of current security reports were checked and release got security hardening.

🔶 Yii 3

🎁 First of all, package releases:

Each release means that documentation was written for a package readme, more tests were added, overall cleanup was performed and, of course, public API was stabilized enough.

Now, let's highlight interesting things since previous issue. For convenience changes will be grouped.

Arrays

  • ArrayHelper::pathExists() added.
  • ArrayHelper::group() added (it is an alias of ArrayHelper::index()).
  • Modifiers were removed.

Data

Data abstraction got the following changes:

Auth

Config plugin

After more effort to improve Composer config plugin was made, it became obvious that it is getting too complicated with AST, configs merging and everything that happens under the hood. Therefore, we have made it dependent on less yiisoft packages and, instead, developed a way simpler and performant alternative version.

All the application templates were switched to use it and there are likely bugs to be fixed and enhancements to be made.

Error handler

Error handler got some improvements:

Errors in general

  • yiisoft/yii-event package got a debug mode which makes it check all the listeners defined in the config at once and reporting errors right away.
  • DI container errors were improved to give more context.

Strings

  • NumericHelper::isInteger() was added.
  • NumericHelper::normalize() got support for booleans.
  • Wildcard matching was re-thought replacing many configuration options with a ** that matches anything including separators.

Var dumper

  • Proper PHP 8 support for edge cases.
  • VarDumper::dump() now highlights code by default.
  • VarDumper::asPhpString() was removed.
  • Yii debugger-specific code was moved to debugger package.
  • Closure export edge cases were fixed.
  • d() and dd() function are now automatically available when the package is installed.

Html

The package was significantly re-imagined. Two important changes are:

  1. Output is escaped by default.
  2. Tags are now separate objects created via Html static methods. For end user that means configuration is now done through methods that are auto-completed and verified in IDEs.

Validator

Lots of refactoring. Most notable changes are:

Forms

Translator

Significant amount of effort was put into the packages so now it is almost read for being released. You can check the docs in the package readme.

Mailer

Mailer and its SwiftMailer adapter were cleaned up and refactored very significantly. Docs were added. It will be ready for release as soon as its dependencies are ready.

DB and ActiveRecord

Both packages got some bugfixes and even more tests. Wilmer, who did most of migration job, already battle-tested it with a telegram bot having 120 thousand requests per day.

Both packages were originally ported from Yii 2 almost as is. Magic removed, types added, tests coverage went close to 100%. Despite getting better than they were in Yii 2, these packages are still close to Yii 2 design-wise and it is a hard decision whenever we should release first version in this state or do a huge refactoring first.

Likely it will be the former.

yii-web

User

User package got refactoring and rethinking:

We are still not entirely satisfied with the results so likely more changes will follow.

Bootstrap and Bulma

Cosnole

Console got an ability to add a command using custom name.

Debugger

Progress was made both on the frontend and API parts.

Docker

PHP 8 support was added to Docker support package.

Yii development tool

The tool was improved for working with part of the packages installed. Accuracy of dependency fixer was greatly improved, and a new command was added, release/what. It suggests what package to work on next. Priority is given to packages without unstable dependencies that are blocking most other package releases.

Application templates

📙 New and adjusted docs

📚 Reading recommendations, packages and other news

❤️ Thank you!

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

I have realized that we have never emphasized on what companies are sponsoring Yii development so here is the top sponsors list with brief descriptions.

There are individuals and other companies to be checked at OpenCollective page.

👍 Special thanks for Yii 3 code contributions goes to: