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

Is this library pure? #1193

Closed
light0x00 opened this issue Jun 9, 2019 · 2 comments
Closed

Is this library pure? #1193

light0x00 opened this issue Jun 9, 2019 · 2 comments

Comments

@light0x00
Copy link

It's a great project. I love it.
But I see sideEffect is not set in package.json.
so Is this library pure?

@TrySound
Copy link
Contributor

TrySound commented Jun 9, 2019

sideEffects: false field does not mean the library is pure. It's mostly a hack for webpack analyzer. Rollup uses it too but it's useful for more complicated cases like transpiled classes. This library is written with only functions.

@kossnocorp
Copy link
Member

It's a great project. I love it.

Thank you a lot!

But I see sideEffect is not set in package.json.

It's set in v2 to false in the root directory and each module.

so Is this library pure?

It depends on what you mean by pure. The library code doesn't produce side effects so can be tree-shaken (that's why we have sideEffects). If you mean FP-pure, then yes it doesn't use Date.now at the moment but I'm going to change that, see #1184 but anyways date-fns/fp will stay pure.

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

No branches or pull requests

3 participants