Giter Club home page Giter Club logo

Comments (9)

jliebrand avatar jliebrand commented on May 24, 2024

sorry I should have noted this is running on my iPad

from react-native-threads.

jliebrand avatar jliebrand commented on May 24, 2024

ps. I also verified that log message does indeed come from the ThreadManager.m:24

from react-native-threads.

jliebrand avatar jliebrand commented on May 24, 2024

Think I found the problem... In RCTBundleURLProvider.m:

- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackResource:(NSString *)resourceName
{
  resourceName = resourceName ?: @"main";
  NSString *packagerServerHost = [self packagerServerHost];
  if (!packagerServerHost) {
    return [[NSBundle mainBundle] URLForResource:resourceName withExtension:@"jsbundle"];
  } else {
    NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot];
    // When we support only iOS 8 and above, use queryItems for a better API.
    NSString *query = [NSString stringWithFormat:@"platform=ios&dev=%@&minify=%@",
                       [self enableDev] ? @"true" : @"false",
                       [self enableMinification] ? @"true": @"false"];
    return [[self class] resourceURLForResourcePath:path packagerHost:packagerServerHost query:query];
  }
}

That bit of code will default to 'main.jsbundle' if there is no packagerServerHost. Not sure how this would ever work for release/production for the thread bundle?

(this is running "react-native": "0.49.1")

from react-native-threads.

jliebrand avatar jliebrand commented on May 24, 2024

oh wait... it just means the ThreadManager needs to pass the thread name along as the fallbackResource? Let me try that

from react-native-threads.

jliebrand avatar jliebrand commented on May 24, 2024

Ok getting somewhere..
1- needed to change the production script to --bundle-output ./ios/navigator.jsbundle
2- needed to edit the ThreadManager to pass the name of the thread to the fallbackResource

That now at least tries to load the correct bundle!

(but it now crashes with EXC_BAD_ACCESS on RCTImageLoader - no idea if that is related or not)

from react-native-threads.

jliebrand avatar jliebrand commented on May 24, 2024

That exception appears to be a red herring... refreshing did the trick.

I'll see if I can put together a PR for the ThreadManager

from react-native-threads.

Traviskn avatar Traviskn commented on May 24, 2024

@jliebrand Thanks for figuring all this out! You're right, the wrong file gets loaded in release mode 🙈 I'll go over your PR's now

from react-native-threads.

Traviskn avatar Traviskn commented on May 24, 2024

fixes are merged! thanks again for the help

from react-native-threads.

jliebrand avatar jliebrand commented on May 24, 2024

NP

from react-native-threads.

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.