Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

docs(CHANGELOG.md): Document ScrollView ES6 conversion #77

Merged
Merged
Changes from 1 commit
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
### Changed

- Major improvements to Flow types for Core Components ([499c195](https://github.com/facebook/react-native/commit/499c195), [fbc5a4f](https://github.com/facebook/react-native/commit/fbc5a4f), [f9050e0](https://github.com/facebook/react-native/commit/f9050e0), [6476151](https://github.com/facebook/react-native/commit/6476151), [c03fc40](https://github.com/facebook/react-native/commit/c03fc40), [69213ee](https://github.com/facebook/react-native/commit/69213ee), [136dfc8](https://github.com/facebook/react-native/commit/136dfc8), [3c0211b](https://github.com/facebook/react-native/commit/3c0211b), [c127000](https://github.com/facebook/react-native/commit/c127000), [636e146](https://github.com/facebook/react-native/commit/636e146), [6fa997d](https://github.com/facebook/react-native/commit/6fa997d), [35a65cd](https://github.com/facebook/react-native/commit/35a65cd), [7927497](https://github.com/facebook/react-native/commit/7927497), [45c5183](https://github.com/facebook/react-native/commit/45c5183), [a97d104](https://github.com/facebook/react-native/commit/a97d104), [fb4825a](https://github.com/facebook/react-native/commit/fb4825a), [84c5416](https://github.com/facebook/react-native/commit/84c5416), [3649a50](https://github.com/facebook/react-native/commit/3649a50) by [@mottox2](https://github.com/mottox2), [@saitoxu](https://github.com/saitoxu), [@RSNara](https://github.com/RSNara), [@watanabeyu](https://github.com/watanabeyu), [@Tnarita0000](https://github.com/Tnarita0000), [@exced](https://github.com/exced), [@nd-02110114](https://github.com/nd-02110114), [@flowkraD](https://github.com/flowkraD))
- Components were converted to ES6 classes ([ScrollView](https://github.com/facebook/react-native/commit/221e2fe4095bc9ae15878725bdac4071d53e61f5)) by [@thymikee](https://github.com/thymikee). **Breaking Change**: Public methods of these components are no longer bound to their component instance. This was a behaviour of `createReactClass`, that we decided to not preserve when switching over to ES6 classes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be in a separate Breaking Changes section? I imagine it will be something people will need to be specifically aware of in their upgrades.

Also, perhaps we can provide more information on the specific methods that have changed and an example of how their code will need to be changed.

Is there anything we can do to help people automatically detect these old calls in their codebase proactively without waiting for something to crash?

Really I just want to help people upgrade as easily as possible, providing any information / tools that helps make that happen.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's important that this description is flipped; the conversion to ES6 explains why the change took place, but the important thing to users is understanding that ScrollView's public methods are no longer instance bound. I'd suggest leading with that and continuing with the ES6 conversion bit as explanation. I think to @TheSavior's point, this becomes a BigDeal™ and should probably come before the Flowtypes mention.

Thanks for helping with the 58 release notes! Swap this around and I'll happily merge it into my branch.

Copy link
Contributor Author

@RSNara RSNara Jan 9, 2019

Choose a reason for hiding this comment

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

🤔 I think it's a good idea to have a breaking changes section. My only worry is that it'll never be all-encompassing/complete, unless we make an active effort to document all breaking changes to the codebase, which won't be trivial. (And even if we do make this effort, we'll always miss things). Also, unless we explicitly document that this section is not complete (which we could totally do), some people will assume that it is complete.

Also, perhaps we can provide more information on the specific methods that have changed and an example of how their code will need to be changed.

I thought about this and I think it may be more succinct to say that all methods you can invoke on the component will no longer be bound to the component instance. But... I think it might be a good idea to list out the methods incase someone is CTRL+F'ing through the changelog.

Is there anything we can do to help people automatically detect these old calls in their codebase proactively without waiting for something to crash?

I'm not sure if there's anything we can do, but the easiest way of finding these problems that I can think of would be to grep through the codebase looking for cases where the functions are passed in as callbacks to methods. So, looking for strings like this: 'flashScrollIndicators)' or 'flashScrollIndicators,'. I'm not sure what else we can do aside from being explicit about which functions were affected, which would help people change up these call-sites.

- Flow dependency is now at v0.86.0 ([8fb228f](https://github.com/facebook/react-native/commit/8fb228f) by [@panagosg7](https://github.com/panagosg7))
- metro dependency is now at v0.49.1 ([f867db3](https://github.com/facebook/react-native/commit/f867db3), [8888295](https://github.com/facebook/react-native/commit/8888295), [31bb551](https://github.com/facebook/react-native/commit/31bb551), [de60e86](https://github.com/facebook/react-native/commit/de60e86), and [a525941](https://github.com/facebook/react-native/commit/a525941) by [@alexkirsz](https://github.com/alexkirsz) and [@rafeca](https://github.com/rafeca))
- jest dependency is now at v24.0.0-alpha.6 ([1b4fd64](https://github.com/facebook/react-native/commit/1b4fd64), [66aba09](https://github.com/facebook/react-native/commit/66aba09), and [06c13b3](https://github.com/facebook/react-native/commit/06c13b3) by [@rafeca](https://github.com/rafeca) and [@rubennorte](https://github.com/rubennorte))
Expand Down