npm zeego 3.0.1
Zeego 3: New Arch, RN 0.77

latest releases: 3.0.6, 3.0.5, 3.0.4...
6 months ago

Zeego 3 🖱️

Zeego lets you use the same API across iOS, Android and Web to beautiful, native menus.

Today we're releasing Zeego 3, which unlocks new capabilities. This upgrade should be smooth and take a minute or two.

New Features ⚡️

  • Support React Native 0.77
  • Support the React Native New Architecture (on React Native 0.76 and 0.77)
  • Works with Expo SDK 52
  • onOpenChange now works on all platforms including Android (as of 3.0.3)

These features are thanks to the work from @dominicstop and @react-native-menu, the maintainers of the upstream native libraries utilized by Zeego.

The main work around Zeego was testing these changes and adding config updates to make them work.

Fixes

  • onOpenChange now fires properly for ContextMenu and DropdownMenu on iOS, closing #82

Upgrade Guide ⬆️

You have to upgrade a few dependencies to specific versions.

Step 1: Upgrade to Zeego 3

yarn add zeego
# or :
npm install zeego --legacy-peer-deps

Step 2: Upgrade native dependencies

yarn add @react-native-menu/menu@1.2.2 react-native-ios-context-menu@3.1.0 react-native-ios-utilities@5.1.2

The exact versions are extremely important. Make sure you don't have version mismatches.

Step 3: Rebuild your native app

The instructions to do this vary based on your app. But if you're using Expo with Continuous Native Generation, then you should:

Set expo.newArchEnabled = true in your app.config.json, and then:

npx expo prebuild --clean
npx expo run:ios # or run:android

That's it.

You should now be able to use Zeego 3 in your native app.

Breaking changes

There shouldn't be any breaking changes to your usage of Zeego in v3, though there may be breaking changes for which versions it's compatible with:

  • Zeego 3 works with React Native 0.76, React Native 0.77, Expo SDK 52+, and the New Architecture
  • Zeego 2 was tested with Expo SDK 52 and lower without the new architecture

Should I upgrade?

You should upgrade if you are using the New Architecture, or if you are using a newer version of React Native which has issues installing Zeego's native dependencies.

Looking forward to Zeego v4 🔜

I originally started by rewriting Zeego internally in native code directly using SwiftUI and Jetpack Compose. However, I've opted to leave that out for v3 and continue exploring it for v4. While the native rewrite offered many benefits, it had some drawbacks:

  1. it won't work before Expo SDK 53 is released
  2. some features won't work with SwiftUI, like ContextMenu.Auxiliary

I also surveyed on Discord and at #133 and people seem to rely on the Zeego APIs pretty heavily, so I didn't feel ready to deprecate these quite yet.

However, it would also come with significant benefits for composition since each Zeego component would map to a SwiftUI View rather than getting parsed into an array in JS at render time. This direction might still make sense for a future major version, though it would involve many breaking changes and a slimmed down feature set. The rewrite used a canary of Expo Modules Core to implement SwiftUI support.

You can see the original Zeego 3 PR here, which may get repurposed for Zeego 4. Android support has not started as part of that PR; only iOS.

For now, I decided to stick with our existing native dependencies since they're working great.

Don't miss a new zeego release

NewReleases is sending notifications on new releases.