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

Make muton self-contained #6

Merged
merged 5 commits into from
Jan 26, 2016
Merged

Make muton self-contained #6

merged 5 commits into from
Jan 26, 2016

Conversation

Couto
Copy link
Contributor

@Couto Couto commented Jan 25, 2016

This PR adds two major differences:

  • Removes require.js in it's entirety, and instead uses Webpack to perform the bundling
  • Don't import the full bundle of lodash, and import only the used functions.

Webpack makes it easier to bundle into different module standards (amd, commonjs, umd...), without depending on third-party libs like amdefine.


Different projects use different versions of lodash (some are already using v4, others are still using v3.x) this means that lodash can no longer depend on the lodash present in the enviroment, since it breaks with some methods in v.4, so it now bundles the functions that it requires from lodash, individually.

State in README.md that muton requires lodash as dependency.
Why:

* Webpack makes it easier to export the library in several module formats.

This change addresses the need by:

* Use muton as a global variable
Why:

* Different projects use different versions of lodash, which means that some
incompatibility will happen (it already did)

This change addresses the need by:

* Make lodash self contained without external dependencies.
@jmtavares
Copy link
Contributor

Looks good to me ;)

@antoniocapelo
Copy link

This makes sense
Out of curiosity, what happens when requiring the individual function and the current version of lodash doesn't have it (thinking about the projects that use the v3.x)?

@Couto
Copy link
Contributor Author

Couto commented Jan 26, 2016

@antoniocapelo This way, all muton dependencies are included in the final bundle, which means that muton itself is independent of the lodash's version being used in the parent project.
e.g.: We're using lodash 3.x and @yconoclast is using v4.

This also means that some functions will be duplicated between project's lodash, and muton's lodash, but those should have minimal impact. (I hope)

@brunopalos
Copy link
Contributor

Lgtm 👍

Thank you for this @Couto ;)

  * Bump minor version
  * Update documentation
  * Update travis config to also test in newer versions of nodejs
jmtavares added a commit that referenced this pull request Jan 26, 2016
@jmtavares jmtavares merged commit 5a5aeaa into master Jan 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants