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 called url that is meant to be a browserify replacement for node's url. I want to be able to use this as a replacement for Node's url.
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 is url. This falls apart when my dependency that depends of url 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
require('react-native').patchModule('url', require('url'));
which would cause all require('url') to use the globally patched version provided.
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.
urlis 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 calledurlthat 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 urlwill 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 ofurlgets 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.