c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Implement @deprecated annotation

Open lerno opened this issue 3 years ago • 3 comments

Using a @deprecated function or global yields a warning (note). Decide on behaviour for enums, constants etc. Also note the need to link it with versions.

lerno avatar Sep 24 '22 22:09 lerno

Note that @deprecated is in, but there is no version flag yet. In a sense we want this to hook up with a general versioning on libraries, so the basic problem here is to link up the deprecation with a library.

lerno avatar Jul 09 '23 22:07 lerno

One possibility is simply this: @deprecate("Use foo instead", .since = "[email protected]", .removed = "mylib@4") To unpack this:

  1. First argument gives the compile information.
  2. Optional "since" both says (1) which library it belongs to and (2) at what version use it began to be considered deprecated.
  3. Optional "removed" is saying for what version it will be removed.

So typically the "since" version number is fairly uninteresting when you actually have a version you include. Since that version will presumably already have it deprecated. But it shows how long it's been deprecated. The "library"-part on the other hand is essential to know what library it belongs to unless that information can be inferred from something else.

The removed likewise is more about information.

lerno avatar Jul 09 '23 22:07 lerno