Skip to content

Document the @deprecated attribute. Fixes #168 #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pages/docs/manual/latest/attribute.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ type student = {
age: int,
@bs.as("aria-label") ariaLabel: string,
}

@deprecated
let customDouble = foo => foo * 2

@deprecated("Use SomeOther.customTriple instead")
let customTriple = foo => foo * 3
```
```js
```
Expand All @@ -55,6 +61,8 @@ type student = {
2. `@unboxed` annotates the type definition.
3. `@bs.val` annotates the `external` statement.
4. `@bs.as("aria-label")` annotates the `ariaLabel` record field.
5. `@deprecated` annotates the `customDouble` expression. This shows a warning while compiling telling consumers to not rely on this method long-term.
6. `@deprecated("Use SomeOther.customTriple instead")` annotates the `customTriple` expression with a string to describe the reason for deprecation.

## Extension Point

Expand Down