How to properly update Nette

about a month ago by David Grudl  

“Nette is perfectly backward compatible. Switching from Nette 0.9 to 2.4 took me one afternoon on a relatively large application. That was a great result!” said one satisfied user. Here are some tips on how to update your project to the latest version of Nette.

Step up each version

I.e. first upgrade to Nette 2.3, then 2.4, then 3.0. The reason is that if something is changed or removed from Nette, it happens in successive steps in several years. At first, the stuff is only marked as deprecated in the code (silently deprecated), so you may notice ie. strikethrough the name of the method in the editor, in the next bigger version it emits the message E_USER_DEPRECATED, but the functionality is preserved, and only in the third version is it removed.

Nette tries to make those deprecation messages as clear and intuitive as possible (eg Syntax {!$var} is deprecated, use {$var|noescape} on line 123) to make it easy to update code.

If you skip multiple versions, you might lose this important phase.

Get started without E_USER_DEPRECATED

Before testing the new version, you should first disable the E_USER_DEPRECATED error messages:

$configurator->enableDebugger();
error_reporting(~E_USER_DEPRECATED); // after starting Tracy; and note ~

Now you can test if everything works as it should without warning you about the deprecated things. If everything works, re-enable warnings and edit the code accordingly.

Read the documentation

All migration guides can be found in the documentation. If you need help with updating, we are at your service.