-
Notifications
You must be signed in to change notification settings - Fork 121
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
Modularize Response's methods #19
Comments
NPM modules that use UMD (like verge) could be added as devDependencies and bundled via grunt into this pattern: !function(root, name, make, bundle) {
make = make.call(root, bundle);
if (typeof module != 'undefined' && module['exports']) module['exports'] = make;
else root[name] = make;
}(this, 'Response', function(bundle) {
// Make export here with private access to bundle.
return {}; // Return export with properties/methods.
}, function(module, define) {
// Dependencies (inserted via grunt) run in controlled scope.
}.call({})); |
An alternative to bundling is |
Response's methods fit into two categories:
.create()
,.addTest()
, etc.).dataset()
,.viewportW()
, etc.) Some of these are better aligned with the "responsive design toolkit" goal than othersThe current homepage is focused on the breakpoint-swapping feature. After the 0.3 changes (when several methods were made public) I started working on a new version of the docs here. Yet I hesitated to put that on the homepage in fear of documenting any methods that might soon change.
Putting general-purpose methods public can be useful. But once they're documented then they are expected to be supported�—regardless of whether or not it is internally needed. In retrospect I might not have made the object utilities or the dataset methods public because they are not internally needed.
In an effort to better modularize the code, I want to better separate the general-purpose methods from the response-specific ones. This will greatly improve maintainability. Support multiple libraries jQuery/Zepto/ender complicates the issue. I'm trying to figure out the most practical way to go about it.
The text was updated successfully, but these errors were encountered: