Skip to content
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] Global require replace (ala webpack's resolve.alias and browserify's builtins) #6253

Closed
vespakoen opened this issue Mar 2, 2016 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot. Type: Discussion Long running discussion.

Comments

@vespakoen
Copy link

I am working on making modules that depend on browserify's builtins compatible with react-native.

My current pull request over at node-haste supports the browserify builtins but unfortunately node-haste is depended upon by other packages, so I am looking for a more generic solution.

The first solution that came to my mind is to support a config option with "global replacements".
This way, we could tell node-haste to replace / alias packages.

How are we feeling about supporting this?

To me this seems an obvious problem that we should fix since it will make a lot more packages compatible with react-native, the most important win being (imo) having access to all the streaming libraries.

Related issues

  1. support resolve.alias ala webpack #5917
    Fixed, But only works on a per-module level, this issue is for replacing modules on a global level, allowing us to "imitate" browserify's builtins.

  2. Compatibility: node packages depending on V8 can't function in react-native iOS #5881
    Twilio client uses the "crypto" browserify builtin

  3. Using NodeJS modules packages via Browserify? #5555
    Somebody that wants to use builtins

  4. "Error: Requiring module "BatchedBridge" which threw an exception" after upgrade to 0.14.1 #4022 and "ReferenceError: Can't find variable: process" after update to 0.14.2 #4098
    Requiring a package that expects process to be present (maybe already fixed by the addition of the "browser" and "react-native" field)

  5. Is it possible to use replacement module with Packager? #4018
    Someone trying to use (a package that depends on) the "net" package

  6. [Packager] should use compatible versions of node core modules #1871
    More people wanting node-ish support in react-native

  7. packager assume that every method named require is module loader function #5988
    Somebody trying to use a library that depends on the "stream" builtin

There are probably a bunch more out there but this is what I could collect with a couple of searches.

@vespakoen vespakoen changed the title Global require replace (ala webpack's resolve.alias and browserify's builtins) [Packager] Global require replace (ala webpack's resolve.alias and browserify's builtins) Mar 2, 2016
@mvayngrib
Copy link
Contributor

+1

@ambarc
Copy link

ambarc commented Apr 8, 2016

+1000

@jacobrosenthal
Copy link
Contributor

The product pains for this is https://productpains.com/post/react-native/packager-support-resolvealias-ala-webpack/ Please Bump

@AugustoL
Copy link

+1

@lacker
Copy link
Contributor

lacker commented Oct 28, 2016

This definitely sounds useful. As an issue, this seems like a duplicate of the product pains link, so I'm going to close this issue in favor of that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot. Type: Discussion Long running discussion.
Projects
None yet
Development

No branches or pull requests

9 participants