mjohnston / react-native-webpack-server

Build React Native apps with Webpack
MIT License
933 stars 84 forks source link

Support react-native@0.14 #128

Closed ghost closed 8 years ago

ghost commented 8 years ago

Looks like there's a new RN release. I tried bumping my project to use it but RNWS is smart and tells me the peer is invalid (expects RN 0.13):

EPEERINVALID react-native-webpack-server@0.8.0 requires a peer of react-native@^0.13.0 but none was installed.

Throwing caution to the wind I ran npm start and things go boom. Here are the release notes for the 0.14 release candidate. Please let me know how I can help.

RyGuyM commented 8 years ago

I got it working for RN-0.14 by updating the lines 256-260 of react-native-webpack-server/libs/Server.js to the following:

 const cmd = './node_modules/react-native/packager/packager.sh';
      const args = [
        '--root', this.entryDir,
        '--port', this.packagerPort,
      ]...

The packager.js file looks like it was removed so I start the packager through the shell script. This is by no means a complete solution but it works if you want to use RN-0.14 immediately! :)

ghost commented 8 years ago

@RyGuyM great job! :clap:

ghost commented 8 years ago

Great work guys! Thoughts on using SemVer range syntax to protect downstream consumers from possible breaking changes when RN 0.15 is released? Here's how I'm setting up my project to help avoid this:

  "dependencies": {
    "react-native": "0.13 - 0.14"
  }
elliottsj commented 8 years ago

I've considered that, although it does mean we need to keep updating peerDependencies each time there's a new major RN release, even if there are no breaking changes to the packager. Probably a good idea though; forces us to make sure things don't break :+1:

elliottsj commented 8 years ago

RNWS seems to work fine with RN 0.15.0-rc, so I've released 0.8.2-rc with semver range syntax

ghost commented 8 years ago

Sweet business. Thank you @elliottsj

ghost commented 8 years ago

Also worth noting, RNWS works great under the 5.0.x engine.