Coder Social home page Coder Social logo

react-everywhere / re-start Goto Github PK

View Code? Open in Web Editor NEW
1.3K 48.0 85.0 492 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 84.36% HTML 9.47% Shell 6.17%
react-native cross-platform starter-kit boilerplate react electron android iphone

re-start's People

Contributors

alexxnica avatar amoghbanta avatar amoghmalik avatar christopherhein avatar duncanmacweb avatar ergenekonyigit avatar geminiyellow avatar greenkeeper[bot] avatar miguelocarvajal avatar nik9839 avatar piranna avatar prayagverma avatar uhve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

re-start's Issues

Sponsors section?

The commits I have done recently on re-start is related to my work on http://www.quantum-ba.com/, so what about adding a section of "sponsors" and/or "companies using re-start" so we give them some credit? :-)

Add re-start as dependency

Add re-start as dependency on the template so it can be able to find updates on the template itself. This would allow to add a script that updates the dependencies or add new ones, like the èlectron` one that was added recently.

Update to React 16

React 16 has been published just yesterday and several dependencies has upgraded to be uptodate. Update the template so we can use the latests features.

is there is bugs in initial project?

In the main web index.js

import {
    Platform,
    StyleSheet,
    ReactNative,
    Text,
    View
} from 'react-native';
....
ReactNative.render(<App />, document.getElementById('root'));

is this a bug in the code or Im missing somthing??!

the web code didn't run until I changed the index.js to this =>

import ReactDOM from 'react-dom'; ... ReactDOM.render(<App />, document.getElementById('root'));

also the app.js component had ReactNative as an import too and didnt include any export?!

Is this bugs or Im missing somthing?!

RFC: Flow support

Willing to add flow support for this project. Will a PR for it be welcome?

Tested dependencies

Hi,
Thank you for your awesome work !
I need to build a cross-platform app and your project seems to be the perfect boilerplate to start.
I just have issues with react versions, [email protected], [email protected] || 15.5.x, react-native@~0.42.0, I become crazy.
Please, can you clarify which version to use, as of now, I can't make re-start working out of the box.
Thank you very much again for your work !

`npm run build` fails

$ npm run build

> babel-node tools/build.js

sh: babel-node: command not found

$ npm install -g babel-cli solves that. But now there's no tools/build.js file

Proposal: React Navigation Vs React Native Flux Router / React Router

Seems like the new https://github.com/react-community/react-navigation project could replace the need for the multiple handling of navigation in https://github.com/amoghbanta/reactNativeEverywhere/tree/master/src web integration is documented here - https://reactnavigation.org/docs/guides/web

Still new but curious if this would help reduce duplication. As well redux integration seems to flow a bit better than with react-native-flux-router

Thoughts?

`react-native-web` version is too old

Environment

  • template name : re-start
  • template version : (0.3.2)
  • react-native version: (0.55.2)
  • react-native-web version: (0.1.13)
  • OS : (osX)
  • Platform causing error: (web)

The problem

$ ncu
> react-native-web                                 0.1.13  →         0.6.0 

Expected Results:

Please update to the latest version. thank you.

UI library for cross platform

Hello,

I can't find any info about compatible UI library for react-everywhere.
Do you only use style to customize your ui ?

Thank you in advance for your answers.

Please consider a license change to MIT

Please consider changing the license from GPL to MIT (as React and React Native)

Since we'd be using this template as a basis for a project, I'm pretty sure anything you'd work on from it, would inherit the GPL license. Hence, this is not usable for companies that aren't willing to open-source their apps.

I might be overly cautious and I don't have a legal degree, but this would ease my nerves.

Add support for Electron

Add support for Electron as a target platform. According to this tutorial seems Electron apps can be heavily based on the web ones, being main difference the usage of non-relative-protocol URLs, that could be easily checked and change before building the Electron bundle.

re-base

Now that we are going to have support for React16 and usage of react-scripts, I think it would be a good moment to modularize and stabilice the project.

My propose is to create a re-base project that's a streamlined version of re-start, that only has the barebones to do a multi-platform project. No redux, no redux-router, nothing: just only the react-native dependencies for each platform and the scripts to generate the different versions. Later, re-start would depend on this re-core project and still offer the current basic template. This would allow people to create their own templates that fit best to their workflows, for example I would do one that includes react-native-material-ui and redux-offline already configured :-)

Project renaming help

This project is an amazing start for my project! Thank you so much!

I'm wondering if you may be able to provide a list of files that would need to be changed if we wanted to name our project something other than reactNativeEverywhere

Command failed: yarn add [email protected]

Step 1: Are you in the right place?

I hope.

Step 2: Describe your environment

  • template version : 0.44.2
  • react-native version: 0.44.2
  • OS : Windows 10
  • Platform causing error: all
  • react-native-cli version: 5.5.1
  • yarn version: 1.3.2
  • node.js version: 8.9.0
  • npm version: 5.5.1

Step 3: Describe the problem (try to include screenshots):

When trying install this by command
react-native init MyProjectName --template everywhere --version="0.44.2"
I'm getting error - see below.

Steps to reproduce:

  1. run command react-native init MyProjectName --template everywhere --version="0.44.2"
  2. get error:
error An unexpected error occurred: "EPERM: operation not permitted, copyfile 'C:\\Users\\Home\\AppData\\Local\\Yarn\\cache\\v1\\npm-react-native-0.45.1-b3283c4a88233421f9c662a2ff1a4ccc8a9f07c0\\local-cli\\templates\\HelloWorld\\android\\gradle\\wrapper\\gradle-wrapper.jar' -> 'D:\\Projects\\Git\\Finance.Mobile\\mobile\\node_modules\\react-native\\local-cli\\templates\\HelloWorld\\android\\gradle\\wrapper\\gradle-wrapper.jar'".
info If you think this is a bug, please open a bug report with the information provided in "D:\\Projects\\Git\\Finance.Mobile\\mobile\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
warning " > [email protected]" has incorrect peer dependency "[email protected]".
error An unexpected error occurred: "EPERM: operation not permitted, lstat 'D:\\Projects\\Git\\Finance.Mobile\\mobile\\node_modules\\react-native\\local-cli\\templates\\HelloWorld\\android\\gradle\\wrapper\\gradle-wrapper.jar'".
Failed to clean up template temp files in node_modules/react-native-template-everywhere. This is not a critical error, you can work on your app.
child_process.js:644
    throw err;
    ^

Error: Command failed: yarn add [email protected]
    at checkExecSyncError (child_process.js:601:13)
    at execSync (child_process.js:641:13)
    at installTemplateDependencies (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/generator/templates.js:192:7)
    at createFromRemoteTemplate (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/generator/templates.js:147:5)
    at createProjectFromTemplate (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/generator/templates.js:88:5)
    at generateProject (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/init/init.js:80:3)
    at Object.init (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/init/init.js:52:5)
    at run (C:\Users\Home\AppData\Roaming\npm\node_modules\react-native-cli\index.js:302:7)
    at createProject (C:\Users\Home\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
    at init (C:\Users\Home\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)

Observed Results:

  • Throw exception (see above) when I'm try to install this package

Expected Results:

  • Installing template without errors.

May be, I'm doing something wrong?

update react-native-web

Please update react-native-web since it is very outdated (1.6.0 now) and provide a Hook or a way to perform platform specific code

eg:

if(platform==='web') {
    
} else if(platform ==='android' || platform ==='ios'){


}

iOS not running

I've just tried running a fresh installation from the README. The web version seems to run up fine, but the iOS version has AppRegistry issues

screen shot 2017-09-30 at 10 09 04

Firebase Host

I tried firebase host and it is very helpful.
Just 1 command "firebase deploy" and my react code will be online as a webpage.
I think it could be a nice feature.

Use rimraf instead of rm in additionalDependencies.js

Step 1: Are you in the right place?

Yes

Step 2: Describe your environment

  • template version : 0.3.2
  • react-native version: irrelevant
  • OS : Windows
  • Platform causing error: irrelevant

Step 3: Describe the problem (try to include screenshots):

Steps to reproduce:

  1. Install the application
  2. Run additionalDependencies.js
  3. No such command as rm

Observed Results:

'rm' is not recognized as an internal or external command,
operable program or batch file.

Expected Results:

Shouldn't fail.

Relevant Code/Commands:

Use rimraf instead of relying on rm. I've tried, it works fine.

React-Native Testing

First off, I want to say, great template.

Unfortunately this does not test well. Even simply running yarn run test with a new initiated project will fail even though the build will run. Is there a way to get past that?

react-native-vector-icons not working on web

Enviroment:

  • template version : (0.x.x) no clue how to find out...the version from yesterday
  • react-native-vector-icons: (4.4.2),
  • react-native version: ("0.50.3)
  • OS : Linux
  • Platform causing error: web

Step 3: Describe the problem (try to include screenshots):

Try to include react-native-vector-items, which works pretty well on android, but not on the web. Seems that the fonts are not bundled correctly with the webpack.config (neither Production nor dev). I searched my ass up to find the configs in the react-scripts module and try to added the needed loader but didn't work.
Your template is really awesome so perhaps you guys could help me/fix this, because you mentioned rnvi on your readme and i think it is a very usefull asset lib.

Steps to reproduce:

  1. create a new project, as discribed in Readme.md
  2. yarn add react-native-vector-icons
  3. added an icon in TopLevelScreenComponent.js
//...
import Icon from 'react-native-vector-icons/dist/MaterialIcons';
...
render() {
//...
<Icon.Button name = "image"
                 backgroundColor = "#a41010"
                 onPress = {this.props.failDispatchedAction} >Test Icon Button </Icon.Button>
//...  

Observed Results:

no errors just the font could not be loaded (on web...on android ...perfect)

Expected Results:

a button with an icon

Unmeet peerdependencies

npm WARN [email protected] requires a peer of react@^15 but none was installed.
npm WARN [email protected] requires a peer of react@^15 but none was installed.
npm WARN [email protected] requires a peer of [email protected] || 15.5.x but none was installed.
npm WARN [email protected] requires a peer of react@^15.5.4 but none was installed.
npm WARN [email protected] requires a peer of react@^15 but none was installed.
npm WARN [email protected] requires a peer of react-native@~0.42.0 but none was installed.
npm WARN [email protected] requires a peer of react@~15.4.1 but none was installed.

How can this be fixed? It's the first time that I works with ReactNative...

Status of the project

It seems that this project is abandoned. Any plan on continuing at some point in the future?
Anyway, great work so far and thanks a lot!

index.android.js and ios missing

Step 1: Are you in the right place?

  • For issues or feature requests related to the code this template file a Github issue.
  • For issues regarding react-native, post a question on StackOverflow tagged appropriately or visit react-native's issues page.

Step 2: Describe your environment

  • template version : (latest)
  • react-native version: (2.0.1)
  • OS : ubuntu 16.04 LTS
  • Platform causing error: (android/ios/web/electron)

Step 3: Describe the problem (try to include screenshots):

when i run react-native init projectname --template re-start, the files are generated but index.android.js and index.ios.js is missing. furthermore when i cd projectname and try to run the node scripts/devdependencies.js, it runs successfully until the end where it is trying to remove devdependencies and it says that devdependencies does not exist on my project directory.
also, when i try to run react-native run-android it just says "unable to load script from assessts index.android.budle make sure your bundle is packaged correctly or you're running a packager server" on my device after running the apk.

Steps to reproduce:

  1. react-native init projectname --template re-start
  2. npm install, node scripts/devDependencies.js
  3. react-native run-android

Changes in App.js is not compiling

  • template name : re-start
  • template version : (0.x.x)
  • react-native version: 0.54.2
  • OS : osX
  • Platform causing error: (android/ios/web/electron)

Any change I make in the App.js file, it does not compile at all, hence I am unable to add new route.
Please help, or am I doing something wrong?

Observed Results:

40ee1501bfbc2cc821bd9348d3244fa4

Expected Results:

I was expecting the code to compile.

Problem with react-native-icons-vector

After run: npm run web, I have problem:

ERROR in ./~/react-native-vector-icons/lib/create-icon-set.js Module parse failed: /Users/myName/Project/MyProject/node_modules/react-native-vector-icons/lib/create-icon-set.js Unexpected token (37:21) You may need an appropriate loader to handle this file type. |

My webpack config for loader icons:
{ test : /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9-=&.]+)?$/, loader : 'file-loader', include: path.resolve(__dirname, "node_modules/react-native-vector-icons") },

P.S. I'm using webpack 2.2.0 version

Native routing example

How can move from one screen to another?

I have tried
js this.props.router.push('/home')

But nothing is working

Several problems

There are no commands inside package.json to run the windows or electron builds.

There's also no documentation regarding the prerequisites to run the iOS or Android builds in development.

The amount of dependencies is huge, and there's no way to bundle or cache them provided.

Pretty disappointing that this doesn't actually run what it says it can 😕

Status of templates?

Readme says that the refactor to using templates would be ready in two weeks, but it was two months ago... Could you be able to give an update of the progress and an stimate time for it? Is it ready to start a new project although it's not in the master branch?

Doesn't work out of the box, `Module not found: 'react/lib/React'`

Hi there,

after following the latest install-with-template instructions and running yarn run web the following error appears:

Failed to compile.

Error in ./~/react-dom/lib/ReactMount.js
Module not found: 'react/lib/React' in /Users/User/dev/testing/react-native/r10/node_modules/react-dom/lib

 @ ./~/react-dom/lib/ReactMount.js 1:156-182

Steps:

react-native init r10 --template everywhere
cd r10
node scripts/addDevDependencies.js
yarn run web

I thought that maybe react-dom is too old and upgraded to 16.0.0-alpha.12, which changed the error to:

Failed to compile.

Error in ./~/react-native-web/dist/modules/injectResponderEventPlugin.js
Module not found: 'react-dom/lib/EventPluginHub' in /Users/User/dev/testing/react-native/r10/node_modules/react-native-web/dist/modules

 @ ./~/react-native-web/dist/modules/injectResponderEventPlugin.js 1:20-59

Any idea where the issue might be?

I've added my current package.json here:
https://gist.github.com/berstend/02e2b3b8319a051f86353789afec6cff

Add all dependencies to package.json

Template dependencies are in separated files, so greenkeeper can't control them. I propose to add them as dependencies or devDependencies so they can be check and updated automatically, and later select the ones that need to be installed on the project instance from some lists, similar to what I'm doing with user dependencies on NodeOS.

Add support for React Native DOM platform

https://github.com/vincentriemer/react-native-dom

It targets the web in the same way as react-native-web (used by the current web platform), but the build process is similar to the Windows platform by adding a new platform to React Native builder itself instead of monkey patching the libraries, it's multithreaded by default by using WebWorkers, and it's compiled to WebAssembly by using custom binding of Yoga layout, so performance should be great. I propose to add it as a new platform, and maybe in the future deprecate the web one in benefict of this.

Move addDevDependencies script to an independent module.

Just came across with the addDevDependencies script.
Great way to solve the issue that RN templates aren't supporting devDependencies right now.
Other open source templates(including the one I'm working on right now) can benefit and support it if you can move it as a separate module.

Question: Usage with Electron vs Targeting macOS + windows separately

Purely from an educational standpoint what would be the purpose of targeting macOS and Windows as separate components when you could potentially use something like https://github.com/PaulLeCam/react-native-electron to make cross-platform desktop apps that would even include running on linux…

It seems to work with react-native-web obviously like this project it's still very new and probably not 100% ready for primetime but might be something to shortcut the process

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.