Skip to content

Conversation

@Kureev
Copy link
Contributor

@Kureev Kureev commented Feb 19, 2016

As far as we agreed to merge rnpm into react-native core, we need to align our dependencies to exclude duplications. One of the steps forward would be to use the same utilities library. According to the thread on fb, everybody is fine with replacing underscore by lodash (which we use internally for rnpm).

So, here we go!

cc @mkonicek @davidaurelio @grabbou

Test plan

$ npm test

image

Code formatting

Changes are aligned with the current style guide.

@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @vjeux, @ide and @martinbigio to be potential reviewers.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Feb 19, 2016
@grabbou
Copy link
Contributor

grabbou commented Feb 19, 2016

Thanks, looks good to me. I am pretty sure you will have to squash commits, but you can probably wait till someone confirms nothing to be changed here.

@Kureev
Copy link
Contributor Author

Kureev commented Feb 19, 2016

@grabbou Yeah, I'll keep them separated for now (easier to revert if needed), but later on I can squash them into one.

@satya164
Copy link
Contributor

@grabbou

I am pretty sure you will have to squash commits

The bot will squash commits when this gets merged :)

@bestander
Copy link
Contributor

@satya164, when it is ready, instead of shipit do import, and ping me.
I'll need to update npm deps internally

@satya164
Copy link
Contributor

@bestander Okies. I will :)

@satya164
Copy link
Contributor

Can we require individual modules instead of the whole package? For example require('lodash/flattenDeep')?

Doesn't make any difference since it's just the packager though.

@gaearon
Copy link
Collaborator

gaearon commented Feb 19, 2016

Can we require individual modules instead of the whole package? For example require('lodash/flattenDeep')?

Agree that this would be nicer. Less code to process is better 👍

return createServer(options);
}

function omit(obj, blacklistedKeys) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use lodash/omit ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, I'd like to replace lodash by a self-written functions (to eliminate one of the ext. dependencies). But I think we shouldn't include it in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think i'd be nice to just add a small test suite for that then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grabbou that would mean that we need to extract this function somewhere. I'd like to do it, but I have no clue where to put it. Any suggestions?

@satya164
Copy link
Contributor

Looks good overall. This is awesome, because lots of other packages are using lodash anyways. The less deps, the better.

@Kureev
Copy link
Contributor Author

Kureev commented Feb 19, 2016

I agree about individual modules, but I remember in the facebook thread @davidaurelio had some objections about it.

@satya164
Copy link
Contributor

@Kureev

I agree about individual modules, but I remember in the facebook thread @davidaurelio had some objections about it.

Let's wait for @davidaurelio 's feedback then.

@satya164 Ideally, I'd like to replace lodash by self-written functions (to eliminate one of the ext. dependencies).

IMO it's not worth it, lodash is used by lots of packages. So we're not really getting rid of it.

@Kureev
Copy link
Contributor Author

Kureev commented Feb 19, 2016

@satya164 maybe you're right. But as you said, let's wait for the @davidaurelio's feedback first 👍

@mkonicek
Copy link
Contributor

Thank you for doing this!

@satya164
Copy link
Contributor

ping @davidaurelio

@mkonicek
Copy link
Contributor

David is very busy trying to merge the PRs that will unbreak Travis. Let's please hold on with this until Travis is green. Thanks for the patience!

@satya164
Copy link
Contributor

satya164 commented Mar 4, 2016

ping @davidaurelio

@Kureev Kureev force-pushed the chore/replace-underscore-by-lodash branch from a165520 to d9695ff Compare March 4, 2016 21:51
@facebook-github-bot
Copy link
Contributor

@Kureev updated the pull request.

@Kureev
Copy link
Contributor Author

Kureev commented Mar 4, 2016

I rebased this branch by the latest master. Now tests should be all green 🍏

@davidaurelio
Copy link
Contributor

@facebook-github-bot shipit

@davidaurelio
Copy link
Contributor

I will hold this until Monday. It will get in the next version.

@facebook-github-bot
Copy link
Contributor

Thanks for importing. If you are an FB employee go to Phabricator to review.

@Kureev
Copy link
Contributor Author

Kureev commented Mar 5, 2016

👍

@mkonicek
Copy link
Contributor

mkonicek commented Mar 7, 2016

Hey guys, I'm merging #6346 and then this one right after.

@davidaurelio
Copy link
Contributor

thanks @mkonicek

@mkonicek
Copy link
Contributor

mkonicek commented Mar 7, 2016

OK #6346 is landing internally now, once it lands want to rebase this one on top of it because both require updating the npm-shrinkwrap.json file. It's late in London now so will continue in the morning. Thanks for the patience!

@Kureev
Copy link
Contributor Author

