imjuni / jshs2

jsHS2 is a node.js client driver for hive server 2
http://imjuni.github.io/jshs2/
MIT License
34 stars 12 forks source link

The thrift dependency is bloated #7

Open Downchuck opened 8 years ago

Downchuck commented 8 years ago

The npm thrift project is not packaged for library use, and it requires about 30 megs of space. It's fine for devDependencies but should not be used for production (distribution) builds.

This is just a copy of the whole thrift repo, basically: https://www.npmjs.com/package/thrift

That's overkill, when we only need the JS thrift client.

imjuni commented 8 years ago

@Downchuck Your right, we don't need to whole thrift for jshs2. I will check it after change thrift to node-thrift.

Downchuck commented 8 years ago

@imjuni I've not found a minimal distribution of thrift on npm. Have you had any success?

imjuni commented 8 years ago

@Downchuck I've to confused between node-thrift and thrift. I think thrift@0.9.3 is more than suitable for jshs2. But I will find more suitable library for jshs2.

Downchuck commented 8 years ago

@imjuni I've not found a thrift package that's appropriate. I think they both include the full set of source code for thrift, including code for go, java, php and python.

Downchuck commented 8 years ago

https://issues.apache.org/jira/browse/THRIFT-3485 https://github.com/apache/thrift/pull/741

imjuni commented 8 years ago

@Downchuck I was to check the https://github.com/apache/thrift/pull/741, node-thrift 0.9.3 is not solve fat library problem. And I was to check https://github.com/apache/thrift/commit/f264884901d0e2a1197ae1511ee0fa0b8ca0d2aa, I see that commit log in this command,

> mkdir -p /tmp/thrift-module
> cp -r node_modules/thrift/lib/nodejs/{lib,README.md} /tmp/thrift-module
> du -sh /tmp/thrift-module
208K    /tmp/thrift-module

If you need compact library at this time, you make compact library self. jshs2 aim to general and convenience, not aged like another library. So I don't want fix it this time. Sorry about that. But I will check node-thrift version or update, I will apply that.

thx.