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

Option for stable module Ids? #35

Closed
lelandrichardson opened this issue Jul 31, 2017 · 3 comments
Closed

Option for stable module Ids? #35

lelandrichardson opened this issue Jul 31, 2017 · 3 comments

Comments

@lelandrichardson
Copy link
Contributor

lelandrichardson commented Jul 31, 2017

Do you want to request a feature or report a bug?
Feature

i’m working on OTA updates for RN at airbnb, and one of the things that i’m looking to do is to ensure that we can push just the code that’s changed and not the whole bundle to the clients. since the RN packager uses unstable module ids after bundling code (ie, require(123) might need to turn into require(124) after a relatively trivial change in module loading order).

I was thinking about submitting a PR to metro-bundler that would add in an option to use "stable ids" for the require algorithm. This would probably end up using the localPath of the module, as opposed to the auto-incrementing module id.

I'm still considering strategies, but I'm thinking that in the situation where the user is using unbundle, a map of localPath => moduleId could be added to a global variable or something, which the require.js polyfill could utilize.

If I made such a PR, would FB be willing to accept it? It would be done in such a way that it would be completely opt-in.

cc @jeanlauliac @cpojer

@mc-zone
Copy link

mc-zone commented Aug 8, 2017

Also need this feature. There is also an issue #6 I opened earlier to discuss about it.

@rafeca
Copy link
Contributor

rafeca commented Jan 1, 2018

Hey @lelandrichardson! this was added in f347e4f and is available on 0.24.1

@rafeca rafeca closed this as completed Jan 1, 2018
@lelandrichardson
Copy link
Contributor Author

@rafeca awesome, thanks!

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

No branches or pull requests

3 participants