react-everywhere/re-start

Update to React 16

piranna opened this issue ยท 13 comments

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.

react-native has still not migrated to react 16 completely. Once that is done, i'll upgrade everything for sure.

Cool, thanks :-)

Hey @piranna,
Sorry, this took time. I've not been well for past month. I just pushed a new branch "react-16" which has react-scripts as we discussed. It is still a work in progress. You can test it if you want with following commands:

react-native init projectName --template restart-test
cd projectName
node scripts/addDevDependencies.js

This also supports electron out of the box.

npm run electron

I would try to finish it up by this weekend and merge it into master. Also, if time permits, I will also be working on a global CLI for this project and abstract out all the steps that need to be done manually as of now.

Initial feedback for restart-test:

  • run web: error because index.js tries to import the App class from outside of the src dir. Can be fixed by moving App.js to src/ and fixing the paths in the following files: index.js, src/index.js, index.windows.js, tests/App.js, and App.js itself (imports)
  • run electron: the electron shell is opened, but then the actual page is still opened in Chrome while electron shell is showing the empty page

I've not been well for past month

I'm sorry to hear that, hope you are better now :-)

I just pushed a new branch "react-16" which has react-scripts as we discussed. It is still a work in progress

Lol :-P I have been updating the dependencies on my job project and the last missing piece was React 16, that's giving some problems. Good to know you have been able to move forward with react-scripts, I'll try to do a pull-request with the updates on the dependencies that I've done so far (everything except React related ones).

I will also be working on a global CLI for this project and abstract out all the steps that need to be done manually as of now.

This was too on my roadmap after doing the upgrade of the dependencies, split the ones needed for the build process and the ones needed during regular project executin and later abstract all the commands for project compilation as npm scripts (like npm run web) instead of point in the docs to external tools for Android and iOS :-)

@emirotin, thanks for the feedback, I forgot to publish latest changes to npm. Can you please try refreshing your electron shell, I am hoping that would work.

abstract all the commands for project compilation as npm scripts (like npm run web) instead of point in the docs to external tools for Android and iOS

@piranna, this is exactly what needs to be done. Please also have a look at #31
I am thinking not to expose webpack config and scripts by default and make it optional for the advanced users. What are your views on it?

I am thinking not to expose webpack config and scripts by default and make it optional for the advanced users. What are your views on it?

I think it's nice to hide them, problem is when you need to customize it, for example to add more transformations. Options I see:

  1. do nothing, just show them as regular files so people would work with them as with any project crafted by hand
  2. add some mechanism to merge user customizations on the hidden files
  3. check if there are user provided project files, and if not, use the default ones

Definitely, my main concern on this topic is about I don't want to learn to use react-native CLI command, since I already know that with npm run web I can test my app on my browser, I want to do the same with npm run android on my mobile phone or emulator :-)

@amoghbanta yeah refreshing the electron shell does help.
Another issue: if I quit the electron shell (Cmd+Q) the builder process exits but the process occupying the port is still running as on the consequent run I see

? Something is already running on port 3000. Probably:
  ui (pid 98531)
  in /Users/eugene.mirotin/work/chgk-db-search/ui

This doesn't seem to happen when I terminate the builder with Ctrl+C

React Native 0.50 have just been released... It's time to finally move to React 16, isn't it? :-)

on it, since a couple of days ๐Ÿ˜„
Will push by tomorrow for sure.

@amoghbanta is it now support react 16 or still react 15?

Support for React 16 is in the react-16 branch.

@piranna brilliant library I use it here https://github.com/amorenew/LifeMaster