Skip to content

rename Primus.require => Primus.requires#432

Merged
lpinca merged 1 commit into
primus:masterfrom
gorangajic:react-native-require-fix
Feb 18, 2016
Merged

rename Primus.require => Primus.requires#432
lpinca merged 1 commit into
primus:masterfrom
gorangajic:react-native-require-fix

Conversation

@gorangajic

Copy link
Copy Markdown
Contributor

When using react-native with primus generated lib will throw error

Unable to resolve module stream ....

after some debugging I have figured out that react-native packager assume that every method with name require is normal require method.
So replacing the function name with something else instead of Primus.require will fix that problem.

@lpinca

lpinca commented Feb 17, 2016

Copy link
Copy Markdown
Member

The change seems ok, but I'm a bit worried about plugins.

@3rd-Eden thoughts?

because react-native packager treat every function named require as module
loader, loading primus client in react-native throw error that cannot
resolve stream model.
@gorangajic gorangajic force-pushed the react-native-require-fix branch from 59ac82b to 9f04747 Compare February 17, 2016 23:35
@gorangajic

Copy link
Copy Markdown
Contributor Author

not sure why anyone would like to use that, but I have update commit to assign Primus.require also, problem is only when you call Primus.require method

@lpinca

lpinca commented Feb 18, 2016

Copy link
Copy Markdown
Member

👍 Thank you.

lpinca added a commit that referenced this pull request Feb 18, 2016
rename Primus.require => Primus.requires
@lpinca lpinca merged commit 1cd118b into primus:master Feb 18, 2016
@gorangajic gorangajic deleted the react-native-require-fix branch February 18, 2016 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants