angular / angular-hint

run-time hinting for AngularJS applications
362 stars 45 forks source link

Create a high level library of helper functions #14

Closed ealtenho closed 9 years ago

ealtenho commented 10 years ago

There are a number of helper functions shared between many modules. For instance the method of logging messages and of checking spelling are redundant in different modules. We should refactor these into one central place.

@btford , @caguillen214 is a file in this repository the correct place for a shared library to live?

btford commented 10 years ago

–> https://github.com/angular/angular-hint-log

here ya go

ealtenho commented 10 years ago

Awesome! Thank you @btford. I started working on the messaging repo #17

I'm wondering if we should also have a shared place for functions like @caguillen214's spell checking function? I think several of his repos make use of that functionality? Or maybe that library (ddLib I think?) should be a separate node module akin to dom-interceptor.js so that it could be loaded separately?

btford commented 10 years ago

I'm wondering if we should also have a shared place for functions like @caguillen214's spell checking function?

Yeah probably.

We should also check that something like @caguillen214's function doesn't already exist in npm.

caguillen214 commented 10 years ago

I looked around the npm website and found https://www.npmjs.org/package/natural, which has a various number of string comparison functions. However, it has a lot more than we need (just the levenshtein distance) so should we really add the whole npm module if we're not going to use the whole thing?

btford commented 10 years ago

We definitely want something more minimal, as opposed to a "kitchen-sink" module.

npm search levenshtein seems to have many options. check out some of those.

caguillen214 commented 10 years ago

I've looked at some of the levenshtein packages and even the ones that are just levenshtein packages provide a few other methods that we really dont need. These packages are significantly more light weight than the 'kitchen-sink' packages.

We only need to calculate the LD and right now we have a function that does that, is it the best option to include a package from npm?

ealtenho commented 9 years ago

https://github.com/angular/angular-hint-events/issues/2 @caguillen214

ealtenho commented 9 years ago

https://github.com/angular/angular-hint/issues/25 duplicate discussion

ealtenho commented 9 years ago

@caguillen214 refactored the duplicate functionality to use the suggest-it npm module.