DmitryBaranovskiy / raphael

JavaScript Vector Library
https://dmitrybaranovskiy.github.io/raphael/
MIT License
11.27k stars 1.67k forks source link

Split into smaller chunks and then use a build script to concat. #186

Closed jdalton closed 14 years ago

jdalton commented 14 years ago

The source is more than 3500 lines long and looks to be pre-minified. It would be awesome if you removed all the pre-minifications (ex: proto = "prototype") and did that as part of a build process. Also with 3500+ lines it's easy to get lost in the muck. With frameworks and other projects of substantial code size it is easier for devs to follow if you break it down into different JS files and then concat together for a finished build.

michaelficarra commented 14 years ago

While I do support breaking down the quite unruly raphael.js file into many sections/files, the "pre-minifications" you are talking about are optimizations to allow the minifier to reduce code it may not be able to reduce otherwise. For another example of this, see LABjs.

jdalton commented 14 years ago

Right, and it's horrid. With LABjs it may be excusable because its job is to load other scripts so it's footprint should be as minimal as possible. Also LABjs is less than 400 lines, so while it's hard to read you don't have to read through as much. Taking something like a graphics lib and applying this extreme pre-minification just makes it harder to read, debug, and modify.

DmitryBaranovskiy commented 14 years ago

The good thing about Raphaël is that I could write it the way I like. So far I don’t feel necessity in splitting the code.

jdalton commented 14 years ago

Good luck with that :P