2.0.0
I have created a github release for this major version bump because I thought it warranted an explanation.
This release has no javascript api changes so you can probably upgrade without any issues. The version bump is because of this pull request: #9.
This major version bump was the result of removing module
from package.json
:
- "module": "src/index.js",
module
is used to expose raw es6 sources for bundlers. It seems like the main use case for using module
is to allow removing duplicate imports via tree shaking. A few problems with module
in memoize-one
:
- The file itself was the raw source file. This meant that it would require the consumer to have the correct environment or babel setup for the file to be parsed correctly. This would mean that consumers would need and environment that supported: babel-preset-es2015, babel-plugin-transform-object-rest-spread and babel-plugin-transform-flow-strip-types.
- The file contained flow types. This is similar to the previous issue where it forced consumers to have the correct babel plugins set up. If you where not using the strip-flow-types babel plugin then your build would throw errors.
My thoughts on what would be the ideal module
:
compiled es5 source with es6 imports.
Given that memoize-one
has no dependencies there is no tree shaking advances in exposing it through module
.
Given that some people may have been explicitly relying on using the module
in memoize-one
previously I have made it a major version bump to remove it. While I expect that most module bundlers would have simply switched to main
with no issues - I wanted to be really safe and just do a major version bump. I think that module
is a public api and removing it therefore constitutes a break in api.