Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Core.JavaScript: Util.ts - other external dependencies #2

Closed
patrick-rodgers opened this issue Mar 12, 2016 · 3 comments
Closed

Core.JavaScript: Util.ts - other external dependencies #2

patrick-rodgers opened this issue Mar 12, 2016 · 3 comments
Labels

Comments

@patrick-rodgers
Copy link
Contributor

When we're building the Util.ts (general JavaScript helpers/utilities), we will probably start to reflect many of the functions that already exists in underscore.js (http://underscorejs.org/).

Is this a problem? Could it be an idea to depend on it? The production dist is very lightweight (approx 5kb).

@nerdondon
Copy link
Contributor

hi patrick,
regarding underscore, i think that the tendency of the community has moved towards lodash over underscore and i believe that there are performance reasons for this as well.

another thing to consider here is that lodash makes individual modules available on npm. so we can cherry pick only the necessary modules if size really is an issue. Personally, I don't see 5kb as too big

@alex-randall
Copy link
Contributor

The less external library dependencies we have:

  • the easier it will be to use and not cause potential runtime conflicts (thinking site owner scenarios who are coding JavaScript in Script Editor/Content Editor Web Parts and many others).
  • the more flexible it will be to let users choose whatever external library (and version of the library) they want for those kind of things

That said, of course we need those kinds of util functions internally as well.

So it's a balance of:

Do we expose these util functions as a public api? or we just keep it internal only and let other internal code use it as needed?

Don't think it's easy to answer that one. More a judgement call than anything.

@patrick-rodgers
Copy link
Contributor Author

Going to close this one - I think great points and we will aim to limit the number dependencies. This is why we have created our own utils library to not take a dependency for a few lines of code. Thanks for the input guys!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants