dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.64k stars 280 forks source link

Remove Babel runtime #109

Closed dthree closed 8 years ago

dthree commented 8 years ago

@scotthovestadt would like to discuss this with you, simply because the babel-polyfill and babel-runtime modules which are now required for Vorpal take up 2.89MB on a raw download. A few useful shims to me is not worth this.

One of the most important aspects to Vorpal to me is the size. I want it to be a lightweight plug into an app, and right now it makes any app monolithic (adds 5.5MB).

I am also seeing if I can eliminate lodash in the near future as well as it is 1MB in itself. Unfortunately Inquirer.js also depends on this, but if I can handle this, it would bring Vorpal to 844kb.

As a comparison,

Do you see where I'm coming from? Size is pretty important to me. I'm additionally releasing Cash on Monday, and I advertise right off how small it is, when Vorpal is making it huge.

What do you think we can do? Thanks.

ristomatti commented 8 years ago

@dthree would it make sense to use babel-cli and do with the syntax it can compile without the use of polyfills? The babel modules would be just devDependencies in package.json. The .npmignore file could be configured so that only the module root and the dist directory would be included in the NPM package.

James Nelson has written a nice example of that kind of configuration in his post Writing NPM packages with ES6 using the Babel 6 CLI.

dthree commented 8 years ago

@ristomatti that's what I have normally been doing, however apparently in order to use some shims in Babel 6, it requires a polyfill lib in the devs. This may be incorrect, I just don't know enough about Babel to give a correct answer at this time, and @scotthovestadt seemed to think this was the case, at least for a bit.

ristomatti commented 8 years ago

@dthree yes so it seems. Promises seem to require that. Since Promises are something that really make a big impact on the code readability but seem to be pretty standard in API, maybe some module providing only Promise support could be smaller in size?

Small app size is definately a good thing but I would at least pause for a moment to think if it really is something to worry about in this case unless Vorpal is also used for web development(?). It's worth noting that Node itself is a huge size overhead.

Node is definately popular in environments with little resources but I would argue resources typically being more constrained on CPU, memory and bandwidth than storage. In an environment with very little storage, a compiled binary or a traditional shell script would probably be a more likely choice and a better fit than anything built on top of Node.

scotthovestadt commented 8 years ago

I agree with the point @ristomatti made that space isn't an issue in a NodeJS environment. Certainly 1-2MB is not something I worry about.

I think if you like what we can probably do is remove babel-runtime and keep babel-polyfill. babel-polyfill is preferred, but this issue keeps it from being effective, so I think unless it'll be fixed soon we just drop the runtime and it'll cut the deps in half.

dthree commented 8 years ago

Or we could drop support for .10 - .12... :)

dthree commented 8 years ago

I'm actually thinking about it. I guess we'd have to bump to 2.0 if we drop support for those, but it would be nice.

Do you have any idea what percentage of companies use those older versions?

scotthovestadt commented 8 years ago

I honestly think that basically everyone using node would rather have an extra dependency than worry about having a specific node version.

I think we can drop babel-runtime and use only babel-polyfill for the immediate future, until the runtime lib is more mature.

On Saturday, February 20, 2016, dc notifications@github.com wrote:

I'm actually thinking about it. I guess we'd have to bump to 2.0 if we drop support for those, but it would be nice.

Do you have any idea what percentage of companies use those older versions?

— Reply to this email directly or view it on GitHub https://github.com/dthree/vorpal/issues/109#issuecomment-186728511.

dthree commented 8 years ago

Okay let's do that then - just drop the babel runtime.

dthree commented 8 years ago

@scotthovestadt you think you can help with this in the near future? Thanks.

scotthovestadt commented 8 years ago

Yeah. I'll look at it tomorrow. There was a Babel update today and I also want to go through change log.

On Tuesday, March 1, 2016, dc notifications@github.com wrote:

@scotthovestadt https://github.com/scotthovestadt you think you can help with this in the near future? Thanks.

— Reply to this email directly or view it on GitHub https://github.com/dthree/vorpal/issues/109#issuecomment-191058220.

dthree commented 8 years ago

Awesome! I'm on a roll right now, closed almost 15 issues today so far. Would like to zero out soon.

scotthovestadt commented 8 years ago

Done.