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

Why .js files are split into parts? #92

Open webpolis opened 11 years ago

webpolis commented 11 years ago

Hi

You have header.js, base.js... all code split into parts.. why is that? It makes very difficult to include this package using bower or grunt tools, or do minification tasks over the source.

Please advise.

Thanks.

soullivaneuh commented 11 years ago

I just asked the same question in #70

There is a makefile, but it is not convenient for direct implementation...

gwatts commented 11 years ago

they're split into parts to make it easier to develop.

Building it is very simple; I can't imagine it'd be hard to have grunt do the same thing the Makefile does now - If you're motivated to come up with a suitable grunt script then feel free - I haven't spent anytime looking into either bower or grunt.

I'm not interested in checking in a built copy of the plugin into git though

soullivaneuh commented 11 years ago

And why not a git repo for builts ?

Indeed, in some project, we can add a hooks to launch the makefile, like this in composer.json for Symfony2:

"scripts": {
    "post-install-cmd": [
        "cd src/Acme/MainBundle/Resources/public/lib/sparkline && make all",
    ],
    "post-update-cmd": [
        "cd src/Acme/MainBundle/Resources/public/lib/sparkline && make all",
    ]

But install uglify-js and compile in each update in a production server, not really good... :/

gwatts commented 11 years ago

You don't need to build it at all if you just download the release off the project web site - the git repo is for development

Sent from my email client

On Sep 2, 2013, at 11:54, Sullivan SENECHAL notifications@github.com wrote:

And why not a git repo for builts ?

Indeed, in some project, we can add a hooks to launch the makefile, like this in composer.json for Symfony2:

"scripts": { "post-install-cmd": [ "cd src/Acme/MainBundle/Resources/public/lib/sparkline && make all", ], "post-update-cmd": [ "cd src/Acme/MainBundle/Resources/public/lib/sparkline && make all", ] But install uglify-js and compile in each update in a production server, not really good... :/

— Reply to this email directly or view it on GitHub.

soullivaneuh commented 11 years ago

Bower is a dependencies manager, thanks to it, we can get latest minor version that is good think, because we don't always check new version of all js libraries ourself.

Sorry for my english. ;)

gwatts commented 11 years ago

All well and good, but if you want the bleeding edge you'll have to build it, as you would with almost any other github project (including jQuery itself afaik)

Sent from my email client

On Sep 2, 2013, at 15:27, Sullivan SENECHAL notifications@github.com wrote:

Bower is a dependencies manager, thanks to it, we can get latest minor version that is good think, because we don't always check new version of all js libraries ourself.

Sorry for my english. ;)

— Reply to this email directly or view it on GitHub.

soullivaneuh commented 11 years ago

Source repo of jQuery: https://github.com/jquery/jquery Builts repo of jQuery: https://github.com/components/jquery

But not the same user, maybe we have to contact us in order to propose your buildted package...

gwatts commented 11 years ago

If you want to figure out what steps are needed to have a build of the plugin hosted in the components project, then I'll gladly take a pull request

kapusta commented 10 years ago

Fwiw, I just submitted a PR that Grunt-ifies the build process.

mariusGundersen commented 10 years ago

Bower does not use the bleeding edge, it uses tagged releases. It is very common to include a built version in the repo for bower. It would be great if you could include it too.

arcseldon commented 10 years ago

Bower does not use the bleeding edge, it uses tagged releases. It is very common to include a built version in the repo for bower. It would be great if you could include it too. +1

okendoken commented 10 years ago

Totally agree with @mariusGundersen & @arcseldon

Guys, please include built version for bower users.

seglo commented 10 years ago

+1

follesoe commented 10 years ago

Had same issue as many of you. But - as a tip you can use bower to install single files from any HTTP URL: bower install --save http://omnipotent.net/jquery.sparkline/2.1.2/jquery.sparkline.js will pull in sparkline for you.

neverfox commented 10 years ago

That's true @follesoe, and it's the solution I'm having to use now. But it's less than ideal because it cannot respond to new releases with semver.

gwatts commented 10 years ago

The latest release is now also at http://omnipotent.net/jquery.sparkline/latest/jquery.sparkline.js fwiw

neverfox commented 10 years ago

Good to know. Thanks.

tony commented 10 years ago

@gwatts : Any updates here? jQuery's latest version switched to modularize their plugin, have you considered that approach?

The latest release is now also at http://omnipotent.net/jquery.sparkline/latest/jquery.sparkline.js

bower install --save http://omnipotent.net/jquery.sparkline/2.1.2/jquery.sparkline.js

I'm not interested in checking in a built copy of the plugin into git though

I feel you, keeping refs to built versions of the plugin isn't philosophically pure or efficient. Other plugins are breaking this best practice, they've come to the consensus that having a built version available is friendly and consistent to developers.

In the here and now, people would opt to have a built version in your git they can grab via bower.

In the long term, future versions of bower will address this issue.

JGailor commented 10 years ago

+1 for built version of this.

vladmiller commented 10 years ago

+1 for this feature It's not hard to do and a lot of people begging for this, why just don't simply add precompiled version to the repo?

geminiyellow commented 9 years ago

+1 i want bower support.

A-owl commented 9 years ago

+1 bower support.

estliberitas commented 8 years ago

+2 for bower support.

@gwatts How can I help to force things?

anthonyvialleton commented 8 years ago

+1

ccravens commented 8 years ago

+1 for bower support