Move unwrapping methods to the primary underscore.js module #2860
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While writing an article on how to use the upcoming modular Underscore release, I realized that the division between the
underscore.js
andunderscore-oop.js
modules that I made in #2849 was a bit unnatural. As it was, theunderscore.js
module exported a_
function that could wrap a value, but the resulting wrapper had no unwrapping methods. To have the unwrapping methods, you needed to importunderscore-oop.js
for its side effects, but that also added all the array proxy methods. People who cherry-pick from the library may sometimes want to have wrapping and unwrapping but no array methods.I reorganized this slightly so that
underscore.js
already packs the unwrapping methods. The remainingunderscore-oop.js
has only one job, i.e., to add the array methods, so I renamed it accordingly. The impact on the monolithic build is minimal because the unwrapping methods have no dependencies of their own.I don't expect anyone to object to this change so I'm not going to ask for a review, but I'm creating this PR anyway in order to leave a trace. I will also hold off from merging until the Travis build has completed, to make sure that nothing breaks.