Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Support RN 0.71.0 - #2419

Merged
Dmitriy Kirakosyan (DmitriyKirakosyan) merged 11 commits into
microsoft:masterfrom
johnf:rn-0.71
Mar 23, 2023
Merged

Dmitriy Kirakosyan (DmitriyKirakosyan) merged 11 commits into
microsoft:masterfrom
johnf:rn-0.71

Conversation

@johnf

@johnf John Ferlito (johnf) commented Jan 13, 2023 •

Copy link
Copy Markdown
Contributor

React native now uses react-native-gradle-plugin, which works a bit differently.

We may need to support the old method as well

#2418

Comment thread android/codepush.gradle Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure if this is correct or if this is where it's supposed to fall into the other side of the if

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

John Ferlito (@johnf) , Does this condition fix something? Do we need it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So the new React Native Gradle Plugin doesn't create a bundle task for debug builds.
So this was failing for me without it.
But this was the first change I made before I fixed the production builds.
It's possible that the else that's complimentary to this code is what's supposed to run in dev.
I'll see if I can do some more testing tomorrow and work out if this stays or now._

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Got it. What about the back compatibility? Should we fallback to old code for older gradle plugin?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Dmitriy Kirakosyan (@DmitriyKirakosyan) I'm about to push some change

Re the debug skip - the new plugin skips creating a bundle in debuggable builds entirely. Which makes sense. I think normally, you would be connecting to metro. I have used a similar code to the new plugin to skip code push in the same way.

The one thing I'm confused about is this code path https://github.com/microsoft/react-native-code-push/blob/master/android/codepush.gradle#L69-L108

For it to execute, bundleJsAndAssets has not to exist, but then in the first line after this else block, we depend on bundle${target}JsAndAssets. So I can't understand how it could have ever worked in its current form. As far as I know, rails would always have included this task.

Is it historical and just hasn't been relevant for a while? I would be tempted to remove it entirely, but I'm not familiar enough to know if that's a good idea.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it. What about the back compatibility? Should we fallback to old code for older gradle plugin?

