kittsville / WP-Librarian

WP-Librarian is an inventory management WordPress plugin for keeping track of books and media
GNU General Public License v3.0
4 stars 1 forks source link

Refactor all scripts as modules or helpers #47

Closed kittsville closed 9 years ago

kittsville commented 9 years ago

WP-Librarian's scripts are a mess. A collection of small pieces of functionality that merged and connected together with no clear structure. Pretty much all of the scripts reflect some stage in my level of experience with JavaScript, creating a diverse range of methods to achieve their purpose.

This issue aims to deal primarily with restructuring the scripts into modules, with helpers where it would be silly to wrap unconnected functions up as a module. It is inevitable though that some scripts will end up being worked on during this process to some degree. Even if just to remove some of the more feckless comments (read: 'x.doY() // Does Y to X).

kittsville commented 9 years ago

Currently waiting on completion of Dev Kit asset minification.

kittsville commented 9 years ago

Dev Kit asset minification has now been completed. Full steam ahead with this issue!

kittsville commented 9 years ago

Actually screw that, I'm playing Transistor.

kittsville commented 9 years ago

See 5d698df5e470bc744efe304aa7c8dce82b03255d, b3161dfc852d3c887a500591d0b92c575e7728a6, 94dcafa64396d6098aec80c84d33f6f286cfc601, 5b55d923a3656e7f8218a467575d860848d522a4, 636a44bc4dff10b2f63bcfecb920cdb373ad5197

kittsville commented 9 years ago

See 061047031c557ec7efb0ebe34b4fc4d0bbd7d5db. I need to start remembering to reference issues in commits.

kittsville commented 9 years ago

Meanwhile, in the global JS namespace lvbfbdl

kittsville commented 9 years ago

admin-core.js feels harder to read given the new 'Notifications' module. While it works great for the page-dependant scripts on the Dashboard I'm not sure if it works for the core.

I really wish I could find something out there for WordPress JS design paradigms. There's a good article on project structure and minification/use of LESS/SASS (which I do miss since Rails) but I've been unable to find anything about JS structure itself. I'm guessing most people only use JS for small things in WordPress and outside of WP they use one of the many frameworks. Sucks to be me.

kittsville commented 9 years ago

That gif is really distracting.

kittsville commented 9 years ago

While the core scripts still need refactoring WP-Librarian is overdue a release. I'm putting this issue on hold until Bowie.

kittsville commented 9 years ago

Actually I'll create a new issue.