bespokejs / bespoke

DIY Presentation Micro-Framework
http://markdalgleish.com/projects/bespoke.js/
MIT License
4.69k stars 442 forks source link

Current Index #6

Closed ultimatedelman closed 11 years ago

ultimatedelman commented 11 years ago

I know this is trivial to derive, but it would be fantastic if the deck had a "currentIndex" property or something like it. Can't be that much more code.

markdalgleish commented 11 years ago

I'll focus on fixing #7 first, then give this one a look.

markdalgleish commented 11 years ago

I implemented this, but it ended up adding around 10 bytes to core.

Because Bespoke.js is billed as being less than 1KB, I need to weigh up the relative importance of every extra byte. As you rightly pointed out, it's trivial for a plugin to keep track of the current index using events if it's required, so unfortunately this change currently doesn't make the cut.

I'll feel much more comfortable making this change once the project has been dormant for a long time and it's clear that the extra bytes can be spared.

ultimatedelman commented 11 years ago

Hate to break it to you, but your 1kb ship has long since sailed. Your minified version is just over 2KB as is :\

markdalgleish commented 11 years ago

That's 1KB minified and gzipped. Bespoke.js is currently 1005 bytes according to Grunt:

Running "min:dist" (min) task
File "dist/bespoke.min.js" created.
Uncompressed size: 5247 bytes.
Compressed size: 1005 bytes gzipped (2234 bytes minified).

Done, without errors.