RealOrangeOne / react-native-mock

A fully mocked and test-friendly version of react native (maintainers wanted)
MIT License
570 stars 153 forks source link

Incompatibility with react > 16 #129

Open samouss opened 7 years ago

samouss commented 7 years ago

Hello,

The latest release of React Native use the v16.0.0-alpha.6 of React. In this version the React team has deprecated and remove a lots of addons package, including:

https://github.com/facebook/react/issues/9207

Due to this BC the package throw an error when the test are running:

module.js:472
    throw err;
    ^

Error: Cannot find module 'react/lib/ReactComponentWithPureRenderMixin'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)

We should drop the import of this addons and create a new version for support this new release of React Native.

Any ideas?

Thanks!

RealOrangeOne commented 7 years ago

Wow, supprised they're depricating all those. Had a quick look through the issue you linked, but it doesnt sound like it's as simple as Facebook arent supporting these anymore. Is there a way we can change the require path / method to keep using these libraries? If not, we'll have to look into trying to remove the dependency on these, which sounds interesting.

samouss commented 7 years ago

I try to remove the useless dependency in my project and it works. Do you want a PR ?

RealOrangeOne commented 7 years ago

Yes, please! I'm surprised it's so simple, I was expecting much worse!

pziemkowski commented 7 years ago

Any update on this issue?

JonnyBurger commented 7 years ago

I appreciate you working on this! If you, like me, desperately want to upgrade, I published @samouss's branch as an npm package: https://www.npmjs.com/package/@jonny/react-native-mock

Install and update references in babel config and requires from react-native-mock to @jonny/react-native-mock.

No update / maintenance and I will unpublish the package when the main repository has been updated for a while.

jeaye commented 6 years ago

Thank you, @JonnyBurger! That does the trick, for now. This really needs to be merged.

JAStanton commented 6 years ago

@JonnyBurger can you put up a github repo with your source for the react-native-mock fork? It would be nice to contribute to it :P it seems to be the only path forward for this repo

JonnyBurger commented 6 years ago

@JAStanton I uploaded my fork here: https://github.com/JonnyBurger/react-native-mock

It has some other changes, like requiring react-native@^0.55. If it causes problems for others, I would be happy to take PRs.