Compile all code for a better experience and flatten API #132
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It all starts NOW
This is a BIG BREAKING CHANGE!
This mainly addresses this issue and compiles all code into ES5 mainly so it can be used in Safari and IE/Edge without having the end user compile our stuff from their project (total bad news bears).
Two other things were started with the change, as it was going to be a breaking change anyway, decided to make the first step to a monorepo to address this issue. By flattening the API, it makes it easier to determine inner-dependency within the library and isolate it appropriately.
All code that is referenced by other functions/types in the library is now inside of a
core
folder, which will be the start of@crocksjs/core
which will hold all the base code needed by the other functions. Another benefit of flattening the API is a lightened cognitive load of rememebring if this is apointfree
orhelper
function. All functions, regardless of their type can be reached fromcrocks/lib/[function_name]
, so no need to keep classification for each function in your head.Another benefit of the separation of core, is that I removed all type checking (except for the
crocks
andmonoids
) and currying for the core versions of the functions. This greatly improves performance by only doing type checks once, before calling the functions in core. Also no extra currying, it leaves all currying in the public available API. This is the first stage of optimizing the code and improving for other libs that would like to use some of these bits.