Nette 3.0.0 alpha released!
 
- David Grudl
- Nette Core | 8285
Nette 3.0.0 alpha has just been released!
Nette is one of the very first frameworks that uses strict_types, scalar type hints and return type hints. Which is a fundamental step towards more robust applications.
Minimum required PHP version is 7.1 (7.0 for some packages).
This version is highly compatible with 2.4 and is intended for testing new type hints and strict_types features.
TODO: tool for automatic adding of the necessary type hints to your code.
Stages of development of individual packages
- Security, Robot-Loader, Php-Generator, Neon, Finder, Component-Model, Caching, Bootstrap: finished, just need to be tested
- Mail: all that remains is better API for SmtpMailer
- Utils: all that remains is support for immutable DateTime
- Database: resolve pull requests
- Application, Http: on roadmap are bigger internal changes to support middlewares (current stage is early alpha)
- Latte: on roadmap is the new API for macros with AST (current stage is early alpha)
- Form: on roadmap are improvements including automatic CSRF protection, dynamic forms, etc
- DI: on roadmap are improvements in Compiler extensions (priorities etc)
- Tester: all that remains is output handlers refactoring
- Tracy, Reflection, SafeStream, Tokenizer: new versions of these packages are not planned at the moment
BC breaks
Due to the new return type hints some method returns NULL instead of FALSE on failure:
- Strings::before(), after(), indexOf()and- pos()return NULL instead of FALSE if the needle was not found
- Arrays::searchKey()returns NULL instead of FALSE when item is not found
- ContainerBuilder::getServiceName()returns NULL instead of FALSE
- Database\ResultSet: changed empty result return type of- fetch()and- fetchField()from FALSE to NULL
- UI\ComponentReflection::parseAnnotation()returns NULL instead of FALSE
- Latte\MacroTokens::fetchWord()returns NULL instead of FALSE on error
- PhpGenerator\Method: empty body is NULL instead of FALSE
- and Image::save()andsend()throws ImageException on failure
Similary in Forms SubmitButton::setValidationScope() accepts
?array, so replace in your code FALSE with empty
array []
Some classes & members are marked as final.
Deprecations
- first parameter $code is deprecated in
	UI\Component::redirect(), useredirectPermanent().
- UI\Component::getParam()
- ComponentModel\Component::__construct()parameter- $parentis deprecated
- ComponentModel\Container::getComponents(): removed (unknown) child-first option
- Http: IRequest, IResponse, Url: parameters- $defaultare deprecated
Database
- SqlPreprocessor: all scalars are always passed via binding (may cause BC break in Postgresql)
- there are changes in ISupplementalDriver(removed unusednormalizeRow()andformatBool(), addedformatDateInterval()andinitialize()), inIStructure(addedgetPrimaryAutoincrementKey()) andIRowContainer(addedfetchField())
DI
- removed deprecated support for inheritance ‘child < parent’
Http
- HttpExtension: uses interfaces- Http\IRequest&- Http\IResponseinstead of- Http\Request&- Http\Response
PhpGenerator
- Helpers::formatArgs()checks for insufficient number of placeholders
RobotLoader
- $autoRebuildreplaced with- setAutoRefresh()(available since v2.4.2)
- setCacheStorage()replaced with- setTempDirectory()(available since v2.4.2)
- RobotLoader is case sensitive
Security
- User::setExpiration()removed second argument- $whenBrowserIsClosedand replaced with- $flags(possible value- IUserStorage::CLEAR_IDENTITY)
Utils
- Validators::assertField:first argument has type hint array
 
- Tomáš Votruba
- Moderator | 1114
Thanks for the release! Much love for PHP 7.1!
What is the easiest step to try it out?
Is is possible to try it, when some of my dependencies lock Nette to
"nette/nette": "^2.4"?
Last edited by Tomáš Votruba (2017-02-04 14:55)
 
- David Grudl
- Nette Core | 8285
The only way I know is to manually replace content of
/vendor/nette with Nette 3.0 and run
composer dumpautoload.
I am working on automatic tool that adds needed typehints to your code.
 
- Tomáš Votruba
- Moderator | 1114
How to test Nette 3.0 with ease?
Last edited by Tomáš Votruba (2017-02-05 00:04)
 
- Honza Kuchař
- Member | 1662
I have made new web app on top of Nette 3 and I haven't found any issue during development. Pure PHP 7.1 awesomeness! ♥
Last edited by Honza Kuchař (2017-08-11 22:41)
 
- Pavel Kravčík
- Member | 1206
You can check all commits to Nette-family repos: http://nette-commits.cz/
 
- Felix
- Nette Core | 1271
Pavel Kravčík wrote:
You can check all commits to Nette-family repos: http://nette-commits.cz/
The correct domain is https://commits.nette.org
Last edited by Felix (2021-12-01 17:39)



