Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/staydecent/nativescript-preact
Build cross-platform iOS and Android apps using Preact.
https://github.com/staydecent/nativescript-preact
Last synced: 10 days ago
JSON representation
Build cross-platform iOS and Android apps using Preact.
- Host: GitHub
- URL: https://github.com/staydecent/nativescript-preact
- Owner: staydecent
- Created: 2017-06-29T02:07:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-01T23:28:03.000Z (about 5 years ago)
- Last Synced: 2024-09-19T14:12:51.070Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 64.3 MB
- Stars: 99
- Watchers: 5
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NativeScript Preact
This plugin integrates [Preact](https://preactjs.com/) and [NativeScript](https://www.nativescript.org/), allowing you to build cross-platform iOS and Android apps using Preact.
Why? Because I prefer the (P)React pattern of building UIs over what Angular offers, and find that NativeScript has [several technical advantages](https://www.quora.com/What-are-the-key-difference-between-ReactNative-and-NativeScript) over ReactNative.
## Getting Started
1. [Install NativeScript CLI](https://docs.nativescript.org/start/quick-setup)
2. Generate a new repo based on [NativeScript Preact Template](https://github.com/staydecent/nativescript-preact-template/generate)
3. Clone your new repo.
4. `npm install` and `nativescript run android` (or `ios`)## This is Alpha Software!
This is a very early working example, and should not be used for a production app unless you really know what you're doing. I hope to build a side-project using this as well as add unit tests for all NativeScript components.
## How it Works
This was made possible by [undom](https://github.com/developit/undom) library, allowing Preact to rending into a pure JavaScript DOM, within the NativeScript runtime. Currently, I'm shipping a modified undom with basic MutationObserver API implemented which is what nativescript-preact uses to sync changes from the DOM to the NativeScript widgets. I aimed to keep this code generalized (and hopefully small), so the bridge code is easier to maintain and less prone to bugs.
## Get Involved!
[File issues!](https://github.com/staydecent/nativescript-preact/issues) Feel free to post questions as issues here or look for the `#preact` channel on the [NativeScript Slack Community](https://www.nativescript.org/slack-invitation-form).