Konnektid / konnektid-js-utils

Several javascript utilities used throughout Konnektid
0 stars 0 forks source link

Add functional utilities #3

Open rewop opened 7 years ago

rewop commented 7 years ago

We should add in this module all the functional utilities we are using in konnektid private code.

We have a very good library in inventory-service.

The functional utilities can be in the folder src/functional/....

rewop commented 7 years ago

@Lapixx what do you think?

tkers commented 7 years ago

@rewop I think of utils as a set of functions that don't really belong in any other module. At some point when you have enough functions of the same kind you could simply extract them and put them in their own module.

That having said, I think it makes more sense to have separate konnektid-type-utils and konnektid-functional-utils packages that would be smaller, more focussed and easier to maintain. Basically whenever a function is not placed in the root src/ folder I'd argue it shouldn't be in a generic utils package at all. So my suggestion would be to rename this repo to something reflecting the types functions (and merge #2) and place functional utility functions in a separate module.

I know fbjs also uses one big repository but looking at our previous attempts of creating a utils package I'm afraid it will become bloated at some point (and any package that just needs to convert km to miles is also installing code to connect to 4 social networking websites).

rewop commented 7 years ago

@Lapixx I thought about that, and with this module I decided that for the sake of simplicity, first I would like to collect all functions here, and then see what can be split in different modules when we have a better overview.

tkers commented 7 years ago

If you think that is easier, sure. Just pointing out that for these 2 cases there are already clear boundaries between types and functional.