Kureev commented Mar 8, 2016

ping me when I can rebase

@mkonicek
Copy link
Contributor

mkonicek commented Mar 8, 2016

Turns out #6346 doesn't work with our internal build based on Buck so we can probably merge this one first.

@mkonicek mkonicek closed this Mar 8, 2016
@mkonicek mkonicek reopened this Mar 8, 2016
@mkonicek
Copy link
Contributor

mkonicek commented Mar 8, 2016

(oops wrong button 😃 )

@mkonicek
Copy link
Contributor

mkonicek commented Mar 8, 2016

OK I did some investigation and this PR is in fact blocked on #6346. When I try merging this PR on its own and regenerate npm-shrinkwrap.json the packager doesn't work when used with npm 2.

The root of the problem is we can't regenerate npm-shrinkwrap.json in a way that works with npm 2, and since changes to package.json require npm-shrinkwrap.json to be regenerated, we can't merge any PRs that change package.json until #6346 lands.

@Kureev
Copy link
Contributor Author

Kureev commented Mar 8, 2016

image

@davidaurelio
Copy link
Contributor

Can we get away with lodash 3? babel depends on that. In that case, npm install puts three versions of lodash in the tree. If we need v4, we end up with 20.

@davidaurelio
Copy link
Contributor

no need to update the PR. I have it updated internally

@Kureev
Copy link
Contributor Author

Kureev commented Mar 9, 2016

@davidaurelio sure, thanks! I think it should work even without any code changes (except the lodash version in package.json).

@grabbou we probably need to follow up on this in the link and install plugins (just to be sure that it works with lodash@3 without any code changes).

@grabbou
Copy link
Contributor

grabbou commented Mar 9, 2016

Yeah, let's apply updates to our internal packages once this is merged.

@Kureev Kureev mentioned this pull request Mar 9, 2016
@ghost ghost closed this in db3a00d Mar 9, 2016
bestander pushed a commit to bestander/react-native that referenced this pull request Mar 18, 2016
Summary:As far as we agreed to merge `rnpm` into react-native core, we need to align our dependencies to exclude duplications. One of the steps forward would be to use the same utilities library. According to the thread on fb, everybody is fine with replacing underscore by lodash (which we use internally for rnpm).

So, here we go!

cc mkonicek davidaurelio grabbou

**Test plan**
```
$ npm test
```
![image](https://cloud.githubusercontent.com/assets/2273613/13173972/ee34c922-d700-11e5-971b-68ff7322b6d6.png)

**Code formatting**

Changes are aligned with the current [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).
Closes facebook#6030

Differential Revision: D3016271

Pulled By: davidaurelio

fb-gh-sync-id: c4f6776a7de7470283d3ca5a8b56e423247f5e45
shipit-source-id: c4f6776a7de7470283d3ca5a8b56e423247f5e45
cpojer pushed a commit to facebook/metro that referenced this pull request Jan 26, 2017
Summary:As far as we agreed to merge `rnpm` into react-native core, we need to align our dependencies to exclude duplications. One of the steps forward would be to use the same utilities library. According to the thread on fb, everybody is fine with replacing underscore by lodash (which we use internally for rnpm).

So, here we go!

cc mkonicek davidaurelio grabbou

**Test plan**
```
$ npm test
```
![image](https://cloud.githubusercontent.com/assets/2273613/13173972/ee34c922-d700-11e5-971b-68ff7322b6d6.png)

**Code formatting**

Changes are aligned with the current [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).
Closes facebook/react-native#6030

Differential Revision: D3016271

Pulled By: davidaurelio

fb-gh-sync-id: c4f6776a7de7470283d3ca5a8b56e423247f5e45
shipit-source-id: c4f6776a7de7470283d3ca5a8b56e423247f5e45
grabbou pushed a commit to react-native-community/cli that referenced this pull request Sep 26, 2018
Summary:As far as we agreed to merge `rnpm` into react-native core, we need to align our dependencies to exclude duplications. One of the steps forward would be to use the same utilities library. According to the thread on fb, everybody is fine with replacing underscore by lodash (which we use internally for rnpm).

So, here we go!

cc mkonicek davidaurelio grabbou

**Test plan**
```
$ npm test
```
![image](https://cloud.githubusercontent.com/assets/2273613/13173972/ee34c922-d700-11e5-971b-68ff7322b6d6.png)

**Code formatting**

Changes are aligned with the current [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).
Closes facebook/react-native#6030

Differential Revision: D3016271

Pulled By: davidaurelio

fb-gh-sync-id: c4f6776a7de7470283d3ca5a8b56e423247f5e45
shipit-source-id: c4f6776a7de7470283d3ca5a8b56e423247f5e45
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants