Skip to content

Spring Evolution 🌷

Compare
Choose a tag to compare
@github-actions github-actions released this 01 Mar 12:25
· 704 commits to main since this release
6.0.0
551536e
Mark Type Count Packages
Breaking changes 46 *, core, documentator, formatter, graphql, migrator, queue, testing
Features 20 documentator, formatter, graphql, serializer, testing
Performance Improvements 2 graphql
Bug Fixes 9 documentator, graphql
💀 Deprecations 5 graphql
Miscellaneous 4 *, documentator
Code Refactoring 30 *, core, documentator, graphql, migrator, queue, testing

The new release with a huge number of API changes addressed to make the code more clear and extendable. The majority are related to the GraphQL part and introduce several improvements (or breaking changes if you like 😁). Probably the most critical is the change of query syntax - the extra operators and fields were split into different types, which removes any possible conflicts between them (no way to solve it in v5). This is mean that the default syntax now is users(where: { field: { name: { equal: "..." } } }) { ... }/comments(order: [ {field: {user: {name: asc}}} ]) instead of users(where: { name: { equal: "..." } } ) { ... }/comments(order: [ {user: {name: asc}} ]) (notice to field: {...}). The second - all enums were converted into PHP enums internally, so the case of member names followed by the PHP convention (Asc instead of asc). Also, note about input types auto-generation improvements and that the recommended way to add operators is inside GraphQL schema with extend scalar SearchByOperators* (now should be possible to do all the same as in config).

Please follow Upgrade Guide to migrate 🤗 (and learn how to switch back to the previous query syntax 😉). You can ask a question and/or discuss in release disscussion.

All packages

