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

Updated dependencies #31

Closed piranna closed 6 years ago

piranna commented 6 years ago

There are some other dependencies that I have included in my project that I have not included on this pull-request, some of them are interesting like React-Native-Material-UI but I'm thinking probably it would be better to remove dependencies and boilerplate from this project to make it more barebones, since there are thing like redux-thunk that I'm not using and in fact I've not been able to find any usage on the template default project...

amoghbanta commented 6 years ago

I am planning to add react-scripts as a dependency and then we just need to upgrade react-scripts and everything else will be taken care of by it. Since now react-native web has a babel plugin, so maybe we would not need to eject scripts and would be optional for the end user. I am experimenting with react-scripts, give me a couple of days. Regarding redux thunk, plan was to add an example but that got lost somewhere. I'll remove it in next release because most people won't need it.

piranna commented 6 years ago

I am planning to add react-scripts as a dependency and then we just need to upgrade react-scripts and everything else will be taken care of by it.

"You don’t need to install or configure tools like Webpack or Babel. They are preconfigured and hidden so that you can focus on the code."

Seems pretty nice... :-D

piranna commented 6 years ago

Any update on the react-scripts thing?

piranna commented 6 years ago

I have just updated all the dependencies except the React-related ones, because you are working on your branch using react-scripts. I have also updated the webpack configuration to match it.

amoghbanta commented 6 years ago

with react-scripts, all the dependencies will be up to date (most of the times) and since react-native-web now has a babel plugin so I have not ejected scripts and config which means that webpack config files are hidden by default which makes sense for most of the beginners. What we can do is, eject the config and scripts on a different branch and merge this P.R. in that and all the advanced users can make use of that branch (or a separate template on npm). Ideas and suggestions are welcome. 😄

piranna commented 6 years ago

Obviously, if react-scripts makes all the hard work, then this is a bit useless :-P I like the advanced users, thought. In fact, one of my ideas was to have barebones projects that don't add any external module (redux, react-router, etc...) and just print a "hello world" message on screen... but can do it in all the platforms with just a single click :-D Then it can be used as basis to build other more advanced templates by using it as dependency. For example, at my work we have added redux-offline and react-native-material-ui and seems to be for us like a cool basis to start working on all our future projects :-) But obviously, it doesn't make sense to add this dependencies to re-start or being installing them each time we create a new project...

piranna commented 6 years ago

Other option is to merge this, and keep working with react-scripts and other similar big changes on a diferent branch to prepare a next 0.5.0 version :-)

amoghbanta commented 6 years ago

This makes sense to me. We can merge this in master as of now.

In fact, one of my ideas was to have barebones projects that don't add any external module (redux, react-router, etc...) and just print a "hello world" message on screen... but can do it in all the platforms with just a single click :-D Then it can be used as basis to build other more advanced templates by using it as dependency.

This can be part of the cli, we can ask the user about the kind of template they want and init their project with that template.

piranna commented 6 years ago

This makes sense to me. We can merge this in master as of now.

Ok, let's go for it :-)

This can be part of the cli, we can ask the user about the kind of template they want and init their project with that template.

So instead of install the templates with react-native cli, do it with a custom cli command specific for re-start templates (that are a superset of standard react-native templates)? Besides the execution of install scripts to configure the package.json file of the created projects (that probably there could be some hack for that), what drawbacks has the standard mechanims?