Skip to content

Rolling deprecation support #66

@eed3si9n

Description

@eed3si9n

For a contained ecosystem, rolling deprecation feature might be useful.

type Greeting {
  value: String!
  x: Int @since("0.2.0") @deprecated("0.3.0") @remove("0.4.0")
  number: Long @since("0.3.0")
}

This could generate

object Greeting {
  // 0.0.0
  def apply(value: String): Greeting = new Greeting(value, None, None)
  // 0.2.0
  @deprecated
  def apply(value: String, x: Int): Greeting = new Greeting(value, Some(x), None)
  // 0.3.0
  def apply(value: String, number: Long): Greeting = new Greeting(value, None, Some(number))
}

Once 0.4.0 is reached, remove the field altogether:

object Greeting {
  // 0.0.0
  def apply(value: String): Greeting = new Greeting(value, None)
  // 0.2.0
  def apply(value: String, x: Int): Greeting = Macro.restligeist("0.2.0 apply no longer exists.")
  // 0.3.0
  def apply(value: String, number: Long): Greeting = new Greeting(value, Some(number))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    uncategorizedUsed for Waffle integration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions