Skip to content

v2.0.0: DSL refinements #41

Description

@eclectic-coding

Summary

Evaluate alternative syntax proposals (memoize_method, block form, annotation approach) based on real-world usage feedback, introduce the preferred form, and provide a migration path from the current memoize :method_name API.

Motivation

The current memoize :method_name call-after-def style works well but has drawbacks: the DSL call is visually separated from the method definition, static analysis tools have difficulty understanding it, and some users prefer a decorator-style annotation. A v2 major bump is the right time to revisit this.

Proposed approaches to evaluate

  1. Annotation formmemoize called immediately before the def, acting as a decorator
  2. Block formmemoize { def expensive = ... }
  3. Explicit alias — keep current style but rename to memoize_method for clarity

Acceptance criteria

  • Community feedback gathered (issue discussion / survey) before deciding
  • Chosen form works with all existing options (ttl:, max_size:, shared:, etc.)
  • Deprecation warnings for the old form during a transition window
  • Migration guide in README
  • Codemods or Rubocop cop to automate migration (stretch goal)
  • Full test coverage for new syntax
  • RBS signatures updated
  • 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