Giter Club home page Giter Club logo

Comments (19)

JulianKingman avatar JulianKingman commented on April 27, 2024 149

Ah, bummer. I understand how that makes things more standardized, but it's like telling someone "we'll help you build your house faster, you just can't use these brands of doors or windows". react-native link is becoming a pretty standard way to connect libraries, so consider this a feature request :)

from expo.

jesseruder avatar jesseruder commented on April 27, 2024 6

@JulianKingman yeah, we're aware of the advantages of react-native link. Fundamentally we have one binary that's in the App Store and Play Store and so we can't support react-native link for people who are using that binary. If you want custom native code you can use ExponentKit and compile it yourself.

from expo.

JulianKingman avatar JulianKingman commented on April 27, 2024 6

Good point about the binary, I didn't think of that. In that case, maybe it would be helpful to have a list of "exponent-safe" or "exponent-recommended" packages, perhaps searchable/installable via the XDE? I don't know, you guys are doing a great job and it seems like it's just a technical limitation that we have to live with.

from expo.

mannok avatar mannok commented on April 27, 2024 3

I am a Windows developer. Seems Xcode is needed for detach to ExpoKit to run 'react-native link', right?
Can I do it without a Mac / Xcode?

from expo.

andela-cofor avatar andela-cofor commented on April 27, 2024 2

@terribleben does expo allow react-native link react-native-youtube if no why ?

from expo.

jesseruder avatar jesseruder commented on April 27, 2024 2

Please see the docs for ExpoKit @andela-cofor https://docs.expo.io/versions/latest/guides/detach.html. Expo supports react-native link in detached projects.

from expo.

craigcosmo avatar craigcosmo commented on April 27, 2024 2

This answer was updated in 2018

  • Expo supports react-native link if you detach to ExpoKit.
  • If you are looking for the unrelated topic of linking/deep linking, Expo and React Native both support that as well.

.

the links are dead

from expo.

terribleben avatar terribleben commented on April 27, 2024

This answer was updated in 2018

  • Expo supports react-native link if you detach to ExpoKit.
  • If you are looking for the unrelated topic of linking/deep linking, Expo and React Native both support that as well.

(old answer below from Feb 2017)

Hi there! A normal Exponent project is completely written in JS, so there isn't a way to modify native libraries (which is what react-native link does). We designed ExponentKit with the goal of allowing users to address this constraint. So yeah, if react-native link is required for you, you should detach to ExponentKit.

We think many native libraries are better implemented in JS anyway (e.g. loading fonts) so this is also a philosophical choice. The ExponentKit guide talks a bit more about that.

from expo.

terribleben avatar terribleben commented on April 27, 2024

You can already use react-native link. You just need to do it with ExponentKit. What feature exactly are you requesting?

from expo.

JulianKingman avatar JulianKingman commented on April 27, 2024

One way it could work is to have a links property in exp.json, so you could do something like this:

// exp.json
{
  "links": {
    "assets": [ "/assets/font.ttf"],
    "packages": ["native-npm-package"],
  }
}

Then the links would be added to the native bundle. If that's not possible within the exponent app itself, it would still be cool if assets loaded asynchronously within exponent, and then include the native modules to the packaged app.

from expo.

terribleben avatar terribleben commented on April 27, 2024

The "link" in react-native link refers to linking code dependencies. I think you are asking if there is a way to bundle local assets in an Exponent app. In that case, maybe you would be interested in this guide.

If that's not what you're asking, sorry if I'm mistaken!

from expo.

brentvatne avatar brentvatne commented on April 27, 2024

Hi @JulianKingman!

There are a couple of things worth mentioning here:

  • If you want to load your fonts synchronously before displaying your app, you can follow the pattern here: https://github.com/exponent/new-project-template/blob/master/main.js#L30-L70 -- this downloads and caches your font while the splash screen is being displayed, and then renders the app. If you've already downloaded the font (anytime after first load), then it is instant.

  • I think that having an option to bundle assets in the ipa/apk for standalone apps would be valuable so everything you need can be downloaded when you get the app from App/Play Store, we haven't got around to that yet so hopefully downloading and caching while the splash screen is up will work for you!

from expo.

JulianKingman avatar JulianKingman commented on April 27, 2024

@brentvatne that's a cool pattern, I'll give it a shot, and I didn't know about the caching, which is another bonus. I think your 2nd point is right-on, but also linking has broader usages beyond just assets. For example, one of my current projects links these things:

  • assets (i.e. fonts)
  • react-native-fabric (I realize exponent has it's own system for this, but maybe it wouldn't need to)
  • react-native-snackbar (uses native components, behind-the-scenes)
  • react-native-vector-icons
  • realm

These add necessary native code that links their package into the build, extending the built-in react native native functionality (like initializing realm).

from expo.

JulianKingman avatar JulianKingman commented on April 27, 2024

Just to add, this could reduce a lot of overhead for exponent as you wouldn't need built in unique exponent functions for everything (like fabric, facebook, etc... although those are pretty cool as direct exponent extensions.).

from expo.

jesseruder avatar jesseruder commented on April 27, 2024

Yeah that's a good idea. We're definitely open to doing something like that.

from expo.

faustoct1 avatar faustoct1 commented on April 27, 2024

@jesseruder it's not working with RNFetchBlob when running on XDE. It worked when running on Xcode.

from expo.

faustoct1 avatar faustoct1 commented on April 27, 2024

Also the documentation is kind trick. It suggests react-native link should be supported which doesn't mean it is supported.

from expo.

jesseruder avatar jesseruder commented on April 27, 2024

@faustoct react-native link is supported in detached apps. I'd recommend reading these docs: https://docs.expo.io/versions/latest/guides/detach.html

from expo.

faustoct1 avatar faustoct1 commented on April 27, 2024

@jesseruder, worked. Had to recreate my project, move files, then detach with ExpoKit option.

from expo.

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.