ReNative Documentation

repository·main·Indexed 23 days ago

https://github.com/flexn-io/renative

A unified development platform to bootstrap, develop, and deploy applications across mobile (iOS, Android), web, TVs (tvOS, Android TV, Fire TV, Tizen TV, LG webOS), desktops (macOS, Windows, Linux), and wearables (Android Wear, Tizen Watch) from a single environment. It supports frameworks including React, React Native, NextJS, and Electron through specialized engines like @rnv/engine-rn-electron, @rnv/engine-rn-next, and @rnv/engine-rn-web.

Tokens
28.1K
Snippets
31
Records
206
Agent score
84%

What's inside ReNative

  1. Overview of @rnv/engine-rn-next

    main
    The @rnv/engine-rn-next package is a ReNative Engine designed to build 'next-based' platforms that include React Native support. It allows developers to leverage the ReNative ecosystem to target platforms that utilize the 'next' architecture while maintaining compatibility with React Native components and logic.
  2. Use @rnv/engine-rn-windows to build Windows applications

    main

    The @rnv/engine-rn-windows engine allows you to build Windows applications using ReNative by leveraging the react-native-windows package maintained by Microsoft.

    Important Version Constraint: This engine currently uses React Native Windows version 0.63.4. Although newer versions (like 0.65) may be available, version 0.63.4 is used to maintain compatibility with the react-native-tvos package, as running different React Native versions in parallel within the same environment causes stability issues.

  3. Supported platforms for @rnv/template-starter

    main

    The @rnv/template-starter template is compatible with a wide range of platforms, allowing you to build and test your application across mobile, TV, web, and wearable devices. Supported platforms include:

    • Mobile: iOS, Android, Android Wear, KaiOS
    • TV: tvOS, Android TV, FireTV, Tizen TV
    • Wearables: Tizen Watch, Android Wear
    • Desktop/Web: Web, macOS/OSX, LG webOS
  4. Use @rnv/engine-rn-electron to build Electron platforms

    main

    The @rnv/engine-rn-electron engine allows you to build desktop applications for Electron using ReNative, providing React Native support for the Electron platform. This engine enables the use of React Native components and logic within an Electron-based desktop environment.

    For detailed documentation and advanced configuration, visit the official ReNative documentation at https://renative.org/docs/engine-rn-electron.

  5. Create a new ReNative project with @rnv/template-starter

    main

    To start a new multi-platform project using the @rnv/template-starter template, use the ReNative CLI rnv new command. During the interactive setup process, select @rnv/template-starter when prompted for the template choice.

    This template is designed to demonstrate common mobile and multi-platform app functionalities, including:

    • Navigation: Drawer, Top, Side, Modals, and Pages.
    • Media: Images and Vector Icons.
    • Interactions: Buttons with interactions and state changes.
  6. Start a new ReNative project

    main
    Once the ReNative CLI is installed, you can bootstrap a new project by running the rnv new command. This will initiate the project creation process for a unified development environment supporting mobile, web, TVs, desktops, and more.
    rnv new
  7. Export an App Harness for iOS or tvOS

    main

    To export an App Harness for iOS or tvOS platforms, follow these steps in order:

    1. Decrypt the necessary credentials using the crypto command.
    2. Run the appleSetup hook. Note: You must have fastlane installed on your system before executing this step.
    3. Run the export command specifying the platform and the release type.

    Ensure you replace [platform] with the target platform (e.g., ios or tvos).

    npx rnv crypto decrypt
    npx rnv hooks run -x appleSetup
    npx rnv export -p [platform] -s release
  8. Access file paths via RnvContextPaths

    main

    The RnvContextPaths object provides a structured way to locate files and directories without manual path resolution. It is organized by scope:

    • user: Home and current working directories.
    • dotRnv: Paths to the .rnv configuration directory.
    • workspace: Paths related to the current workspace, including the project and app configuration.
    • project: Paths for the project root, including appConfigBase (fonts, plugins, etc.), builds, assets, and nodeModules.
    • appConfig: Paths for the specific application configuration.
    • buildHooks: Paths to the build hooks source and distribution files.

    Each scope often uses RnvContextPathObj, which provides specific file paths like dir, config, configLocal, and configPrivate.

  9. Use RnvContextRuntime for execution state

    main

    The RnvContextRuntime object within the context provides the operational state required for running tasks. It tracks which engines are available, which plugins are loaded, and specific execution flags.

    Useful properties for developers building plugins or tasks:

    • enginesByPlatform: A map of available engines for specific platforms.
    • plugins: A record of currently loaded RnvPlugin instances.
    • port: The network port used for the current session.
    • targetUDID: The device ID if targeting a specific physical device.
    • skipBuildHooks: A boolean flag to determine if build hooks should be bypassed.
    • isAppConfigured: Indicates if the application configuration is complete.