Skip to content

Retire @autobind#4304

Merged
dzearing merged 2 commits intomicrosoft:masterfrom
Markionium:retire-autobind
Mar 17, 2018
Merged

Retire @autobind#4304
dzearing merged 2 commits intomicrosoft:masterfrom
Markionium:retire-autobind

Conversation

@Markionium
Copy link
Copy Markdown
Member

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ npm run change

Description of changes

Replace @autoBind with arrow function properties

See #4279

Focus areas to test

(optional)

@dzearing
Copy link
Copy Markdown
Member

Woohoo!

Copy link
Copy Markdown
Member

@dzearing dzearing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@dzearing dzearing merged commit 882c389 into microsoft:master Mar 17, 2018
}

@autobind
protected onInputChange(value: string) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Markionium @dzearing Please avoid changing how public/protected members are defined in the future. This is technically breaking as anyone who overrides it (like I do) won't be able to compile when taking this version.

@lijunle
Copy link
Copy Markdown
Member

lijunle commented May 21, 2018

@dzearing @Markionium Why are we preferring the arrow function instead of autobind function? The arrow function is violating many good TypeScript best practice:

  1. Declare clear typing for the function/property.
  2. Make function work on prototype and inheritance work.

I could argue that, this is a disaster deprecation.

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants