soundtrack
soundtrack copied to clipboard
Refactoring / Plugin architecture?
Just thinking outloud here... Would @martindale be open to if I played around with refactoring the app a bit? soundtrack.js
is starting to become a really long file. Would it be worth exploring breaking it out into little modules? (For example, last.fm would be a plugin...)
This could make extending it easier going forward as well.
This is more of a question / start the discussion than any particular idea on how we do it.
+1! I absolutely have been wanting to do this, so if you've got an idea on what you think it'd look like feel free to share -- either here or in a "work in progress" pull request if you want to get some code written as an example (it might help to just get started, so there is something we can talk about moving forward).
@pantlesswonder and I have been racing each other into a refactor since the app has grown so much since the first prototype, but neither of us have gotten to it yet. I did start to create a more general reference application (see martindale/maki), but it only covers the more generic MVC architecture. More consideration should be put into the "timers" and listener tracking -- please feel free to use it as a starting point!
@martindale nice! I too have a "starter framework" -- rschmukler/sik. So far it has worked out really well for me. I haven't documented it fully though.
I'll look into some structuring and see what I can come up with. Again, if anything I do is too different, totally fine to shoot it down or give honest feedback. Like I said, just a discussion at this point :)
FYI, I started on this! Getting things out of "terrible hack" status into "barely admissable" by structuring things neatly into ./lib/soundtrack.js
. Take a look, please!
Sorry to be dense, but which branch has ./lib/soundtrack.js
?