emmanueltouzery / prelude-ts

Functional programming, immutable collections and FP constructs for typescript and javascript
ISC License
377 stars 21 forks source link

Clean up package? #36

Closed aleksei-berezkin closed 4 years ago

aleksei-berezkin commented 4 years ago

You mentioned this several times. Just wondering what's the problem with it? Perhaps I can help.

emmanueltouzery commented 4 years ago

hi, thank you, i appreciate that!

sorry though, my description of the task was pretty poor. in reality what i want to do is clean up what goes in the npm package.

if we look at this: https://www.npmjs.com/package/prelude-ts

we can see that the prelude-ts package is over 6 megabytes and contains 316 files! that because we publish too many things on npm. the source code, the apidoc, the tests... I think we should just publish the artifacts (source+minified source). Otherwise people also get the wrong impression and think this library is bloated.

although this site is not even that bad: https://bundlephobia.com/result?p=prelude-ts@0.8.3

i think that list change is related: https://github.com/funkia/list/commit/4cbda9d1ff7fc4337c3dd5177d019f24a4fd461c

i didn't however really spend the time yet to think exactly what must be done to fix that.

aleksei-berezkin commented 4 years ago

Well, the largest part is apidoc

$ du -h ./node_modules/prelude-ts
...
3.6M    ./node_modules/prelude-ts/apidoc
...

In fact it's the first time I actually noticed there are API docs. I mean, there is well structured source shipped, why do I need API docs? :)

Basically, everything besides /dist/src can be omitted. But having /src is also very helpful. For example, I can easily navigate to class (function) original (TypeScript) definition in couple of keystrokes.

emmanueltouzery commented 4 years ago

yes honestly i'm a little torn about this. i think this info is useful, it's a little annoying that we get punished for shipping useful things. on the other hand i can understand if someone installs a node package, and gets hundreds of transitive deps and then has a node module in the gigabytes, that that person is annoyed.

maybe we can just drop the apidocs and that's it for now? that would mean we would keep:

emmanueltouzery commented 4 years ago

normally we have all the apidocs per version online, including for past versions. so dropping the apidoc should not be such a problem for users.

aleksei-berezkin commented 4 years ago

Perhaps these are not needed too, tests are almost 1 MB btw

$ du -h ./node_modules/prelude-ts
984K    ./node_modules/prelude-ts/dist/tests
 40K    ./node_modules/prelude-ts/dist/benchmarks
 60K    ./node_modules/prelude-ts/dist/scripts/make_doc_extra
 60K    ./node_modules/prelude-ts/dist/scripts
...
aleksei-berezkin commented 4 years ago

These guys probably too. Though they're not the largest

$ du -h ./node_modules/prelude-ts
...
168K    ./node_modules/prelude-ts/tests
 16K    ./node_modules/prelude-ts/benchmarks
 20K    ./node_modules/prelude-ts/scripts/make_doc_extra
 36K    ./node_modules/prelude-ts/scripts
4.0K    ./node_modules/prelude-ts/.circleci
4.0K    ./node_modules/prelude-ts/www_demo
...
emmanueltouzery commented 4 years ago

i agree on all :+1:

aleksei-berezkin commented 4 years ago

Addressed one of issues in https://github.com/emmanueltouzery/prelude-ts/pull/37

aleksei-berezkin commented 4 years ago

Addressed all issues in https://github.com/emmanueltouzery/prelude-ts/pull/37. Closing this so we continue discussing inside PR.