If you look at the new changes (I discovered that the react config wasn't being pulled in) they are pretty substantial. I think maintaining backward compatibility would be difficult.

Given the 0.71 upgraders suggest switching everything across to the new plugin, I think we avoid backward compatibility and update the table in the Readme (which I've done)

Choose a reason for hiding this comment

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

I've seen other libs drop support for version below 0.71 due to the complexity of maintaining both so it seems reasonable to me

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Am I understanding this right that v8.0.0+ will only support RN v0.71+ on Android? Right now the compatibility table in the README doesn't seem to indicate that if so.

@johnf
John Ferlito (johnf) force-pushed the rn-0.71 branch 3 times, most recently from deded83 to c89c1d8 Compare January 19, 2023 21:35
Mani Ramezan (maniramezan) added a commit to rightoneducation/righton-app that referenced this pull request Jan 22, 2023
Codepush fails to compile on ≥ RN 0.71.0. [PR](microsoft/react-native-code-push#2419) would fix this issue
@Rag0n

Copy link
Copy Markdown

Do you have these warnings when building android?

Bugsnag: unable to find ReactNative bundle task 'bundleReleaseJsAndAssets'
Bugsnag: unable to find ReactNative bundle task 'bundleInternalReleaseJsAndAssets'

@gvillenave

Copy link
Copy Markdown

Can we get this merged?

@memon07

Copy link
Copy Markdown

when can get this merged ? i think this will resolve :app:generateBundledResourcesHashDebug and bundledebugjsandassets not found in the app issues

@MrLibya

Copy link
Copy Markdown

Will this be merged anytime soon ?

@nikilarigela

Copy link
Copy Markdown

Please do it soon

@DisciplineBK

Copy link
Copy Markdown

when can get this merged? Will it be too late?

@memon07

Copy link
Copy Markdown

can you please merge this

@FarukHossain2133

Copy link
Copy Markdown

Also i am facing this same issue after upgrading my react native project in "0.71.3"

@TM-TerryDutton

Copy link
Copy Markdown

I'm also facing this issue following an upgrade to react-native 0.71.3.

@johnf

Copy link
Copy Markdown
Contributor Author

Dmitriy Kirakosyan (@DmitriyKirakosyan) Mikkel Priskorn (@Priskorn) Anything else you need from me to get this merged and roll a release?

@hadnet

Copy link
Copy Markdown

Facing same issue. Merge this please.

Comment thread android/codepush.gradle
Comment thread android/codepush.gradle Outdated
@thewulf7

Copy link
Copy Markdown
Contributor

Can't agree on dropping backward compatibility

@rufat

Copy link
Copy Markdown

For those having this issue and can't wait for merge, I have forked and published a variant of this library: npm install react-native-code-push-next
It supports 0.70.1 and above versions.

@thewulf7

Copy link
Copy Markdown
Contributor

Dmitriy Kirakosyan (@DmitriyKirakosyan) Mikkel Priskorn (@Priskorn) Anything else you need from me to get this merged and roll a release?

bump version in package.json

@sesm

Copy link
Copy Markdown

Can't wait for this to get merged!
Meanwhile anyone interested can test the fix this way:

"react-native-code-push": "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/johnf/react-native-code-push#rn-0.71",

@johnf

Copy link
Copy Markdown
Contributor Author

Evgenii Utkin (@thewulf7)

Can't agree on dropping backward compatibility

On my quick exploration, I couldn't figure out a sensible way to do it. I'm also working on the assumption that most folks follow the reacgt-native upgrade guide and so they'll move to RNGP. If that's not the case we can always add it back later?

Or do you have access to any internal stats? How many react projects on 0.71 are using code push? If it's circa 50 I'd say they are using this patch, if it's more than that then perhaps they have upgraded and are using the old way

@johnf

Copy link
Copy Markdown
Contributor Author

Evgenii Utkin (@thewulf7) Did you remove a bunch of stuff from your review? I have emails for some things regarding kotlin vs java but can't find anything above.

@stefan-schweiger

Stefan Schweiger (stefan-schweiger) commented Mar 21, 2023 •

Copy link
Copy Markdown

Jordan Epps (@jkepps) upgrading from expo 47 to expo 48 (so updating from react-native 0.69 to 0.71) did not have any effect on the behavior of CodePush on iOS for me. If you encounter any specific issues I would suggest to create a minimal reproduction and test with the last officially supported react-native version and the most recent one if there are really any 0.71 related issues.

@johnf

Copy link
Copy Markdown
Contributor Author

Jordan Epps (@jkepps) Only android files are changed as the new release broke android due to changes in the way react native builds using gradle. I'm not aware of any related issues with iOS

@johnf

Copy link
Copy Markdown
Contributor Author

Dmitriy Kirakosyan (@DmitriyKirakosyan) Mikkel Priskorn (@Priskorn) Evgenii Utkin (@thewulf7)

I've taken this as far as I can. I'm using this in production on Android and iOS without issues.

As far as the tests go

  • Android - one broken test in CI, but it works fine when I run it locally.
  • iOS - all the tests that create the code push with metro fail. I'm by no means an iOS developer and can't work out how to get the right logs locally on the device to see what's broken

I, unfortunately, can't spend any more time on this. It will need someone from Microsoft to the community to take it the rest of the way.

@johnf

Copy link
Copy Markdown
Contributor Author

/cc @microsoft/appcenter-fte for further visibility ^^

@akshgods

Copy link
Copy Markdown

For those having this issue and can't wait for merge, I have forked and published a variant of this library: npm install react-native-code-push-next It supports 0.70.1 and above versions.

what is difference than regular one?
do we need to remove older one

@DmitriyKirakosyan
Dmitriy Kirakosyan (DmitriyKirakosyan) merged commit d26464b into microsoft:master Mar 23, 2023
@DmitriyKirakosyan

Copy link
Copy Markdown
Contributor

Folks, we merged the PR even though iOS tests are not passing. The PR doesn't affect iOS part, so this doesn't seem to be a blocker. Anyone is warmly welcome to contribute on the iOS tests.

We're going to merge two more PRs fixing vulnerabilities #2447 #2464 and will prepare a new release.

@johnf

John Ferlito (johnf) commented Mar 23, 2023 •

Copy link
Copy Markdown
Contributor Author

Dmitriy Kirakosyan (@DmitriyKirakosyan) Thanks! My gut feel on the ios tests is that the test template needs to be updated for the new version of react

@MikhailSuendukov

Copy link
Copy Markdown
Contributor

Hi all! react-native-code-push v8.0.0 has been released.

@chj-damon

Copy link
Copy Markdown

finally!!

@gabrielbuzziv

Copy link
Copy Markdown

Using RN 0.64.4 and gettings the same error :/
react-native-code-push 8.0.1

@chj-damon

Copy link
Copy Markdown

8.0.1 only support react-native v0.71 above.

@PratyakshGupta48

Copy link
Copy Markdown

After struggling with this error for 2 days , here is my final takeaway -

  1. Either you downgrade your react-native-codepush version to 7.1.0 or below if using react native version less than 0.71
  2. Or you upgrade your react native version to 0.71 and above if you are using react-native-codepush version 8.0.1 and above.

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.