Markup-Based Feature Management
AV is a lightweight framework for running and managing Javascript features. It executes features based on properties you set in the body tag, allowing you to switch performance-expensive features on and off. More importantly, it makes your features super-flexible by providing easy ways to modify feature configuration on a per-instance basis.
Details
-
Feature Launching from Markup
AV executes features based on attributes on the body tag, giving you tighter control over when performance-expensive features run.
-
Feature Organization
You can also create 'sets' of features for easier launching and configuration. For example, you might have a number of form-related features that are useful in various contexts, but which all need to fire in a certain way on the 'contact' page of a site.
-
Option Collection From Markup
When features run, AV automatically checks their target elements for HTML5
data-attributes. When relevant ones are found found, these get used as options in the feature configuration. -
Option Cascading
AV allows you to set configuration options in a feature, selectively overwrite them using a set, and selectively overwrite them again on a per-instance basis using 'data-' attributes. This allows for extremely flexible features and standardizes a pretty common pattern - using
data-attributes to collect information from the markup.
Does that make sense? No? Check out Usage or a Simple Example for more info.
Download
- av-0.0.1.js (7.7k)
Still Working On...
- Giving devs a standard way to fit new functions into doc.ready an window.onload
- Making AV jQuery-independent
- Standardizing a place for reusable smaller functions
- Cleaning and reorganizing AV's core functions
- Make benchmark() more accessible inside features themselves
- Better AV.config handling
- Cleaner handling for non-obj features.
Critiquing
AV is the first time I've used a lot of these Javascript features. This means that if you read the code and have some feedback go easy plz 'cause of my feelings tear this mother apart. AV is more valuable to me as a learning experience than as an application, so please leave any feedback on AV's gitHub page. Bonus points for feedback containing profanity!