Miscellaneous

  • Better dependencies (#123, 0d1d914)
  • Minimal version of phpstan/phpdoc-parser set to ^1.25 (0b096ac)
  • Tools extracted from composer.json into vendor-bin (#122, 76f629c)

Code Refactoring

Package core

Code Refactoring

  • Removed deprecated Helper::callAfterBoot() (8357bc5) ☣
  • Removed deprecated InstanceCache trait (cfa1db7) ☣

Package documentator

Features

  • IncludePackageList (include:include:package-list) will also detect path to UPGRADE.md (should be in the same directory where README) (2f2adeb)
  • template parameter support for IncludeDocumentList (include:document-list) (af8f2e4)
  • template parameter support for IncludePackageList (include:include:package-list) (d2dbf7f) ☣

Bug Fixes

  • Added missed nikic/php-parser requirement + compatibility with v5 (abcae15)
  • requirements command will use local composer.json for HEAD (80486bd)

Miscellaneous

  • Removed phpdocumentor/reflection-docblock, the phpstan/phpdoc-parser will be used instead (6faba1b)

Code Refactoring

  • Instruction classes reorganization (9c8a066) ☣
  • Instruction templates reorganization (f4a00ee) ☣
  • Removed deprecated LastDragon_ru\LaraASP\Documentator\Preprocessor\Instruction (52f6d87) ☣

Package formatter

Features

  • duration() fraction seconds and new format syntax support (#108, 9bc90af) ☣
  • Formatter::filesize() support for robibyte (RiB) and quebibyte (QiB) (#106, 56b83fa) ☣
  • time()/date()/datetime() will accept only string as $format name (5612367) ☣

Package graphql

Features

  • Ability to disable operators (#113, 01c7f71)
  • Input type auto-generation improvements (#114, #127, accd8bf) ☣
  • Root types for @searchBy and @sortBy (#118, #129, 693df03) ☣
  • Setting builder.allowed_directives will be applied for Implicit types only. For the Explicit types, all directives will be copied (#132, 6839e8f)
  • Type extensions improvements (#136, 1703d95) ☣
  • Universal builder property resolver (#120, #87, f5934ef) ☣
  • @sortBy: Added (missed) @sortByExtendOperators directive (0b1652c)
  • @sortBy: Default nulls ordering (#110, #111, e528aec) ☣
  • @sortBy: Nulls ordering operators nullsFirst/nullsLast (#119, e260593)
  • @sortBy: Support of Operators::Object (467b023) ☣
  • @stream: ResolveInfo::enhanceBuilder() will be used only if really necessary (also, it is faster, and required to enhance/support any builder) (08f0e26) ☣

Performance Improvements

  • Bindings registration (bindIf() => scopedIf()) (41387ae)
  • Per type Operators cache (8fda774)

Bug Fixes

  • Detection of operator-directive for implicit type (b5a777e)
  • Lighthouse v6.34.0 compatibility (failed tests) (ce67672)
  • @searchBy: Directive locations (b56b21b) ☣
  • @sortBy: Directive locations (4d4e8ce) ☣
  • @sortBy: Possible too long alias name for joined relation (73c87ec)
  • @sortBy: Random order will be available only for Query and Eloquent builders (7ffc919)
  • @sortBy: Str::camel() replaced to Str::studly() as it should be (dc5b70f)

Deprecations 💀

  • LastDragon_ru\LaraASP\GraphQL\Builder\Contracts\Scout\FieldResolver, use LastDragon_ru\LaraASP\GraphQL\Builder\Contracts\BuilderPropertyResolver instead (122f29b) ☣
  • @searchBy: @searchByOperatorRelation, the @searchByOperatorRelationship should be used instead (8cdb50e)
  • @searchBy: @searchByOperators (the @searchByExtendOperators should be used instead) (a710b68)
  • @searchBy: enum SearchByTypeFlag { yes }/enum SortByTypeFlag { yes }, please use enum SearchByTypeFlag { Yes }/enum SortByTypeFlag { Yes } instead (75639af)
  • @sortBy: enum SortByTypeDirection { asc, desc }, please use enum SortByTypeDirection { Asc, Desc } instead (c9a515b)

Code Refactoring

  • Ability to override type of *FieldSource/*ArgumentSource (760a71d) ☣
  • Added TypeSource::isObject() (0c53721) ☣
  • Added TypeSource::isScalar(), TypeSource::isEnum() (0600d0d) ☣
  • Added parent to the Source (30f3e95) ☣
  • API Improvements (#130, 7a43a09) ☣
  • AstManipulationBuilderInfo => HandlerContextBuilderInfo (b8eacb2) ☣
  • AstManipulator::getOriginTypeDefinition() => (more useful) AstManipulator::getOriginType() (2f29617) ☣
  • Better names for (internal) directives (#128, abef051) ☣
  • Builder Context (#116, 79b3bf0) ☣
  • Context moved to LastDragon_ru\LaraASP\GraphQL\Builder\Context namespace (e65075d) ☣
  • InputObject::getFieldDirectiveOperator() => InputObject::getFieldOperatorDirective() (e0f97a8) ☣
  • Manipulator::getPlaceholderTypeDefinitionNode() => AstManipulator::getOriginTypeDefinition() (342a170) ☣
  • Operator:isBuilderSupported() => Operator:isAvailable() (55d486f) ☣
  • OperatorDirective::getDirectiveLocations() renamed to OperatorDirective::getLocations() (2bfe45c) ☣
  • Operators (#133, 4e91f28) ☣
  • Property not Stringable anymore (fd5d8ef) ☣
  • Removed deprecated ClientException::getCategory() (24cb66f) ☣
  • @searchBy: @searchByOperatorRelation renamed to @searchByOperatorRelationship (0574fd2) ☣
  • @searchBy: Operators::Condition => Operators::Object, scalar SearchByCondition => scalar SearchByObject (7c63703) ☣
  • @sortBy: EloquentSorter code simplification (removed unnecessary check that relation supported) (2682e5b) ☣

Package migrator

Code Refactoring

  • Removed deprecated SmartMigrator::isAnonymousMigrationsSupported() (5cc4e93) ☣

Package queue

Code Refactoring

  • Package removed. Please use lastdragon-ru/lara-asp-core instead (fdf300c) ☣

Package serializer

Features

  • BackedEnum support out the box (795f9bf)
  • UnitEnum support (will be serialized/deserialized as/from the case name) (33098bd)

Package testing

Features

Code Refactoring

  • Removed deprecated CronableAssertions::assertCronableRegistered(), CronableAssertions::setQueueableConfig(), CronableAssertions::isCronableRegistered() (11fe0a0) ☣
  • Removed deprecated TestCase::getContainer() (e9ca939) ☣