Use lodash-amd library.#1299
Conversation
|
This PR doesn't have any priority to be included in 2.7 (bugfix) release. I saw that there was an AMD lodash library published, and I got a little excited about reducing the footprint. To minimize code changes around the updated library, what I did was introduced a 'lodash-slim' module which pulls in the distinct set of lodash functions that we reference in Atlas. It turns out, we reference about 35 distinct lodash functions, which is actually a bit surprising to me, and was relieved to find that we weren't using such a large library to call one or two functions, so this library is leveraged quite a bit! However, I did manage to shave off about 200k (from ~500k) of library size by only including those functions we use. Ideally, I think the 'proper' way to use the AMD library is to reference the functions where they are required but that left me with 2 problems:
So, I decided on the approach in this PR. Thoughts about version 2.8 or 3.0: We very well could create a separate Speaking of 'functions we need', I noticed that there's a few functions in lodash that maybe we could possibly rely on ES6 native methods (like map, reduce, first, find, extend) instead of bundling those functions into the slim library. I understand that there's some differences between the native and the lodash implementation, but my question is more of reducing the footprint. I welcome your thoughts on this. Thank you. |
|
Moving to 3.0 for consideration in that effort |
Fixes #1298