|
|
|
|
|
by skybrian
3778 days ago
|
|
Tree shaking is helpful but not enough. It makes dependencies more fine-grained and binaries smaller by removing some false sharing. But library maintainers still have to be careful about true sharing, where a function calls another function, which in turn pulls in something big (like a lot of data stored in a constant). You need both tree shaking and a community dedicated to keeping code small. Javascript has the latter; it's not universally true, but lots of JavaScript libraries pride themselves on small code size and few dependencies. That's great. But you can't stop doing that work just because you have a tree-shaking compiler. For example, there's a lot of work going into making Angular 2 apps reasonably sized and dart2js doesn't magically make it go away. |
|