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 into Modules #68

Open
mouyang opened this issue Feb 9, 2014 · 1 comment
Open

Refactor into Modules #68

mouyang opened this issue Feb 9, 2014 · 1 comment

Comments

@mouyang
Copy link
Contributor

mouyang commented Feb 9, 2014

I think it would be more modular if the helpers were in separate modules and brought in as-needed instead of bringing them all in at once.

Here is some background as to why I wanted to pursue this.

I made a branch to track my progress. Any feedback would be appreciated.

@rragan
Copy link
Contributor

rragan commented Feb 10, 2014

Were you thinking of putting one helper per module? How would users consume the ones they wanted? Would we have some default packagings like 1) everything we have now, 2) everything minus the if helper, 3) ?

We could provide a grunt task that would build a custom library of helpers ala what jQuery has under "How to build your own jQuery". This would cater to folks looking to minimize a prebuilt file they would serve from a CDN for their site.

I wrestled with the helper per repo vs multiple helpers in one repo when setting up https://github.com/rragan/dust-motes

In the end, I kept all the helpers in one repo structured as modules I added granularity and version control per helper by putting a package.json and README.md at the root of the js source for each helper. By npm publishing directly from the individual module areas, I can offer versioned npm modules for individual helpers -- https://github.com/rragan/dust-motes/tree/master/src/helpers/control/iterate is an example.

On the server-side, users can selectively consume the npm modules they need and on the client-side with browserify they can build a bundle containing the ones they need.

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

3 participants