-
Notifications
You must be signed in to change notification settings - Fork 22
Added deprecated section to annotation docs #19
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
Conversation
Prettier support for mdx seems to be limited
|
||
## @extension | ||
|
||
<DeprecatedInVersion deprecated="0.37.0" removed="TBD"></DeprecatedInVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<DeprecatedInVersion deprecated="0.37.0" removed="TBD"></DeprecatedInVersion> | |
<DeprecatedInVersion deprecated="0.37.0" removed="TBD" /> |
There are multiple lines like this one which should be changed if this change is acceptable
@@ -0,0 +1,18 @@ | |||
import React from "react"; | |||
|
|||
export function SmallCallout({ children, serverity = "warning" }: { children: React.ReactNode; serverity: string }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export function SmallCallout({ children, serverity = "warning" }: { children: React.ReactNode; serverity: string }) { | |
export function SmallCallout({ children, severity = "warning" }: { children: React.ReactNode; severity?: string }) { |
- Spell check
serverity -> severity
- Severity has a default value, but is considered to be required
- The default value is never actually used so the default could be removed, or the severity be required
If this line is becoming too long this is another common TSX syntax I see used, but it isn't used in this codebase
type Props = {
children: React.ReactNode;
severity?: string;
};
export const SmallCallout: React.FC<Props> = ({ children, severity = "warning" }) => {
return (...);
};
} | ||
|
||
> :last-child { | ||
padding-left: 5px; | ||
padding-right: 5px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering what happened to the sideBySide whilst making these changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, good change, thanks for the pictures 👍
myFunction(): void; | ||
} | ||
|
||
declare const ExistingClassTable: MyBaseClass; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you go with this over
interface ExistingClass {
myFunction(): void;
}
ExistingClassTable.myFunction = function() {};
(For example ExistingClass = CDotaGameRules and ExistingClassTable = GameRules (already exists))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to your example.
|
||
:::warning | ||
Some annotations are deprecated and will be/have been removed. | ||
The docs are only valid for older versions and include some instructions on how to replace the annotations with vanilla TS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs are only valid for older versions and include some instructions on how to replace the annotations with vanilla TS. | |
Below are the deprecated annotations and instructions to recreate their behavior with vanilla TypeScript. |
function myFunction() end | ||
``` | ||
|
||
</SideBySide> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrade instructions: Use ECMAScript modules and import/export. Alternatively, use a real (non-phantom) namespace.
|
||
**Upgrade Instructions** | ||
|
||
Use interface merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mention preferred is to declare interfaces over classes, otherwise use the the TS below.
Should be merged once a new version with the changes from TypeScriptToLua/TypeScriptToLua#949 is released
TODO: