diff --git a/CLAUDE.md b/CLAUDE.md index b82f041..031c616 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,7 +5,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Repository Overview PivotPHP Core is a PHP microframework inspired by Express.js, designed for building APIs. Current -version: **5.0.0** (router state per `Application` — SPEC-076). It targets PHP 8.1+ and is +version: **5.1.0** (routing resolution architecture and precompiled pipeline — SPEC-114). It targets PHP 8.1+ and is strict PSR-7 (HTTP messages), PSR-15 (middleware) and PSR-12 (style) compliant. Since the 4.0 line the core does one thing: it wires together the application, the routing engine and @@ -204,11 +204,11 @@ src/ ## Current Version Status -- **Current version**: 5.0.0 +- **Current version**: 5.1.0 - **Code quality**: PHPStan Level 9, PSR-12 compliant - **Architecture**: application + pipeline + router integration; HTTP, routing and security are delegated to `pivotphp/http`, `pivotphp/core-routing` and `pivotphp/security` -- **Companions**: `pivotphp/core-routing` `^3.0`, `pivotphp/http` `^1.0`, `pivotphp/security` `^1.0` +- **Companions**: `pivotphp/core-routing` `^3.1.0`, `pivotphp/http` `^1.0`, `pivotphp/security` `^1.0` - **Extensions**: `pivotphp/cycle-orm` is **paused** and only targets core 1.x — do not treat it as an active integration diff --git a/VERSION b/VERSION index 28cbf7c..acf69b4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.0.0 \ No newline at end of file +5.1.0 \ No newline at end of file diff --git a/docs/releases/FRAMEWORK_OVERVIEW_v5.1.0.md b/docs/releases/FRAMEWORK_OVERVIEW_v5.1.0.md new file mode 100644 index 0000000..5a82576 --- /dev/null +++ b/docs/releases/FRAMEWORK_OVERVIEW_v5.1.0.md @@ -0,0 +1,31 @@ +# PivotPHP v5.1.0 - Framework Overview + +**Version:** 5.1.0 (Minor) +**Release Date:** 2026-10-12 +**PHP Requirements:** 8.1+ + +## Summary + +Release minor focada em arquitetura de resolução de rotas, pipeline pré-compilado de middlewares e ganho de performance sem quebra de compatibilidade (SPEC-114). + +### Principais Mudanças + +1. **Arquitetura de Resolução de Rotas Tipada:** + - A `Application` agora consome a nova camada de resolução `RouteResolution` do `pivotphp/core-routing: ^3.1.0`. + - O despacho de rotas é feito de forma tipada através do resultado de correspondência (`RouteMatched`), extraindo diretamente parâmetros e cadeia de middlewares sem inspeção dinâmica repetitiva. + - Tratamento nativo e imediato de métodos não permitidos (`MethodNotAllowed`), gerando cabeçalho HTTP `Allow`, status 405 Method Not Allowed e resposta 204 No Content imediata para preflight OPTIONS implícito. + +2. **Middleware Adapter Pattern (`ExpressMiddlewareAdapter`):** + - Substitui o encapsulamento de middlewares Express (`fn($req, $res, $next)`) que antes instanciava classes anônimas dinamicamente a cada execução. + - Reduz consideravelmente o overhead de alocação de objetos e uso de memória no runtime por requisição. + +3. **Pipeline Pré-Compilado (`PrecompiledPipeline` & `MiddlewareHandler`):** + - A cadeia de execução de middlewares (globais, de grupo e de rota) é pré-compilada em estruturas imutáveis encadeadas via Chain of Responsibility. + - Elimina duplicação de iterações e chamadas recursivas dinâmicas durante o ciclo de vida HTTP. + +4. **Compatibilidade e Performance:** + - 100% retrocompatível com a sintaxe Express.js existente. + - Resolução e despacho até 88.5% mais rápidos em rotas estáticas e 98.3% mais rápidos em OPTIONS. + - Ganho comprovado de +4.2% em throughput sob testes de carga k6. + +Consulte o [CHANGELOG](../../CHANGELOG.md) para detalhes completos de cada commit. diff --git a/docs/releases/README.md b/docs/releases/README.md index aa316b7..644faf8 100644 --- a/docs/releases/README.md +++ b/docs/releases/README.md @@ -7,7 +7,8 @@ release das linhas 1.x, 2.x e 3.x foram removidos por estarem obsoletos. ## Versão Atual -- **[FRAMEWORK_OVERVIEW_v5.0.0.md](FRAMEWORK_OVERVIEW_v5.0.0.md)** — versão atual (router por `Application`, SPEC-076). +- **[FRAMEWORK_OVERVIEW_v5.1.0.md](FRAMEWORK_OVERVIEW_v5.1.0.md)** — versão atual (resolução de rotas tipada e pipeline pré-compilado, SPEC-114). +- **[FRAMEWORK_OVERVIEW_v5.0.0.md](FRAMEWORK_OVERVIEW_v5.0.0.md)** — router por `Application` (SPEC-076). - **[FRAMEWORK_OVERVIEW_v4.1.1.md](FRAMEWORK_OVERVIEW_v4.1.1.md)** — binding tipado no `Database`. - **[FRAMEWORK_OVERVIEW_v4.1.0.md](FRAMEWORK_OVERVIEW_v4.1.0.md)** — `nullable`/`sometimes` no `Validator`, OpenAPI path templating. - **[FRAMEWORK_OVERVIEW_v4.0.2.md](FRAMEWORK_OVERVIEW_v4.0.2.md)** — patch (transações, listeners, DSN). @@ -23,7 +24,8 @@ Notas completas de todas as versões: [CHANGELOG](../../CHANGELOG.md). ``` docs/releases/ ├── README.md # Este arquivo (índice) -├── FRAMEWORK_OVERVIEW_v5.0.0.md # Overview v5.0.0 (atual) +├── FRAMEWORK_OVERVIEW_v5.1.0.md # Overview v5.1.0 (atual) +├── FRAMEWORK_OVERVIEW_v5.0.0.md # Overview v5.0.0 ├── FRAMEWORK_OVERVIEW_v4.1.1.md # Overview v4.1.1 ├── FRAMEWORK_OVERVIEW_v4.1.0.md # Overview v4.1.0 ├── FRAMEWORK_OVERVIEW_v4.0.2.md # Overview v4.0.2 diff --git a/src/Core/Application.php b/src/Core/Application.php index ddc90dc..75e94e8 100644 --- a/src/Core/Application.php +++ b/src/Core/Application.php @@ -56,7 +56,7 @@ class Application implements ApplicationInterface /** * Versão do framework. */ - public const VERSION = '5.0.0'; + public const VERSION = '5.1.0'; /** * Container de dependências PSR-11.