Skip to content

v2.0.0: Plugin / extension architecture #40

Description

@eclectic-coding

Summary

Define a formal SafeMemoize::Extension API so third-party gems can add new options, hooks, or store adapters without monkey-patching SafeMemoize internals.

Motivation

As SafeMemoize grows, users want to integrate it with external cache stores, add custom eviction strategies, and inject cross-cutting concerns (e.g. instrumentation, distributed tracing). Without a stable extension point, all of this requires patching private internals, making upgrades brittle.

Proposed approach

  • A registration mechanism: SafeMemoize.register_extension(MyExtension)
  • Extensions can declare new memoize options they handle
  • Extensions can register hook callbacks on existing memo lifecycle events
  • Extensions can supply a custom store adapter

Acceptance criteria

  • SafeMemoize::Extension base class / module with documented lifecycle callbacks
  • Extension registration does not affect performance of the non-extended path
  • At least one reference extension (e.g. a no-op logger) ships as an example
  • Clear deprecation / migration path from any existing unofficial monkey-patches
  • Full test coverage for the extension API
  • RBS signatures updated
  • README with extension authoring guide
  • CHANGELOG updated

Milestone

v2.0.0 — Next Generation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions