23 ms·
Exponent – Build native apps in JS that work across both iOS and Android
- nbclark 10y agoOn 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.
- audessuscest 10y agoAre you sure you can't use custom RN modules ? That would be.. very surprising.
- nbclark 10y agoI found it surprising too... From the FAQ (https://docs.getexponent.com/versions/v10.0.0/introduction/faq.html https://docs.getexponent.com/versions/v10.0.0/introduction/f...): "But no native modules... The most limiting thing about Exponent is that you can't add in your own native modules. We give you most of the most commonly desired things, but if you need something very custom--like on-the-fly video processing or low level control over the Bluetooth radio to do a firmware update--then Exponent won't work for you and you should just use regular React Native."
- nathancahill 10y agoI wonder why. Seems like a huge oversight.
- jrowley 10y agoWell probably not a small task to support custom modules, and it allows them to get a pretty powerful tool with a nice core set of features out the door relatively quickly. If exponent becomes successful I imagine they'll add support for custom modules.
- brentvatne 10y agoHi 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 terms of upgrades. As great as React Native is, it also moves extremely fast and it can be difficult to keep up with new releases -- a change in React Native might cause several of your native dependencies to break, and you'll need to fork those libraries and fix them if the maintainer isn't keeping on the same schedule as you. Updates with Exponent are as simple as updating JavaScript, which has much less churn and breaking changes than the native side (the React API itself is very mature, the APIs for specific native components may change). Another nice advantage of this is that you can work on an iOS app from Windows and Linux, because you don't need to compile your app with Xcode (we handle builds for you when you want to ship to the app store, before that you can just use the Exponent client). We ship with a bunch of APIs out of the box and are constantly improving them and adding more. We have analytics tools like Amplitude and Segment built in, Maps, Facebook login (working on Google Login), and more: https://docs.getexponent.com/versions/latest/index.html https://docs.getexponent.com/versions/latest/index.html React Native is still very early, though, and Exponent is just a small team of seven, so we understand that we can't possibly expose every API that developers working with the platform might want. So, we are working on a way for developers to be able to still take advantage of the Exponent toolchain and layer on native code. I've written up our approach in more detail here: https://blog.getexponent.com/answered-on-slack-ejecting-from-exponent-154bdca57dc1#.yr55mmqtc https://blog.getexponent.com/answered-on-slack-ejecting-from...
- nathancahill 10y agoI'll dive into your architecture more later tonight, but I'm not clear on why Exponent has to handle exposing specific APIs? Couldn't it work in the same way that React Native doesn't expose specific APIs?
- dcosson 10y agoInteresting 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.
- jameside 10y agoOne thing we're always working on at Exponent is growing our set of native modules (for context, I work on Exponent). We believe you can build a very large set of apps without needing to write custom native code, and that set grows quickly as more libraries are ported from native to JS when possible and as we add more native modules to Exponent. Exponent maintains native modules so they continue to work when React Native changes or when Android & iOS change their APIs. In particular, React Native is released every two weeks and we stay on top of the changelog so you don't have to regarding native modules. We also write native code for both platforms in tandem, often by the same engineer, so that we get coherent APIs that cover common features across both platforms and expose platform-specific capabilities neatly. We want Exponent to feel like a coherent project. All of the docs (and code) for Exponent's modules are in one place, and when you download the Exponent app for development you get all of the native modules right off the bat. As a data point, the Android version of Li.st (https://play.google.com/store/apps/details?id=st.li.listapp https://play.google.com/store/apps/details?id=st.li.listapp) is built on Exponent and was featured by Google in the Play Store. Li.st is currently one of the best examples of how far you can go with Exponent, and React Native for that matter. We're also on Slack (get an invite here: https://slack.getexponent.com https://slack.getexponent.com) if you want to chat in real time.
- joefreeman 10y agoThis looks cool. But are the builds happening remotely on the Exponent servers, or have I misunderstood that? Edit - brentvatne just answered this: "we handle builds for you when you want to ship to the app store, before that you can just use the Exponent client".
- jesseruder 10y agoHey Joe. I work on Exponent. When you're developing you can use Exponent's apps from the App Store/Play Store, so you can get started immediately and let other people test your app easily. Once you're ready to put your app in the stores you start a build using our CLI and we build it on our servers (see https://docs.getexponent.com/versions/latest/guides/building-standalone-apps.html https://docs.getexponent.com/versions/latest/guides/building...). We want to make it easy for people on Windows and Linux to build apps so don't require you to use Xcode or Android Studio. If you don't want the builds to happen on our servers our clients are open source so you can do it yourself if you want (https://github.com/exponentjs/exponent https://github.com/exponentjs/exponent).
- geoka9 10y agoThank you so much for your work! > We want to make it easy for people on Windows and Linux to build apps Is there a Linux version of XDE? I can't seem to find it.
- jesseruder 10y agoWe don't have a binary for Linux yet (keep meaning to do it, want to get to it soon) but building from source works! https://github.com/exponentjs/xde#build-from-source https://github.com/exponentjs/xde#build-from-source
- geoka9 10y agoThat's even better. Thanks again!
- 10y ago
- coldtea 10y agoHmm, they say you can buy an Exponent app through the App Store, and then you can push updates to it through them, and they show up the "next time the user opens the app without having to do through the App Store"? I don't think downloading scripting or native code that changes how an app behaves from outside sources has been allowed on the App Store, so what gives?
- findjashua 10y agoiirc JS changes that don't modify app behavior are allowed to be updated on the fly
- jameside 10y agoA couple of years ago Apple changed the iOS developer terms to say it's OK to download and run JavaScript as long as it's run on the built-in WebKit or JavaScriptCore engine (section 3.3.2 if you're curious). Exponent uses the built-in JavaScriptCore on iOS.
- a-priori 10y agoApple allows updates like this as long as it doesn't substantially change the behaviour of the application. Of course the definition of 'substantially' is, deliberately I think, left open to interpretation. But new features and bug fixes are okay. Swapping out the application entirely and replacing it with another one would not be.
- scsilver 10y agoDo you abstract the Bluetooth modules? How does it interact with adding something like the Facebook SDK?
- jesseruder 10y agoHello! I work on Exponent. We don't support Bluetooth right now but it's high on our priority list. We have docs for Facebook here: https://docs.getexponent.com/versions/latest/sdk/facebook.html https://docs.getexponent.com/versions/latest/sdk/facebook.ht...
- atoko 10y agoSince native modules can't be used with this, what is the difference between this and, say, Appcelerator Titanium?
- jesseruder 10y agoI think Appcelerator Titanium is more comparable to React Native than to Exponent. Here's a post by Brent about the differences between Exponent and React Native: http://stackoverflow.com/questions/39170622/what-is-the-difference-between-exponent-and-react-native http://stackoverflow.com/questions/39170622/what-is-the-diff.... You can join us on Slack if you want to discuss more! https://slack.exponentjs.com/ https://slack.exponentjs.com/ (I work on Exponent)
- deleted 10y ago[deleted]
- brentvatne 10y agoHi all! Thanks for the post! Here are some links to help you check out Exponent and get any idea what it can do -- all you need to do is download the Exponent client from the app / play store and you can open any of these: - Pocketgear - a pokedex app: https://getexponent.com/@rncommunity/pocketgear https://getexponent.com/@rncommunity/pocketgear - A fun little app I've been working on for a few days for an upcoming talk: https://getexponent.com/@community/growler-prowler https://getexponent.com/@community/growler-prowler - An IP Subnet Calculator: https://getexponent.com/@levic92/ipcalc https://getexponent.com/@levic92/ipcalc - The navigation/routing library that we recommend to be used with Exponent: https://getexponent.com/@community/ex-navigation-example https://getexponent.com/@community/ex-navigation-example - A work-in-progress showcase of animations that you can do with React Native / Exponent: https://getexponent.com/@community/animations-showcase https://getexponent.com/@community/animations-showcase - Shared element transitions are possible too: https://getexponent.com/@janic/shared-elements https://getexponent.com/@janic/shared-elements - A showcase of some of the components that you can use with Exponent: https://getexponent.com/@notbrent/native-component-list https://getexponent.com/@notbrent/native-component-list (tap out the ^ icon in the top right) - "Floaty Plane" - a simple game: http://getexponent.com/@exponent/floatyplane http://getexponent.com/@exponent/floatyplane - An experiment to re-create basic Wunderlist UI: https://getexponent.com/@mastermo/wunderlist https://getexponent.com/@mastermo/wunderlist - A pre-launch version of "React Native Playground" in Exponent: https://getexponent.com/@rnplay/rnplay https://getexponent.com/@rnplay/rnplay (just sign in as a guest and go to the Explore tab) - An image gallery example: https://getexponent.com/@community/image-gallery-example https://getexponent.com/@community/image-gallery-example - A Pomodoro app UI: https://getexponent.com/@exponent/pomodoro https://getexponent.com/@exponent/pomodoro - A tab view component demo: http://exp.host/@rncommunity/react-native-tab-view-demos http://exp.host/@rncommunity/react-native-tab-view-demos The largest app on our platform right now is li.st for Android: https://play.google.com/store/apps/details?id=st.li.listapp&hl=en https://play.google.com/store/apps/details?id=st.li.listapp&...
- jain_chirag04 10y agoI have been using exponent libs for almost a year now. They are doing such amazing work. Highly recommended!
- andrewvijay 10y agoIntriguing. But how does exponent make money out of this?
- jesseruder 10y agoHey! I work on Exponent. Basically, we don't make money right now. Our plan is to eventually help developers make money and take some cut of that. We're open source so you'll never be locked in if we start doing anything you don't agree with. We talk about it a little more at https://docs.getexponent.com/versions/latest/introduction/faq.html https://docs.getexponent.com/versions/latest/introduction/fa...
- kapv89 10y agoI am using react-native for my startup too, and we thought of doing something like exponent before going the way we are going now. A great option for exponent, once it reaches a certain level of maturity, can be a new type of browser.
- andrewvijay 10y agoThat's totally cool. You guys seem to do a lot of work for free. Hope you get the money you deserve.
- brentvatne 10y agoTo add on to Jesse's answer, Charlie Cheever (co-founder of Exponent with James Ide) wrote a blog post about this recently: "Exponent is Free" - https://blog.getexponent.com/exponent-is-free-as-in-and-as-in-1d6d948a60dc https://blog.getexponent.com/exponent-is-free-as-in-and-as-i...
- tkinom 10y agoI can easily see FB buy the team and fund them work on this full time. :-)
- satya164 10y agoExponent is super cool. Super simple to start building an app. I wish I could use it for every RN project I work on. The team is very responsive too. Totally recommend.
- phmagic 10y agoCan you elaborate on why you cannot use it for every RN project you work on?
- hackerboos 10y agoI was following the Pluralsight course but it looks like Exponent had a big upgrade a while back. Are the old binaries used on the course still available somewhere?
- ccheever 10y agoOne thing that we do that we think is pretty cool is that we figured out a way to include multiple versions of our SDK (and React Native) in a single binary, so stuff you build with old versions will continue to work. Here are the docs for SDK 10 (based on RN 0.33.0): https://docs.getexponent.com/versions/v10.0.0/index.html https://docs.getexponent.com/versions/v10.0.0/index.html And here are the docs for SDK 9 (based on RN 0.31.0): https://docs.getexponent.com/versions/v9.0.0/index.html https://docs.getexponent.com/versions/v9.0.0/index.html You can use either one. Also, all our stuff is open source, so just go back and find the old release tags on Github if you want older versions.
- hackerboos 10y agoThat's awesome. Will this work with your mobile application? I know that's delivered through the app-store so I assume only the latest version is available there? Sorry I'm new to mobile development...
- ccheever 10y agoThe apps in the App Store/Play Store support multiple versions of our SDK. The current versions support back through March. Not sure which SDK version the Pluralsight course is targeting. It might be easier to follow our docs here: https://docs.getexponent.com/versions/latest/introduction/index.html https://docs.getexponent.com/versions/latest/introduction/in... which will always be up to date.
- latortuga 10y agoThe video says you support Linux for XDE but I don't see[1] a build for it. [1] https://docs.getexponent.com/versions/v10.0.0/introduction/installation.html https://docs.getexponent.com/versions/v10.0.0/introduction/i...
- ccheever 10y agoFor Linux, you have to build it from source. https://github.com/exponentjs/xde#build-from-source https://github.com/exponentjs/xde#build-from-source It's usually pretty smooth to do so.
- vors 10y agoI think it would make sense to provide pre-build packages for few popular distros (Ubuntu, CentOS, Arch). There are some tools that make it much easier, i.e. fpm (https://github.com/jordansissel/fpm https://github.com/jordansissel/fpm).
- jesseruder 10y agoWe're planning on doing an AppImage for Linux since we're using Electron Builder (https://github.com/electron-userland/electron-builder https://github.com/electron-userland/electron-builder). Just haven't had time for it yet!
- vors 10y agoGreat, AppImage is even better!
- aantix 10y agoWhat's the preferred way to test an Exponent based app?
- ccheever 10y agoExponent apps have URLs, so if you have the URL for an Exponent app, you can just download the Exponent developer app from the iOS App Store / Play Store and then open the URL. Ex. Try opening https://getexponent.com/@exponent/floatyplane https://getexponent.com/@exponent/floatyplane from your phone. If you have the source code for the app, just open the project directory in XDE (our desktop software) and it will give you a development URL that you can open in the Simulator or on your phone. In general, testing Exponent apps is way easier than testing apps other ways. We put a lot of time into making it simple.
- brentvatne 10y agoFor unit tests, we prefer Jest. We don't have a preference for acceptance testing, you could use Appium or similar tools for that.
- nikki93 10y agoAlso if you meant automated testing, here's an Exponent app that runs jasmine to test Exponent SDK API end-to-end: https://github.com/exponentjs/test-suite https://github.com/exponentjs/test-suite This is useful for testing network requests, API calls, etc. in your app JS.
- blakeross 10y agoI 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.
- jameside 10y agoThanks Blake, that means a lot coming from you =)
- doozy 10y agoI 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/ https://www.nativescript.org/
- jesseruder 10y ago> 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 https://github.com/facebook/react-native [2] https://github.com/NativeScript/NativeScript https://github.com/NativeScript/NativeScript
- jameside 10y agoA more apt comparison might be React Native and NativeScript--both are frameworks that bridge native APIs to JavaScript. In contrast, Exponent is a mobile environment of which React Native is one piece. Before choosing React Native, we deeply investigated bridging native and JavaScript on our own and one of the ways was a NativeScript-like approach. When React Native was announced we looked at the beta and saw that it exhibited many characteristics we believe are important in a next-gen app framework. We saw that React Native was designed for multicore phones by dividing work across multiple threads, namely application logic (JS), view and text layout (this is significant), and rendering. Other work like image decoding also runs on a separate thread. One reason React Native's multithreading is fantastic is because hardware manufacturers are adding more cores faster than they are improving the performance of those cores, partly because power consumption grows superlinearly with respect to frequency. The React team is also in the early stages of exploring incremental rendering, which may allow us to parallelize React rendering in JS as well as native. So far we're happy we chose React Native for Exponent. There's a lot of interest and activity around it and it's on the right track in several ways.
- jameslk 10y agoThis 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?
- nikki93 10y agoYup! Since our client code is open source, you could run a custom fork of our client that includes the native module(s) you want and still use the JavaScript app code you've written with it. If you end up making such a change let us know and through a pull request or such we could try getting it into standard Exponent!
- brentvatne 10y agoThere 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 Exponent similar to the create-react-app eject command but easier to reverse and to keep receiving updates to Exponent, because it's not an "all-in" kind of eject, you can read more about that here: https://blog.getexponent.com/answered-on-slack-ejecting-from-exponent-154bdca57dc1#.yr55mmqtc https://blog.getexponent.com/answered-on-slack-ejecting-from... (caveat: this feature is still in early development)
- skanga 10y agoDoes it support Bluetooth LE communications?
- zem 10y agoi'm not too familiar with react native - how much support is there for using languages other than javascript (i.e. a compiled-to-javascript language)?
- jameside 10y agoOne of my teammates working on Exponent was experimenting with ClojureScript and got it running, and one of our YC batchmatches wrote their app with ClojureScript and RN. It's still the very early days and I expect compiled-to-JS to get easier to use. Compiled-to-WASM might also be a good option one day.
- zem 10y agoi would be really excited about writing performant mobile apps in clojurescript! i'll see if i can find working examples on google now that i know people have done it.
- The_Hoff 10y agoI've been using https://www.decosoftware.com/ https://www.decosoftware.com/ and like it a lot, but I really like the documentation on the Exponent website. Part of the allure of writing React Native apps for me is that knowing React would make me a more valuable developer. I'm curious to see how comfortable I feel saying "I know React" after using these IDEs long-term.
- brentvatne 10y agoDeco is great! We'd love to get Exponent and Deco playing well together, we've discussed it with their team but haven't had the time yet -- it'll happen one day.
- denver_f_h 10y agoIt's promising. I wonder how different is it from Appcelerator Titanium ? I used it 5 years ago and it converts the written JS into real native code. The downside is that if Apple releases a new set of APIs, you have to wait till the editor (Appcelerator) releases the JS bridge to those new APIs.
- ccheever 10y agoSome of the biggest differences are: (1) Exponent is a free open source project, and we don't try to charge developers to use it. (Titanium is open source now but they try to make money by charging people for premium features--which is totally fine, but just different from what we do) (2) Exponent is based on React Native which is newer and people seem to like better (search Google for blog posts about experiences using React Native and then search Google for blog posts about using Titanium), though I can't actually compare them personally since I don't know that much about the inner workings of Titanium. (3) You can do instant app updates with Exponent since the JS is run on the device rather than being cross compiled to native code. I don't think you can do this with Titanium (though I may be wrong -- they've added a lot of features since I last checked on it)
- el5r 10y agoDoes XDE run on Raspberry Pi? (Or if not, how difficult would it be to port?) It would be a nice hook to introduce people to programming if they could write mobile apps on the Pi.
- ccheever 10y agoI think it should? If you had Linux running on it and a monitor and keyboard hooked up, I can't think of any reason why it wouldn't work. If there are any problems, they would probably be easy to fix. The thing I'd be most worried about is just that some things might run very slow on the Pi.
- jameside 10y agoWe haven't tried but I think it would since XDE is made with Electron and runs on Linux. You might have to use real devices to run your app, though, since the RPi might not be powerful enough to run the Android emulator well and the iOS simulator is Mac-only. I'll have to try out XDE on my RPi sometime tonight.
- jameside 10y agoXDE does run on a Raspberry Pi, this is a photo of it running on my RPi 3: https://i.imgur.com/ZvLtqjR.jpg https://i.imgur.com/ZvLtqjR.jpg. You don't need anything special aside from following the instructions on GitHub to run XDE from source. The RPi hardware is pretty slow for a development machine. I have mine minimally overclocked but the CPU temperature was coming close to 85 °C and it took minutes for the starter project to initially load (after that, the build is cached). On the other hand if all you have is a Raspberry Pi, then Exponent is one of the few ways you can make iPhone apps.
- seabass 10y agoWithout support for native modules, is it at all possible to use something like card.io with Exponent? Also, are there any plans to allow plugins that make use of native modules in the way the core SDK uses them?
- jesseruder 10y agocard.io isn't supported right now, but it's definitely on our list! If you want to use it right now you can send us a PR or just maintain a fork of our clients. We have some plans to allow custom native modules without forking the client but that's probably a few months out. If you join our slack we'll let you know about any updates: https://slack.exponentjs.com/ https://slack.exponentjs.com/
- erpellan 10y agoDoes it allow recording video from the camera?
- jesseruder 10y agoWe support taking images with the camera but no video yet: https://docs.getexponent.com/versions/latest/sdk/imagepicker.html https://docs.getexponent.com/versions/latest/sdk/imagepicker....
- ccheever 10y agoWe want to add video recording support. It's on our list but probably a few months out.
- DenisM 10y agoDoes this support iPad and Android tablets? How about Windows tablet support?
- jesseruder 10y agoWe don't support Windows Phone - just iOS and Android. Android tablets should work. We don't have native iPad support but we're planning on adding it.
- DenisM 10y agoI'm talking about Windows tablet, not Windows phone.
- jesseruder 10y agoAh sorry, misread your comment. The dev tools will run on Windows 10, but the client apps won't. The client apps run on iOS and Android and the dev tools run on macOS, Windows, and Linux.
- dabit3 10y agoI've been building React Native apps since the platform was released. Exponent not only makes the process much easier and approachable, it makes it a breeze to share the final app with your clients or people who you want to test externally. The team at Exponent also contributes a ton to the RN ecosystem as core contributors to React Native and open sourcing a lot of awesome RN components. If you're looking at building cross platform mobile apps I highly recommend checking out Exponent!
- lnanek2 10y agoI 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 run React Native's libraries built for older ABIs like arm v7. Once you get it running despite their poor support for Android CPUs in their native libraries, half the examples and half the dependencies on the web out there crash immediately because they decided you have to import React and Component from "react" instead of "react-native" now. And there's no stack trace at all when it crashes for that error since it crashes before the normal source map functionality that provides them. My company has hundreds of files being used by React Native on iOS, but they are unusable due to this, even hours of search and replace cannot fix it because it is still crashing out, probably due to one of a dozen dependencies. Similarly if you try to use react redux 4 you are screwed, only 3 is supported. Woe be to anyone who upgrades that dependency. As a Java programmer who is used to compile time errors when something is wrong, React Native where it crashes constantly at runtime due to poor platform decisions like forcing developers to use a different package from earlier versions is a tough pill to swallow.
- haberman 10y agoYou had a lot of bad things happen with React Native. But do these bad experiences apply to Exponent also?
- jameside 10y agoExponent mitigates a lot of the problems the OP described partly because it's a coherent, maintained platform that is one of our core competencies and partly because the design of Exponent guides you away from those issues. The Exponent team spends a lot of time working with React Native and several members including myself are also core contributors to React Native so we see many of these issues up close. With Exponent you generally write your entire app in JavaScript. We've found that you can build quite a large set of comprehensive apps with pure JS and the APIs that Exponent provides (https://docs.getexponent.com/versions/latest/sdk/index.html https://docs.getexponent.com/versions/latest/sdk/index.html). We believe that set of apps will quickly grow as Exponent's API grows. Exponent is open-source, though, so if you needed to you could fork it and write your own native code in which case you might need to think about CPU ABIs. But most people developing on Exponent don't need to think about native code or ABIs at all. We also stay on top of React Native's changelog and make sure our APIs keep working when React Native changes. Some of your other third-party dependencies might fall out-of-date but the Exponent API stays current. Also with Exponent there aren't any Xcode or Android Studio workspaces to keep up-to-date. Static type systems for JS like Flow are getting better over time and if enough people use it (or contribute type definitions to https://github.com/flowtype/flow-typed https://github.com/flowtype/flow-typed) more of these runtime errors will become compile-time ones. Parts of the JS ecosystem do move quickly, though, largely because of the proliferation of npm.
- fredliu 10y agoI'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?
- ccheever 10y agoHi- 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 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 https://facebook.github.io/react-native/docs/netinfo.html The complete React Native docs are here: https://facebook.github.io/react-native/ https://facebook.github.io/react-native/ and Exponent specific docs are here: http://docs.getexponent.com/ http://docs.getexponent.com/ For now, Exponent just lets you write things that only use JS, and we make that easy and reliable and straightforward. We actually think this is the best way to write most apps that can be built this way since the code is easier to maintain and works cross platform, and you can do things like instant updates much more reliably when all your code is JS. We're looking at a way you can write Java/Swift/Obj-C extensions for Exponent, but that will take us some time.
- fredliu 10y agoThanks a lot for the explanation. I'll try out exponent and see how far I can go without resolving to native :)
- jameside 10y agoHi 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 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 to you could fork it and write your own native code or make a raw React Native app. We recommend writing pure JS apps if you can, though. At Exponent we write native code so other people don't have to.
- deleted 10y ago[deleted]
- atc 10y agoAhh classic JS - there's a problem with X so I'll write a new framework patching X and call it X.io
- Kiro 10y agoThis looks really nice. I have a question about React Native though. I was under the impression that React Native meant that you could just take your components from your website and build an app out of it. I'v realized that's not the case. What is the benefit of React Native if you can't share the components?
- jameside 10y agoYou can share some components, especially more abstract ones. For example, react-redux creates higher-order components that work with both React DOM and React Native. There's also a project called react-native-web that implements React Native's View components using React DOM's primitive components (https://github.com/necolas/react-native-web https://github.com/necolas/react-native-web). Components aside, you can share your models and data stores, utilities like Immutable.js and lodash, and other environment-agnostic JavaScript. In addition to code, you can share a lot of knowledge like how to write components, structure an app, use npm, and even just write JavaScript.
- Kiro 10y agoWell, you've convinced me. I'm trying this out. Thanks! messutied, you're shadowbanned so I can't reply but thank you for your response!
- messutied 10y agoThe benefit is basically that you build native quality components in Javascript, which saves you from needing to learn new programming languages and frameworks for each platform. Also some components are actually reusable, the custom ones built by RN team, others are platform specific.
- Kiro 10y agoI'm interested in the game example. How is that built exactly? Is the game built in React Native (I presume not) or is React Native just used for UI elements? If so, what is the game built with?
- nikki93 10y agoHey! I made floatyplane. The source code is here: https://github.com/exponentjs/floatyplane https://github.com/exponentjs/floatyplane Here's a video of a talk explaining how the game works: https://www.youtube.com/watch?v=2_KV7Ha_gRk https://www.youtube.com/watch?v=2_KV7Ha_gRk The game runs on Exponent and uses React Native for rendering (as all Exponent apps do). It uses individual `Image` components for each sprite. This gets choppy when you have a lot of sprites so we're experimenting with more performant ways of rendering for games.
- Kiro 10y agoWow, thank you very much! Response from the developer with source code and talk. Couldn't wish for more. Thanks again!
- dvcrn 10y agoCheck 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 https://github.com/drapanjanas/re-natal
- nikki93 10y agoClojureScript 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 https://github.com/tiensonqin/exponent-cljs-template
- dvcrn 10y agoInteresting. Did you use this in the past? How does it perform vs re-natal without exponent?
- nikki93 10y agoIt actually is based on the re-natal code but automatically saves and uses the devserver ip and doesnt need th ios/android native code because it runs in Exponent. Other than that the functionality is the same I think, with the same difference as plain RN vs. Exponent.
- ThaJay 10y agoHow 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.
- gok 10y agoFinally, the performance and language design of JavaScript with the write-once-work-in-one-place of native development.
- lardissone 10y agoI second tablet support.