Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor all scripts as modules or helpers #47

Closed
kittsville opened this issue Jun 14, 2015 · 10 comments
Closed

Refactor all scripts as modules or helpers #47

kittsville opened this issue Jun 14, 2015 · 10 comments

Comments

@kittsville
Copy link
Owner

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
Copy link
Owner Author

Currently waiting on completion of Dev Kit asset minification.

@kittsville
Copy link
Owner Author

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

@kittsville kittsville assigned kittsville and unassigned kittsville Jun 20, 2015
@kittsville
Copy link
Owner Author

Actually screw that, I'm playing Transistor.

@kittsville kittsville added this to the Alpha V3 (Badger Claw) milestone Jun 21, 2015
@kittsville kittsville self-assigned this Jun 24, 2015
kittsville added a commit that referenced this issue Jun 24, 2015
Renamed JS
Moved to modular JS design #47
Removed unnecessary addition of an HTML class the member metabox already
had
Started system of prefixing all dynamically loaded Dash JS with 'Dash'
instead of 'Admin'
Improved clarity of Manage Item page generation
Fixed member metaboxes being hidden but kept in DOM (selecting many
members would bloat the DOM)
@kittsville
Copy link
Owner Author

See 5d698df, b3161df, 94dcafa, 5b55d92, 636a44b

@kittsville
Copy link
Owner Author

See 0610470. I need to start remembering to reference issues in commits.

@kittsville
Copy link
Owner Author

Meanwhile, in the global JS namespace
lvbfbdl

kittsville added a commit that referenced this issue Jul 5, 2015
Moved script handling to dedicated object
Removed unused functions
#47
@kittsville
Copy link
Owner Author

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
Copy link
Owner Author

That gif is really distracting.

kittsville added a commit that referenced this issue Jul 5, 2015
@kittsville
Copy link
Owner Author

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

@kittsville
Copy link
Owner Author

Actually I'll create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant