Skip to content

Commit

Permalink
Add deprecation guideline (see #23)
Browse files Browse the repository at this point in the history
  • Loading branch information
nadako committed Oct 13, 2014
1 parent 89b349c commit 440cb0c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,24 @@ static function doStuff(a:Int, b:String):Void;

Note that node.js API documentation often describes types of variables which is mostly redundant in Haxe, so these parts can be removed.

## Deprecated API

Use `@:deprecated` metadata for upstream API that is deprecated. That way compiler will emit a warning when using deprecated API.

Example:
```haxe
@:deprecated // default warning message
extern class DeprecatedClass {
}
extern class NotSoDeprecated {
@:deprecated("use otherMethod instead") // custom warning message
function deprecatedMethod():Void;
function otherMethod():Void;
}
```

## Tricks and hints

TODO (dealing with keywords, `untyped __js__`, inline methods and properties on extern classes)

0 comments on commit 440cb0c

Please sign in to comment.