discussions-and-proposals icon indicating copy to clipboard operation
discussions-and-proposals copied to clipboard

Proposal to remove Slider and other deprecated components

Open gabrieldonadel opened this issue 2 years ago • 9 comments

Introduction

When running RNTester we see this warning stating that Slider has been extracted from react-native core and will be removed in a future release. which got me thinking about when this component was deprecated. According to the changelogs this component was deprecated in version 0.59.0, about two years ago, along with MaskedViewIOS, ViewPagerAndroid, AsyncStorage, NetInfo, and ImageStore.

Of these six components three are still present in the codebase

  • MaskedViewIOS
  • AsyncStorage
  • Slider

Details

I don't have many details myself about the reasons for not removing these components but from what I read at https://github.com/facebook/react-native/issues/23313 the original idea was to eventually remove all these components from the main repo.

Discussion points

  • Can we remove these components already?
  • When should we remove components after deprecating them?
  • What are the other components we should also remove?

gabrieldonadel avatar Jan 25 '22 04:01 gabrieldonadel

I don't have many details myself about the reasons for not removing these components but from what I read at facebook/react-native#23313 the original idea was to eventually remove all these components from the main repo.

As you linked in the original issue, the idea was to slowly remove those components to the core and move to community maintained libraries. ~I see nothing blocking us from removing the components you mentioned from the codebase as they've been deprecated for so long.~

EDIT: There might be the need to keep some of those components as they're used internally. Regardless we should address those in some form. CC @yungsters as he has more context here.

cortinico avatar Jan 25 '22 13:01 cortinico

I think I maybe remember that some of the remaining components just needed to be "deleted" by someone at Meta but we didn't have someone working on it. If I recall correctly, the plan was to move them elsewhere in our monorepo so internal callsites could keep calling them, but they'd no longer be a part of React Native.

For Meta employees, I believe this is an example task of that work from way back when. I think there are other similar ones probably around. T78504869

TheSavior avatar Jan 26 '22 03:01 TheSavior

@TheSavior is there something for the community to help with?

Edit: Maybe removing RNTester examples that use these components?

gabrieldonadel avatar Jan 26 '22 22:01 gabrieldonadel

@cortinico (or maybe @yungsters) Do you have any update on this ? I would be happy to help with this.

AntoineDoubovetzky avatar Jul 24 '22 19:07 AntoineDoubovetzky

@AntoineDoubovetzky the update is the following:

  • MaskedViewIOS -> Has been removed and now lives inside https://github.com/react-native-masked-view/masked-view
  • AsyncStorage -> You should use https://github.com/react-native-community/asyncstorage. This hasn't been removed yet as I it's still used internally.
  • Slider -> You should use https://github.com/react-native-community/react-native-slider. This is a bit more complicated as I see we have a Slider also inside the core of Fabric. Ideally we should migrate react-native-community/react-native-slider to be New Architecture compatible + remove the Slider from Fabric so we don't have a duplicated one.

cortinico avatar Jul 29 '22 13:07 cortinico

Slider -> You should use https://github.com/react-native-community/react-native-slider. This is a bit more complicated as I see we have a Slider also inside the core of Fabric. Ideally we should migrate react-native-community/react-native-slider to be New Architecture compatible + remove the Slider from Fabric so we don't have a duplicated one.

@cortinico we're on the finish of migrating Slider (https://github.com/callstack/react-native-slider/pull/400, https://github.com/callstack/react-native-slider/pull/402). Planing to release next week. cc @okwasniewski

thymikee avatar Jul 29 '22 14:07 thymikee

Great! I'll open a PR to remove the Slider once the migration is released then.

AntoineDoubovetzky avatar Jul 29 '22 14:07 AntoineDoubovetzky

@AntoineDoubovetzky We've released slider v4.3.1 supporting fabric so I think we can remove it now. cc. @thymikee

okwasniewski avatar Sep 08 '22 19:09 okwasniewski

Alright I'll work on it over the weekend

AntoineDoubovetzky avatar Sep 09 '22 08:09 AntoineDoubovetzky