Giter VIP home page Giter VIP logo

rubycoder / re-start Goto Github PK

View Code? Open in Web Editor NEW

This project forked from react-everywhere/re-start

0.0 2.0 0.0 289 KB

react-native template to target multiple platforms :globe_with_meridians: :iphone: :computer: with single codebase.

Home Page: https://medium.com/@amoghbanta/write-once-use-everywhere-with-react-native-d6e575efe58e#.nfl50gwfg

License: MIT License

JavaScript 86.53% HTML 13.47%

re-start's Introduction

re-start 🌐 πŸ“± πŸ’»

PRs Welcome

re-start (1).png

Aim of this

  • Target multiple platforms (Android, iOS, Web, Windows[UWP] and Electron[macOS, Ubuntu, Windows]) with react native' APIs and a single codebase.
  • Follow best practices while doing the above.
  • Cut out the time and effort it takes to setup the project (based on create-react-app).
  • Achieve 'Write once use everywhere' with react-native (though react strictly says 'Learn once use anywhere').
  • Mitigate git cloning or manual upgrading of boiler plates, which is possible because this project is a react-native template. πŸŽ‰

Structure of the project:

  • This project comprises of several templates that are curated keeping in mind the various use cases of initiating a new project. Based on your requirements and preferences, you can choose a templates that suits your you case the best.
Template Name Description Installation Command Version
re-base The most basic version that runs on all platforms react-native init <Your Project Name> --template re-base npm version
re-dux re-base with redux wired out of the box react-native init <Your Project Name> --template re-dux npm version
re-route re-base with react-router wired out of the box react-native init <Your Project Name> --template re-route npm version
re-start re-base combined with redux and react-router react-native init <Your Project Name> --template re-start npm version

Usage

Pre-requisites:

Node.js & npm on your system(follow this)
react-native CLI (npm install -g react-native-cli)

All you have to do is:

  • Create a new react-native project using react-native-cli and specify this project as a template:
react-native init <Your Project Name> --template <Template Name>
  • Since react-native-template does'nt support adding dev dependencies and custom scripts to package.json, so I have created a custom script to do that.
node scripts/additionalDependencies.js

Notes:

  • If the above script fails due to some reason, you can do it manually by copying the contents of devDependencies.json to your package.json's devDependencies object and adding following to the scripts object.
"web": "node scripts/start.js",
"build": "node scripts/build.js"
  • react-native-web currently (20th of July, 2017) supports React/ReactDOM 15.4, 15.5, or 15.6, so make sure you do not upgrade if you want support for web.
  • make sure that the version of react-native-windows is same as your react-native version, if you are targeting windows support.

Run the project on a specific platform:

Android

react-native run-android

iOS

react-native run-ios

Web

npm/yarn run web

Windows

react-native windows react-native run-windows

Desktop (Electron)

npm/yarn run electron

Build for production:

Android/iOS

This will help

Web

npm/yarn run build (this will build your production ready bundle)


Some very useful cross platform compatible libraries:


Progress:

  • support for web (react-native-web)
  • support for Windows (react-native-windows)
  • Support for electron
  • Compatibility with React 16
  • Add Docs and FAQs
  • Configure Travis and Greenkeeper
  • Interactive CLI to create templates and components

Running demo on Web, Android, iOS, Windows(Universal) and Electron:


Contributors

Thanks goes to these wonderful people (emoji key):


Amogh Banta

πŸ’» 🎨 πŸ“– πŸ› πŸ€” ⚠️

JesΓΊs LeganΓ©s-Combarro

πŸ’» πŸ€” πŸ› ⚠️ πŸ‘€ πŸ“–

Ankit Popli

πŸ‘€ πŸ€” πŸ›

Christopher Hein

πŸ“– πŸ›

DuncanMacWeb

πŸ’»

Full list of contributors can be found here.

Companies that contribute to re-start's development:

LICENSE

MIT

re-start's People

Contributors

amoghbanta avatar amoghmalik avatar piranna avatar uhve avatar christopherhein avatar duncanmacweb avatar ergenekonyigit avatar prayagverma avatar greenkeeper[bot] avatar

Watchers

Wayne Vucenic avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.