-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Packager] Feature request: Support for patching global apis #2238
Comments
There was a proposal for the packager to read the package.json to get modules you specify for react-native specifically. |
@browniefed, do you have a link to the proposal? I can't seem to find it. |
@uber5001 my memory is failing me. The concept being
|
#2208 seems to cover this nicely, great call @browniefed. @uber5001 ping me if that's not the case |
It would be convenient to be able to fill in any gaps in the JavaScriptCore environment with custom patches, so that any dependencies that expect to be running in v8 with node.js APIs can function properly.
url
is one of the modules exposed by the Node.js APIs.require('url')
doesn't seem to work within React Native. There's also a module on npm calledurl
that is meant to be a browserify replacement for node'surl
. I want to be able to use this as a replacement for Node'surl
.For most cases, just
npm install url
will fix the problem. This even fixes my issue directly, which is that one of my sub-dependencies isurl
. This falls apart when my dependency that depends ofurl
gets de-duped by npm when the module I'm working on gets installed by someone else. (Let me know if I need to explain this in detail)I'm not sure how this would be exposed. Perhaps something along the lines of
which would cause all
require('url')
to use the globally patched version provided.The text was updated successfully, but these errors were encountered: