gwatts / jquery.sparkline

A plugin for the jQuery javascript library to generate small sparkline charts directly in the browser
http://omnipotent.net/jquery.sparkline/
1.24k stars 278 forks source link

Crossplatform build system #160

Closed 11bit closed 8 years ago

11bit commented 8 years ago

What do you think about replacing build system based on makefile and shell commands with something cross-platform? I am mostly talking about Windows users who don't have these great tools.

I know it is a big change in workflow but it has two advantages:

  1. It will be easier to contribute for windows users.
  2. Nowadays dependency management with NPM is really getting traction. It is especially usefull for big projects. There is jquery-sparkline package published on npmjs.com but is not possible to install it on windows due to the fact it tries to build from sources with make script.

NPM itself may be a good candidate for the build tool because it has a way to explicitly specify tools as dependencies (no need to install uglify-js separately) and in general is convenient for javascript projects.

What do you think regarding it?

ChrisFerrell commented 8 years ago

Yeah, this is a huge problem that we ran into yesterday. Now that we're using jspm, we can't use jquery-sparkline because it won't build on windows. That's a shame, because it's a great library, but we're going to have to look at an alternative package now

gwatts commented 8 years ago

Why build it at all? The repo is explicitly for development, not for production distribution. All these tools that conflate the two are broken.

If you want to use it on windows, just download it http://omnipotent.net/jquery.sparkline/2.1.2/jquery.sparkline.min.js.gz - simple. I'm sure whatever build system you're using is capable of that.

If someone wants to package it and upload it to a distribution service, then great, but that's should have little to do with the github repo.

11bit commented 8 years ago

@gwatts, thanks for reply. After a small research I found two different questions:

One is that user @imsky who published jquery.sparkline to npm didn't include build artefacts in it. Our issue can be solved either by including build artefacts there or by pushing alternative jquery.sparkline into npm.

Second question is that build tool for this lib is a bit hard to use on Windows and in general is not a usual way of building js libraries nowadays. But build tool is a very personal thing so if author used to make and don't want to change it I can totally understand it. @gwatts if you want to try full javascript build stack I can make a PR to see how it works for you. But you are right - it is not really connected with distribution.

So I will talk to @imsky if he can include builded version too.

gwatts commented 8 years ago

I used Makefiles as they were convenient for me at the time, and very simple.

If someone wants to put the effort into an npm based build setup and package.json that works cross-platform, that'd be fine with me.

The one thing I don't want is built artifacts in this source repo (eg. dist/jquery.sparkline.js)

imsky commented 8 years ago

My mistake - I'll look into regenerating the package with build artifacts.

11bit commented 8 years ago

Thanks @imsky. That would be really helpful for windows users.

@gwatts I did a prototype with build script written in javascript https://github.com/gwatts/jquery.sparkline/pull/165. Although with having artefacts in npm package I am not sure if it solves any real problem. I don't think there are a lot of windows developers who want to contribute. So I did it mostly as a proof of concept.

The one thing I don't want is built artifacts in this source repo (eg. dist/jquery.sparkline.js)

Totally agree with it.

imsky commented 8 years ago

Following up on this - let me know if it's still necessary.

11bit commented 8 years ago

@imsky Yes, it would be really helpful if you can regenerate a package to include build artifacts.

imsky commented 8 years ago

OK, will do tonight

imsky commented 8 years ago

Done. v2.3.2 should include the full and minified artifacts. For any subsequent PRs, please submit them to https://github.com/imsky/jquery.sparkline

11bit commented 8 years ago

Thanks @imsky. Everything works great, even on windows