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

Make Two.Utils private? #417

Open
adroitwhiz opened this issue Dec 5, 2019 · 4 comments
Open

Make Two.Utils private? #417

adroitwhiz opened this issue Dec 5, 2019 · 4 comments
Milestone

Comments

@adroitwhiz
Copy link
Contributor

Currently, there's a lot of stuff in Two.Utils that was copied in from Underscore.

It looks like some work has already been put into reducing the use of Underscore in Two.js, but Two.Utils could be further cut down and maybe made private so that it can change to suit Two.js' needs without worries of breaking external code which relies on it.

This would break any Two.js projects currently using public Two.Utils functions, so perhaps it would be a good candidate for 0.8.0?

@jonobr1
Copy link
Owner

jonobr1 commented Dec 6, 2019

I think this is a good idea. What in your mind could be further cut down? I think in some ways this is symptomatic of a larger issue which I think ES6 Modules would fix.

@jonobr1 jonobr1 added this to the v0.8.0 milestone Dec 6, 2019
@adroitwhiz
Copy link
Contributor Author

A lot of the "is" functions (isUndefined, isNumber, isString, etc.) can be replaced with typeof checks.

In addition, there are certain functions like values (and several "is" functions) that are never used in the codebase, and functions like map, each, bind, and isArray that can be replaced with native methods.

@adroitwhiz
Copy link
Contributor Author

I've done some work in this branch

@jonobr1
Copy link
Owner

jonobr1 commented Dec 7, 2019

Cool, I'll keep on eye on that branch!

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

Successfully merging a pull request may close this issue.

2 participants