Coder Social home page Coder Social logo

Comments (9)

jbroma avatar jbroma commented on September 22, 2024 1

Hey @vlack-coder

As stated in the docs: Officially, CodePush is only supported if you're not using Code Splitting..

We have a guide on how to get it to work here, but I'm not sure how up to date that info is. Give it a try if you haven't already.

Summoning @RafikiTiki as I believe he did some experiments with CodePush not that long ago

from repack.

vlack-coder avatar vlack-coder commented on September 22, 2024 1

Thanks @jbroma . it's working... sorry for being a cry baby here. it's a skill issue, my bad. And the doc kinda added cache invalidation with codepush which confused me

So this is the normal script to run when you push to app center.
appcenter codepush release-react -a ajims119-gmail.com/rapckA

under the scene, it runs node_modules/.bin/react-native bundle

So I created the bundle with repack like the repack Docs suggested using
npx react-native webpack-bundle --platform android --entry-file index.js --bundle-output ./CodePush/index.android.bundle --assets-dest ./CodePush --dev false

Then pushed to appcenter specifying that bundle.
appcenter codepush release -a ajims119-gmail.com/rapckA -c ./CodePush -t 1.0

Thank you for you time

from repack.

vlack-coder avatar vlack-coder commented on September 22, 2024

I'm providing a repo for reproduction with:

  • Fresh React Native installation (0.72.5)
  • I installed codepush and React native progress (to show the progress of the OTA downloaded)

Repo - https://github.com/vlack-coder/repack_codepush

Observation

When there's no url in createURLResolver before pushing OTA to app center, it works fine.

from repack.

vlack-coder avatar vlack-coder commented on September 22, 2024

Hi @jbroma , I'm aware of the guide of using CodePush with Code Splitting but I don't understand step 5 to 7 of the guide
image

from repack.

vlack-coder avatar vlack-coder commented on September 22, 2024

@RafikiTiki is there a way to go about this? Thank you

from repack.

jbroma avatar jbroma commented on September 22, 2024

@vlack-coder this steps describe a way to invalidate repack cache and cause it to fetch new versions of the scripts instead of reusing the stored ones (cache checks the request parameters when resolving scripts).

Instead of steps mentioned there, you can use shouldUpdateScript mechanism introduced in #287 (please see the PR description to understand how it works).

from repack.

jbroma avatar jbroma commented on September 22, 2024

Note: this is a good candidate for update in the docs

from repack.

vlack-coder avatar vlack-coder commented on September 22, 2024

@jbroma I'm aware of cache invalidation but in my case, I'm not trying to invalidate the mini app cache.
I'm trying to update the host app bundle with what comes from codepush.

And I think the problem is the command that appcenter uses to create a bundle to push to appcenter...
So it creates this bundle with metro instead of webpack... Because the error I'm getting is of this nature -
ReferenceError: Property '__webpack_require__' doesn't exist, js engine: hermes, stack:

from repack.

jbroma avatar jbroma commented on September 22, 2024

@vlack-coder I'm not familiar with CodePush setup tbh, what command are you using?

from repack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.