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

Dimple support for AMD RequireJS #81

Merged
merged 3 commits into from
May 29, 2014

Conversation

stephen-james
Copy link
Contributor

Add support for AMD RequireJS to dimple.

This pull request adds AMD and RequireJS support for dimple.

Scaffolding changes to support this were done to begin.js and end.js with the require/define/exports stuff happening up in begin.js.

NOTE : Since D3 only introduced AMD/RequireJS support after the version that dimple was previously using, this change required an update to the version of D3 that dimple uses, and the latest version has been put in. Changes have been made to the plumbing to support including d3 with a version number, see Supporting Changes below...

Supporting Changes

  • Gruntfile modifications to include globals in JSLint for RequireJS and Jasmine
  • Gruntfile Karma RequireJS support and changes to not include script tags for required dependencies
  • Gruntfile Example Scripts to have script tags generated to support later changes to version numbers of both d3 and dimple
  • Example Templates modified to include a script tag placeholder, rather than just a dimple script version placeholder
  • Related Rendered Example changes
  • d3 license file added and files used as is with version number in filename
  • Karma test-main.js RequireJS bootstrap file added
  • Spec added to test that modifications to support RequireJS actually work!
  • Old failing specs in the project have been marked with "x" to exclude them from Jasmine and the Karma test runner. We'll need to pick this up and check why they aren't executing in current version

@johnkiernander
Copy link
Member

This looks great, does this make dimple dependent on d3 v3.4.8 or is it only a problem if you require AMD support?

@stephen-james
Copy link
Contributor Author

If you use this version of dimple and a previous version of d3 its fine as long as you don't need AMD support.

To use this with AMD support you'd also need to be including d3 v3.3.13+ see d3 commit here

All example files for the dimple site are modified to use d3 v3.4.8 with this pull request though

@johnkiernander
Copy link
Member

Awesome, I'll merge it in and include it in the next release

johnkiernander added a commit that referenced this pull request May 29, 2014
Dimple support for AMD RequireJS
@johnkiernander johnkiernander merged commit 660ba1d into PMSI-AlignAlytics:master May 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants