Skip to content

feat(middleware): Implement mix-in to allow for decoratable patterns #83

Description

@just1po1nt0

Feature Category

Middleware/Plugin

Problem Statement

The current proposed solution for rebasing middleware is implementing a chain of responsibility, and executing middleware code via class decorators. To implement a decoratable class, it would be preferable to use mixins.

Proposed Solution

Create two mixins: one for chain of responsibility, other for decorator support.

Details need to be clarified in comments.

API Design

N/A

Alternative Solutions

We could have manually put in support for decorators, but mixins are more preferable to that since it would be simpler to work with them.

We are currently using a pattern that resembles coroutines, but the current pivot is to move away from that logic, since it tangles middleware into something that looks out of date by the modern standards.

Use Case

ALL ROUTES…

Impact and Scope

This change would mean a big upgrade from older versions of lightlib. Insignificant since lightlib has not been shipped.

Contribution

  • I would like to implement this feature
  • I need guidance on implementation
  • I can help with testing

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions