Skip to content

Refactoring Typed Headers #33

Closed
2 of 2 issues completed
Closed

Description

@nielsenko

The current implementation of typed headers presents several challenges that need addressing:

  • Flexibility & customization
    Developers should be able to define their own typed header classes, customize parsing behavior, and extend functionality as needed without modifying the core library. It should be possible to mix-and-match strict vs non-strict parsing modes on a per-header, per-handler basis.

  • Opt-in approach
    Forcing typed headers on all users create unnecessary complexity for some use cases. A gradual adoption approach allows developers to migrate at their own pace, maintaining backward compatibility with existing code while providing a clear path forward.

  • Efficiency & performance
    Header parsing and serialization should have minimal overhead compared to raw string operations. This means avoiding unnecessary object allocations, optimizing parsing algorithms, and ensuring that typed headers don't become a bottleneck in request processing.

    The current implementation pays for typed headers up front in terms of memory usage. Some effort has gone into supporting lazy parsing, but some operations still force eager parsing.

  • Custom header support
    Beyond standard HTTP headers, applications often define custom headers for specific functionality. The typed header system should provide an extensible framework that allows developers to easily define and use their own custom header types with the same benefits as built-in headers.

  • Inter-isolate sharing
    Since Dart applications often use multiple isolates for concurrency, header objects should be easily transferable between isolates without expensive serialization/deserialization cycles. This requires careful consideration of the internal representation of header data.

Sub-issues

Sub-issues

2 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. self-assigned this
    on Mar 13, 2025
  2. changed the title [-]Typed Headers[/-] [+]Refactoring Typed Headers[/+] on Mar 27, 2025
  3. added
    enhancement
    on Mar 27, 2025
  4. moved this from Backlog to Now 🔥 in Relic Roadmapon Mar 27, 2025
  5. moved this from Now 🔥 to Done in Relic Roadmapon Apr 2, 2025
  6. SandPod commented on Aug 14, 2025

    @SandPod
    Contributor

    Reopened since a subtask is not completed.

  7. moved this from Inbox 📫 to Planned 🔭 in Serverpod Frameworkson Aug 14, 2025
  8. moved this from Planned 🔭 to Backlog 🗂️ in Serverpod Frameworkson Aug 28, 2025
  9. SandPod commented on Aug 28, 2025

    @SandPod
    Contributor

    Closing since the subsissue is specified.

  10. moved this from Backlog 🗂️ to Done 🚀 in Serverpod Frameworkson Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions