Overview on the limitations

Before moving on to the final part of the module, we need to discuss some other limitations of React-Native-macOS. Whilst some of these are not show-stoppers it is worth mentioning before you dive headfirst into building your app.

Hermes#

Hermes is a JavaScript engine created by Facebook to cut loading times on Android. It does so by storing your JavaScript code as bytecode - this helps by not having to parse it in-device as it can be directly loaded, particularly useful on lower-end android devices and indeed on all platforms where you can ship bundled JavaScript. It should be released soon for iOS (with React Native 0.64), but it is available right now for macOS.

Enabling it is super simple; follow the instructions on the Podfile and uncomment the following line:

Remember always to check the official docs (even though right now they are a bit outdated).

A word of caution! This is very new technology and in my experience there are subtle bugs. I had an issue where it completely froze my app when handling a large number of promises, meaning I had to revert to jscore (the default engine on apple devices). However if you have a very large JavaScript bundle it might help you cut your app's launch time.

Other UI components#

We have seen that small things like hover states are not working quite as expected, but there are other components and APIs that you will need if you ever want to create a more feature-packed app. Listening for keyboard events is limited, and unlike their mobile counterparts, desktop apps require a lot of keyboard interaction. For example I tried building an auto-complete box, but this was a lot of hard work on the native side (manually toggling key listeners and emitting events) and it was impossible to get the caret coordinates within an an input box, so I gave up after a couple of days.

 

This page is a preview of Building React Native Apps for Mac

Start a new discussion. All notification go to the author.