{"id":13687568,"url":"https://github.com/reflex-frp/reflex-native","last_synced_at":"2025-04-28T07:31:13.538Z","repository":{"id":70207131,"uuid":"137522159","full_name":"reflex-frp/reflex-native","owner":"reflex-frp","description":"Framework for writing fully native apps using Reflex, a Functional Reactive Programming library for Haskell.","archived":false,"fork":false,"pushed_at":"2018-11-11T05:51:38.000Z","size":119,"stargazers_count":43,"open_issues_count":0,"forks_count":4,"subscribers_count":39,"default_branch":"develop","last_synced_at":"2025-04-22T16:37:12.445Z","etag":null,"topics":["frp","functional-reactive-programming","haskell","reactive","reflex-frp"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reflex-frp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-06-15T18:56:03.000Z","updated_at":"2024-04-06T02:54:13.000Z","dependencies_parsed_at":"2023-03-01T00:45:59.199Z","dependency_job_id":null,"html_url":"https://github.com/reflex-frp/reflex-native","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflex-frp%2Freflex-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflex-frp%2Freflex-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflex-frp%2Freflex-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reflex-frp%2Freflex-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reflex-frp","download_url":"https://codeload.github.com/reflex-frp/reflex-native/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251271123,"owners_count":21562496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["frp","functional-reactive-programming","haskell","reactive","reflex-frp"],"created_at":"2024-08-02T15:00:56.763Z","updated_at":"2025-04-28T07:31:12.476Z","avatar_url":"https://github.com/reflex-frp.png","language":"Haskell","readme":"## Reflex Native\n\n### Fully native apps using Reflex\n\n_Caution:_ This README contains forward looking statements. See [the project status](#project-status).\n\nReflex Native is a framework for writing fully native apps using [Reflex](https://github.com/reflex-frp/reflex/), a\n[Functional Reactive Programming](https://wiki.haskell.org/Functional_Reactive_Programming) library for Haskell.\n\nIt provides a [cross-platform layer](#cross-platform) on top of several platform specific libraries for writing components and applications which run on iOS\nor Android fully native with little to no compromise in resulting app quality - that is, executing as native ARM binaries and using the platform's UI toolkit,\nno JavaScript runtime nor web views.\n\n### iOS prerequisites\n\nReflex Native UIKit and apps that use it can only be built on a Mac with Xcode installed at `/Applications/Xcode.app` with an iPhoneOS SDK of the version that\n`reflex-platform` expects, currently 10.2.\n\nYou can get this version by downloading Xcode 8.2.1, unpacking it, and copying\n\n`Xcode 8.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk`\n\nto\n\n`/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk`\n\nYou don't need to actually use Xcode 8.2.1, but that's the version of Xcode that has the 10.2 SDK in it.\n\n### Android prerequisites\n\nTBD :'(\n\n### Getting started\n\nFirst, see [the project status](#project-status) for cautions about the current immature state of this project.\n\n#### Building the examples for iOS\n\nUse `nix-build` with the derivations under `examples` in `default.nix`, for example `nix-build -A examples.ios.draggy` to build `examples/draggy` as an iOS app.\n`nix-build` by default makes a link to the build result called `result`, and the apps include packaging and deployment scripts, so continuing the example you\ncould deploy the draggy example app to an attached iPhone using `result/bin/deploy \u003cteam\u003e` where `\u003cteam\u003e` is your Apple developer team ID.\n\n#### Building the examples for Android\n\nTBD :'(\n\n#### Using in your own project\n\nTBD :'(\n\n### Developing Reflex Native itself\n\ntl;dr: use `make host`, `make android`, or `make ios`.\n\nShells are provided for each of the platforms as attributes in `default.nix`:\n\n* `shells.host` for headless UI testing and the cross-platform components only.\n* `shells.ios` for iOS and the cross-platform components. See [iOS preqrequisites](#ios-prerequisites).\n* `shells.android` for Android and the cross-platform components.\n\nYou can enter each of these with `nix-shell`, e.g. `nix-shell -A shells.ios`, and then use `cabal new-build` to do incremental builds within the shell.\n`cabal new-build` uses a project file to determine what packages to build and any configuration overrides to use when building them, and one is provided for\neach platform:\n\n* `host.project`\n* `ios.project`\n* `android.project`\n\nSo for example to do an incremental build of the iOS components:\n\n1. `nix-shell -A shells.ios`\n2. `cabal --project-file=ios.project --builddir=_build/ios/dist new-build all`\n\nHowever as a development environment this leaves some things to be desired:\n\n* It's tedious to type every time\n* It doesn't work well with editor build functions which are typically not running inside the `nix-shell`\n* `nix-shell` takes a few moments to start even when it has nothing to build (exacerbating the previous issue)\n\nSo, a `Makefile` is provided with targets for each platform which also builds each shell once and caches the environment.\n\nMake targets:\n\n* `make host` makes `_build/host/shell` by caching the `shells.host` `nix-shell` environment and runs\n`cabal --project-file=host.project --builddir=_build/ios/dist new-build all` in that environment. `host` is also the default Make target.\n* `make ios` and `make android` do the same for iOS and Android respectively.\n* `make all` is equivalent to `make host ios android` in the unlikely circumstance your machine is capable of building all platforms.\n* `make clean` removes the `_build` directory where all the intermediate build products go.\n\n### Cross-platform\n\nReflex Native provides a cross-platform view building abstraction which allows components to be written once and operate identically across the supported\nplatforms. This abstraction is intentionally conservative; any functionality which can't be equally supported should not be in the cross-platform abstraction.\n\nAny substantial app requires some amount of platform-specific behavior, such as varying navigation, platform-specific functionality or libraries, or\nspecializations to fit the platform's native look and feel. To that end, Reflex Native is intended to provide the cross-platform tools to write components that\nwork everywhere but the overall app is intended to be platform-specific and reuse the cross-platform components.\n\nUsing a combination of platform-specific code, cross-platform code, and Haskell's excellent features for reuse you can assemble an app with maximum code sharing\namong platforms while avoiding the uncanny valley of cross-platform apps; views created either using the platform-specific `reflex-native-*` or cross-platform\n`reflex-native` packages create and maintain actual platform views and not simulacrums, and the platform-specific code you write can complete the product.\n\n### Project status\n\nThis project is in its very early stages and is probably not suitable for building a production application on immediately. In particular:\n\n- It has not been thoroughly tested, nor been used in a production application yet.\n- Android support is still missing.\n- Cross-platform layout support is still TODO.\n\nIt is being open sourced early in order to foster community involvement or in the hopes that it will be useful, and is still under active development. If you're\ninterested in building an application using it, please [contribute](CONTRIBUTING.md)! We're actively soliciting volunteers to work on it and make it better.\n\nAs it's in active development this README talks about intended features as if they exist, most notably Android support.\n\n","funding_links":[],"categories":["Haskell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freflex-frp%2Freflex-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freflex-frp%2Freflex-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freflex-frp%2Freflex-native/lists"}