react-everywhere / re-start

react-native template to target multiple platforms :globe_with_meridians: :iphone: :computer: with single codebase.
https://medium.com/@amoghbanta/write-once-use-everywhere-with-react-native-d6e575efe58e#.nfl50gwfg
MIT License
1.3k stars 85 forks source link

re-base #42

Open piranna opened 6 years ago

piranna commented 6 years ago

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 :-)

amoghbanta commented 6 years ago

That's a great idea. Working on something similar. Will share with you tomorrow probably and have your suggestions on it 😄

amoghbanta commented 6 years ago

hey @piranna, check this out. re-base will be the base template (what you wanted to do with re-core), based on which we can create more templates with different permutations and combinations of opinions and libraries and bootstrap any new project with a template that best fits the requirements. So re-start will be a collection of opinionated templates that work on all available platforms. Next step would be to create a CLI, such that we can mix and match different templates at the time of bootstrapping a project because more the number of templates, difficult it would be to maintain this project. cc: @ankitpopli1891, what are your views on this?

amoghbanta commented 6 years ago

It would be great if you could test a couple of templates:

react-native init projectName --template re-start/re-base
cd projectName
node scripts/additionalDependencies.js

its still a work in progress, and I'll be working on rest of the templates tomorrow.

piranna commented 6 years ago

re-base will be the base template

Honestly, the joke with the names starting with re- is going out of our hands... X-D Anyway, it needs some clean-ups, but it's exactly what I was talking about, good job :-)

piranna commented 6 years ago

It fails to install :-(

Fetching template react-native-template-re-start/re-base...
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/react-native-template-re-start/re-base.git
npm ERR! 
npm ERR! ERROR: Repository not found.
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! 
npm ERR! exited with error code: 128

Wouldn't it be better to move re-base to it's own project?

amoghbanta commented 6 years ago

re-base and re-start are 2 different templates. You have to select one. Try out:

react-native init projectName --template re-start
cd projectName
node scripts/additionalDependencies.js

or

react-native init projectName --template re-base
cd projectName
node scripts/additionalDependencies.js

re-base and re-start are totally isolated projects. They are just managed in a single repository. Something like react-router does with the help of lerna.

piranna commented 6 years ago

react-native init projectName --template re-base cd projectName node scripts/additionalDependencies.js

Ok, it worked :-)

Issues:

piranna commented 6 years ago
piranna commented 6 years ago
miguelocarvajal commented 6 years ago

I like where this is going. I will be testing this out myself in the following days.

I wanted to see if it would be possible to set this up with Expo as well (so that yarn run web works but mobile side uses Expo). Has anybody done any testing with it?

piranna commented 6 years ago

Dependencies got upgraded:

 react                16.0.0  →  16.1.0 
 react-dom            16.0.0  →  16.1.0 
 react-native         0.50.1  →  0.50.3 
 react-test-renderer  16.0.0  →  16.1.0 

 electron       ^1.6.11  →   ^1.7.9 
 react-scripts  ^1.0.14  →  ^1.0.17 
piranna commented 6 years ago
piranna commented 6 years ago

Hi @amoghbanta, hope you are well. How is this going on? Is it ready to merge in master? I could be able to do myself the proposed changes but I was waiting to the branch getting merged first before doing so... I know I have permissions on this repo, but being your repo I think this kind of decission are better done by you, specially since you have the publish permissions on npm. What about doing an org there and put some of us with publish permissions? Adding us to this org would be a good idea, this would allow to maintain the project and do some improvements, like moving re-base and the other templates to independent projects and use them as dependencies or add TravisCI support and add tests, what do you think? :-)