Live data from Hacker News

Exponent – Build native apps in JS that work across both iOS and Android

getexponent.com

101–110 of 119 posts

Re: Exponent – Build native apps in JS that work across both iOS and Android

#101
post #2

On the one hand I like this, as it adds in more shared functionality across both iOS and Android out of the box (maps for example). On the other hand, I believe this also breaks the ability to add in custom RN modules, which is part of the reason I enjoy it. Would love to see some of this getting folded back into react native core.

Hi there! I work on Exponent. We intentionally chose to not let users drop down to native -- the idea of having an interpreted language that sits on top of a native runtime on multiple platforms is not a new one, and it allows for so many benefits that you lose out on if developers can add arbitrary compiled code with direct access to system APIs. Additionally, there is a significant value-add of using Exponent in te…

Interesting choice, and thanks for the detailed explanation.

Sounds like at the end of the day it comes down to Exponent being committed to the user never having to build their own app. I can see that being interesting a to a single dev, or a small app or someone new to mobile development, but to be honest I don't think I could justify using Exponent at a company. On any reasonably experienced team of developers, building an app when native components change or distributing it with something like hockeyapp is not very difficult, so I just wouldn't trade the flexibility of being able to do tricky parts directly in native code for not having to build the app.

Re: Exponent – Build native apps in JS that work across both iOS and Android

#102
post #97

Check out re-natal [0] if you are interested in using react native with clojurescript. Re-frame (cljs's redux?) and reagent (cljs's react wrapper) are a joy to use and clojurescript with REPL is something I'd pick over plain JS almost any day. Give it a try! It's pretty solid. [0]: https://github.com/drapanjanas/re-natal

ClojureScript along with re-frame/reagent/etc. can actually be used with Exponent too! "lein new exponent my-project" creates an exponent project, ready with figwheel for live REPL. The template can be found here if you want to just read it online: https://github.com/tiensonqin/exponent-cljs-template

Re: Exponent – Build native apps in JS that work across both iOS and Android

#103
How about vector icons, barcode scanning and playing sound? At the moment I'm using:

  react-native-vector-icons
  react-native-sound
  react-native-barcodescanner
  react-native-camera
and did not find docs on those features yet. This does look interesting but I'll stick to vanilla react-native for now.

Re: Exponent – Build native apps in JS that work across both iOS and Android

#105
post #70

I tested out React Native on Android the other day and it was a real disaster. It doesn't compile for all the CPU ABIs (instruction sets) we have, so if you have native libraries for x86 or arm 64 in your app it immediately breaks it completely. You have to remove all your own libraries for unsupported architectures, then modify your build not to include them, then depend on those platform's compatibility features to…

Why is the top comment on every story a negative one? Is nothing good anymore?

No idea but I'm really tired of all the negativity on here. Not even the noblest of projects escape, the negativity still finds a way. Every time I open the comments I think "ok, let's see what the HN crowd complains about this time" and I'm seldom surprised.

Re: Exponent – Build native apps in JS that work across both iOS and Android

#106
post #42

This looks very interesting, but I'd like to know that if I ever did need to fall back to native APIs, I could keep the code I've written using Exponent's APIs still (even if that means I couldn't use the convenient build tools anymore). Is this possible?

There are a few of ways to do this right now: - Fork the Exponent client and add your native API. - Try to get a patch into upstream. - If it's not urgent, ask us if we plan to implement it and if it seems like a common enough use case we would add it to our roadmap. - Go into the Exponent source and copy whatever native code you need into a new React Native project. We're also working on a way to "eject" from Expone…

Does it support Bluetooth LE communications?

Re: Exponent – Build native apps in JS that work across both iOS and Android

#107

I know lots of platforms-of-the-month come through HN, and it's hard to filter the signal from the noise...just wanted to add another voice that Exponent is indeed awesome. Built by one of the sharpest (and most humble) teams in the valley.

I suggest NativeScript as an alternative that's very similar in scope but far more mature, definitely not a platform-of-the-month. The latest version is built on top of TypeScript and Angular 2 instead of React Native like Exponent.

I wonder why we don't hear that much about them in HN.

https://www.nativescript.org/

Re: Exponent – Build native apps in JS that work across both iOS and Android

#108
post #107

I know lots of platforms-of-the-month come through HN, and it's hard to filter the signal from the noise...just wanted to add another voice that Exponent is indeed awesome. Built by one of the sharpest (and most humble) teams in the valley.

I suggest NativeScript as an alternative that's very similar in scope but far more mature, definitely not a platform-of-the-month. The latest version is built on top of TypeScript and Angular 2 instead of React Native like Exponent. I wonder why we don't hear that much about them in HN. https://www.nativescript.org/

> I suggest NativeScript as an alternative that's very similar in scope but far more mature

NativeScript has been around longer than React Native (at least for Android), but going by Github activity (not the greatest metric, but not aware of a better one) React Native[1] is much more active than NativeScript[2].

Some differences between Exponent and NativeScript:

- Exponent supports building iOS and Android apps on macOS, Windows, and Linux. With NativeScript you need a Mac to build iOS apps.

- Exponent also allows you to push updates to published apps, while publishing with NativeScript is identical to publishing regular iOS and Android apps.

[1] https://github.com/facebook/react-native [2] https://github.com/NativeScript/NativeScript

Re: Exponent – Build native apps in JS that work across both iOS and Android

#109
post #82

I've ran through most of the intro doc, but I'm still not sure if Exponent supports invoking platform/system APIs? E.g. if I want to access clipboard contents, or wifi network configuration, etc, how can it be done with Exponent? With React Native, I can write corresponding functionalities using Java or Swift/ObjC, and then integrate it with the RN main app, but how can this be done with Exponent?

Hi- Exponent exposes all of the React Native built-in APIs which encompass a lot of what you're asking about. For example, here is the Clipboard API: https://facebook.github.io/react-native/docs/clipboard.html Wifi network configuration is more complicated, but there are some things exposed like "NetInfo" which lets you know the current state of connectivity. https://facebook.github.io/react-native/docs/netinfo.html…

Thanks a lot for the explanation. I'll try out exponent and see how far I can go without resolving to native :)

Re: Exponent – Build native apps in JS that work across both iOS and Android

#110
post #82

I've ran through most of the intro doc, but I'm still not sure if Exponent supports invoking platform/system APIs? E.g. if I want to access clipboard contents, or wifi network configuration, etc, how can it be done with Exponent? With React Native, I can write corresponding functionalities using Java or Swift/ObjC, and then integrate it with the RN main app, but how can this be done with Exponent?

Hi Fred, I work on Exponent. With Exponent you write just JavaScript. In addition to most of the APIs that come with React Native, Exponent provides several APIs ( https://docs.getexponent.com/versions/latest/sdk/index.html ) and we're steadily adding more. If there's a native API we don't have yet that developers need, they tell us about it and we add it to our roadmap. Exponent is open-source, too, so if you needed…

This is great, good to know the options are there, can't wait to try it out!
Post reply on HN