refactor middleware pipeline and improve ci checks #4

Manually merged
maxp merged 14 commits from refactor/pipeline-execution-to-satic into main 2025-05-27 15:07:10 +02:00
Owner
  • Add runRoute to IInternalRoute for compiled middleware chains
  • Implement middleware and handler validation in RouteBuilder
  • Throw TypeError for invalid middleware or handler signatures
  • Refactor HttpKernel to use runRoute and simplify error handling
  • Add benchmarks for parallel request handling in HttpKernel
  • Update tests to assert compile-time signature validation
  • Enhance CI workflow with granular steps and error detection
  • Add ci task to deno.jsonc for local checks

This update introduces a statically compiled middleware and handler execution pipeline via a new runRoute method on internal routes. Middleware and handler signatures are validated at route registration, with invalid signatures causing immediate TypeError exceptions. The HttpKernel now delegates execution to the route's compiled chain and handles errors with a streamlined internal handler. Parallel benchmarks are added for performance assessment. Tests are updated to expect compile-time exceptions for invalid signatures. The CI workflow is improved with separate steps for formatting, linting, testing, and benchmarking, including explicit failure detection. A local ci task is added to the configuration for convenience.

- Add `runRoute` to `IInternalRoute` for compiled middleware chains - Implement middleware and handler validation in `RouteBuilder` - Throw `TypeError` for invalid middleware or handler signatures - Refactor `HttpKernel` to use `runRoute` and simplify error handling - Add benchmarks for parallel request handling in `HttpKernel` - Update tests to assert compile-time signature validation - Enhance CI workflow with granular steps and error detection - Add `ci` task to `deno.jsonc` for local checks This update introduces a statically compiled middleware and handler execution pipeline via a new `runRoute` method on internal routes. Middleware and handler signatures are validated at route registration, with invalid signatures causing immediate `TypeError` exceptions. The `HttpKernel` now delegates execution to the route's compiled chain and handles errors with a streamlined internal handler. Parallel benchmarks are added for performance assessment. Tests are updated to expect compile-time exceptions for invalid signatures. The CI workflow is improved with separate steps for formatting, linting, testing, and benchmarking, including explicit failure detection. A local `ci` task is added to the configuration for convenience.
maxp added 14 commits 2025-05-27 15:00:06 +02:00
- Introduces a benchmark task for running performance tests
- Adds format and lint tasks to enforce code style and quality
- Replace individual deno commands with `deno task` equivalents
- Add benchmark task to the CI workflow for performance testing
- Updates .gitignore to include the .local directory
- Prevents accidental commits of local configuration files
- Introduce parallel benchmarks for simple and complex HTTP requests
- Improve performance testing with higher concurrency (10,000 requests)
- Comment out single-request benchmarks for future reference
- Introduces a statically compiled `runRoute` method to encapsulate
  the middleware chain and final handler execution for routes.
- Ensures consistent pipeline execution with safeguards like single
  `next()` invocation and a guaranteed `Response` return type.
- Introduces a `compile` method to compose middleware and handler
  into a single executable function.
- Enhances runtime safety by ensuring `next()` is called only once
  per middleware and validating middleware/handler signatures.
- Improves code structure and maintainability for route execution.
- Replace middleware pipeline logic with route-specific execution
- Remove redundant type checks and streamline error handling
- Improve maintainability by delegating response decoration to routes
- Replace runtime 500 errors with compile-time validation for invalid
  middleware and handler signatures using `assertThrows`
- Improve test clarity by explicitly checking for expected exceptions
  and error messages
- Add tests to validate middleware and handler signatures
- Ensure TypeError is thrown for invalid signatures
- Introduces a new "ci" task to streamline local CI workflows
- Combines formatting, linting, testing, and benchmarking for convenience
feat(ci): enhance CI workflow with granular steps and error handling
All checks were successful
Auto Changelog & Release / detect-version-change (push) Successful in 3s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 7s
d8a7686557
- Add separate steps for formatting, linting, testing, and benchmarking
- Introduce failure detection to halt workflow on step failure
- Improve maintainability and visibility of CI process outcomes
feat(workflows): add GitHub release sync workflow
All checks were successful
Auto Changelog & Release / detect-version-change (push) Successful in 4s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 7s
828fcd4ef0
- Add a workflow to synchronize Gitea releases with GitHub
- Remove deprecated upload-assets workflow example
chore(changelog): update unreleased changelog
All checks were successful
Auto Changelog & Release / detect-version-change (push) Successful in 3s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 7s
CI / build (pull_request) Successful in 19s
8656682b28
maxp added 1 commit 2025-05-27 15:01:19 +02:00
chore(changelog): remove generated CHANGELOG.md before merge
Some checks failed
Auto Changelog & Release / detect-version-change (push) Successful in 3s
CI / build (pull_request) Successful in 17s
Auto Changelog & Release / changelog-only (push) Failing after 7s
Auto Changelog & Release / release (push) Has been skipped
e763351087
maxp force-pushed refactor/pipeline-execution-to-satic from e763351087 to 8656682b28 2025-05-27 15:03:46 +02:00 Compare
maxp manually merged commit de6d3ee389 into main 2025-05-27 15:07:10 +02:00
maxp deleted branch refactor/pipeline-execution-to-satic 2025-05-27 15:07:20 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: maxp/http-kernel#4
No description provided.