Skip to content

About

Fast image loading for React Native

Topics

Resources

Code of conduct

Contributing

Stars

1.0k stars

Watchers

68 watching

Forks

Repository files navigation

TurboImage 2.0 (in development)

New Architecture-only rewrite of react-native-turbo-image. The published package's README is packages/react-native-turbo-image/README.md. 1.x is maintained on the 1.x branch.

Quick start

bun install                         # hoisted node_modules (see bunfig.toml)
bun run check:versions              # manifests agree with scripts/native-versions.env
bun run test                        # JS unit tests (Jest) for src/index.tsx
bun run test:core                   # C++ core + GoogleTest
bun run test:ios                    # Nuke adapter tests on an iPhone simulator
bun run test:android                # Coil adapter and Android view tests on the connected device or emulator
bun run test:ios:view               # iOS view tests, hosted by the example app (after its pod install)

# iOS (CocoaPods)
bun run vendor:nuke                 # builds TINuke.xcframework and TINukeUI.xcframework (Nuke, renamed) from the pinned tag
(cd apps/example/ios && pod install)
bun run example:ios

# Android
bun run example:android             # debug
(cd apps/example && bun run build:android:release)   # R8 release build

After changing the Codegen spec (src/TurboImageViewNativeComponent.ts), re-run pod install: iOS Codegen runs there, not during the Xcode build.

Run the app with cd apps/example && npx react-native start, then launch it from Xcode or Android Studio, or with npx react-native run-ios / run-android.

Releasing

.github/workflows/v2-publish.yml publishes a pre-release (such as 2.0.0-beta.2) under npm's next dist-tag, and a stable version (such as 2.0.0) under latest, which is what npm install react-native-turbo-image installs.

  1. Set the version in packages/react-native-turbo-image/package.json and get that commit through v2 CI (push it to the pull request).

  2. Tag it and push the tag:

    git tag v2.0.0-beta.2 && git push origin v2.0.0-beta.2

The workflow checks the tag against package.json and that v2 CI passed on the commit, builds the Nuke frameworks, and publishes with npm's trusted publishing, which adds a provenance attestation. It then creates a GitHub release for the tag, with notes GitHub writes from the pull requests merged since the previous v2.* tag, so pull request titles are the changelog. A pre-release gets a GitHub pre-release. A stable version gets a full release, marked latest, with notes since the previous stable v2.* tag. To rehearse, run the workflow by hand from the Actions tab: that is a dry run unless told otherwise.

One-time setup on npmjs.com: react-native-turbo-image → Settings → Trusted publisher → GitHub Actions, repository duguyihou/react-native-turbo-image, workflow v2-publish.yml.

About

Fast image loading for React Native

Topics

Resources

Code of conduct

Contributing

Stars

1.0k stars

Watchers

68 watching

Forks

Releases

Packages

Used by

Contributors

Languages