React-native: [0.45.2] Commits to cherry-pick and use prop-types with React 16 instead

Created on 23 Jun 2017  路  17Comments  路  Source: facebook/react-native

react@16 (a peerDependency) did away with the PropTypes export in favor of the prop-types module.

The issue has been fixed in master. @mojodna has indicated interest in getting this cherry-picked into the 0.45 release. Several issues have been opened that seem to be related to this, enough that I think it's worth cherry picking into 0.45.2.

Stale

Most helpful comment

I'll be releasing new version later today / tomorrow morning with those fixes cherry-picked.

All 17 comments

@mojodna do you have a list of the commits in master that need to be cherry picked into 0.45 in order to fix the issue?

I've also opened #14713 as we'll also need to cherry pick them into the 0.46 RC in order to make sure the stable release doesn't suffer from this next month.

I don't, but I'll go hunting now.

  • 50b11aa09b479e5ce8b06de98e02ba1dd6a8cca3
  • 1f3140c4962fbbf9f3a00f977daa64d2940c0c5b
  • 8e9322c65e751dc8e7512874e03e7c4349a28b93

One extant issue in master is that many components, such as Text, are still implemented with React.createClass (for the mixins functionality, I assume). Without this resolved React Native will error out on any attempt to use these components, so it should probably be considered blocking for 0.45.2.

It seems that 0.45.1 is pretty unusable in the meantime. Is there a recommended workaround, or should everybody downgrade to earlier versions? If we should downgrade, is it worth considering withdrawing the release, considering that it's unusable?

Curiously, there have been folks reporting (on #14588) that they've been experiencing this issue intermittently, and I've noticed that two weeks ago I was able to use [email protected]/[email protected] without issue and now am not. It would seem that [email protected] should never have been usable with any version of React Native (including master which still has extant React.createClass references), but there are folks for whom this has worked. Perhaps it has something to do with how React Native or the packager resolves the 'react' package internally?

EDIT

Somehow I managed to get RN 0.45.1 to work by downgrading React to 16.0.0-alpha.6 and then updating back to 16.0.0-alpha.12. I have no idea what's going on. I'm using [email protected].

@Ashoat generally we recommend that people use the release candidate, in order to surface issues like these before a stable release is cut. Since the createClass issue is still present in master, we just need someone to send a PR to fix it. We're less than a week away from a stable release cut, so ideally this would be done within the next 24 hours so that we can get it into the RC early enough for people to test.

@hramos - believe it or not, I have been using the release candidates! But as mentioned before, these issues only randomly started popping up when I tried updating to RN 0.45.1. I'm really not sure what's going on, and why these errors are only triggered in certain situations.

Regarding the React.createClass issue, it's worth understanding just how many components in React Native are defined this way. This is just the portion in the Libraries/Components folder: https://gist.github.com/Ashoat/b68064b091d6389080acdec6ee1e7bd7

I doubt anybody's going to be able to put up a pull request fixing those within 24 hours, which means people will ostensibly continue seeing this error in 0.45.2. The big question in my mind is: why isn't everybody seeing these errors? Based on the claim in the error, it would seem that nobody should be able to use React Native 0.45 with React 16, but for some reason this issue does not occur in certain situations. For instance, my dev environment has been in a working state ever since I reinstalled [email protected].

14729 (658c7bb9a63632243d1deebe9a5624e002b99d69) should be cherry-picked into the 0.45 branch prior to 0.45.2 to address the React.createClass deprecation. (@hramos - this should probably be its own issue?)

@Ashoat "The big question in my mind is: why isn't everybody seeing these errors?"

We are, we're just waiting patiently for fixes so we can upgrade w/o issues :D

I'm still on RN v0.44.3 b/c every attempt to upgrade results in an array of errors which seem to stem from a "catch-22" situation of not having the right version of React in sync with the RN and all the stuff that has been depreciated and/or changed (read: PropTypes etc.).

I for one don't know what to do, I'm still using React v16.0.0-alpha.6, tried updating that when I upgrade RN which is automagic since newer versions of RN require newer alpha versions of React_, but alas, no deal.

It would be great to figure out what are the correct update steps we need to keep our codebases up to date, I'm stuck cherrypicking files directly from master so I can at least get the lastest version of some Components, like SectionList, for example.

I'll be releasing new version later today / tomorrow morning with those fixes cherry-picked.

Where is 0.45.2 available? I don't see it on npm at the moment.

Edit: What's the timeline for a 0.45.2 release? 0.46 isn't stable when I tried it out, and there are a number of critical issues reported against it.

I don't think it has been released yet. You can see there's no 0.45.2 tag on the repo.

cc: @hramos build never made it to npm, I believe we should fix it. Do you think there's someone at Facebook that could assist me in making this on npm?

It did not publish to npm due to tests not being green. This will affect any release cut when tests aren't passing. We'll need to make a decision whether tests failing on Circle should block npm releases or not.

If you want to get this out anyway, I believe commenting out the failing tests out of circle.yml should do the trick.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings