jquery.sparkline icon indicating copy to clipboard operation
jquery.sparkline copied to clipboard

Why .js files are split into parts?

Open webpolis opened this issue 12 years ago • 25 comments

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.

webpolis avatar Aug 22 '13 19:08 webpolis

I just asked the same question in #70

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

soullivaneuh avatar Aug 28 '13 13:08 soullivaneuh

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

gwatts avatar Sep 02 '13 15:09 gwatts

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... :/

soullivaneuh avatar Sep 02 '13 15:09 soullivaneuh

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 [email protected] 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.

gwatts avatar Sep 02 '13 17:09 gwatts

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. ;)

soullivaneuh avatar Sep 02 '13 19:09 soullivaneuh

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 [email protected] 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.

gwatts avatar Sep 02 '13 21:09 gwatts

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...

soullivaneuh avatar Sep 03 '13 07:09 soullivaneuh

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

gwatts avatar Sep 15 '13 19:09 gwatts

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

kapusta avatar Nov 18 '13 20:11 kapusta

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.

mariusGundersen avatar Dec 20 '13 14:12 mariusGundersen

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

arcseldon avatar Feb 16 '14 15:02 arcseldon

Totally agree with @mariusGundersen & @arcseldon

Guys, please include built version for bower users.

okendoken avatar Mar 05 '14 11:03 okendoken

+1

seglo avatar Apr 03 '14 20:04 seglo

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.

follesoe avatar Apr 11 '14 13:04 follesoe

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.

neverfox avatar Apr 13 '14 18:04 neverfox

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

gwatts avatar Apr 13 '14 18:04 gwatts

Good to know. Thanks.

neverfox avatar Apr 13 '14 18:04 neverfox

@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.

tony avatar Jun 25 '14 18:06 tony

+1 for built version of this.

JGailor avatar Sep 30 '14 20:09 JGailor

+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?

vladmiller avatar Oct 24 '14 11:10 vladmiller

+1 i want bower support.

geminiyellow avatar May 07 '15 08:05 geminiyellow

+1 bower support.

A-owl avatar Jul 28 '15 03:07 A-owl

+2 for bower support.

@gwatts How can I help to force things?

estliberitas avatar Nov 20 '15 00:11 estliberitas

+1

anthonyvialleton avatar Dec 17 '15 08:12 anthonyvialleton

+1 for bower support

ccravens avatar Jul 22 '16 04:07 ccravens