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

Use ES6 modules #674

Merged
merged 17 commits into from
Oct 25, 2015
Merged

Use ES6 modules #674

merged 17 commits into from
Oct 25, 2015

Conversation

danvk
Copy link
Owner

@danvk danvk commented Oct 23, 2015

This PR migrates dygraphs from its own ad-hoc dependency system to the new ES6 module system.

Highlights:

  • We use babel to transpile ES6 code to the ES5 code that browsers like
  • We use browserify to build bundled JS for the browser. Since browserify isolates each module for us, there's no more need for IIFE wrappers.
  • Each file is now its own distinct module, with its dependencies listed explicitly. No more defining properties on Dygraph from a dozen different files.
  • We use envify to set the DEBUG property to distinguish dev/prod builds.
  • Tests can be run & iterated on using the mocha HTML test runner and a new watch.sh script.
  • DEFAULT_ATTRS gets moved into its own module.
  • Deleted dygraph-combined.js from source control (fixes Remove dygraphs-combined.js from source control #376)
  • A few functions (e.g. numberAxisLabelFormatter) move out of dygraph.js and into dygraph-utils.js. We need to shrink dygraph.js, it's huge.

Fixes #453

danvk added a commit that referenced this pull request Oct 25, 2015
@danvk danvk merged commit ce31caf into master Oct 25, 2015
@timeu
Copy link
Collaborator

timeu commented Oct 25, 2015

Grest to see that dygraphs is moving forward.
I am wondering if it still will be possible to generate a dygraphs-combined.js to include for example for a GWT wrapper?

@danvk
Copy link
Owner Author

danvk commented Oct 26, 2015

Running scripts/build.sh from master should produce dist/dygraph.min.js and dist/dygraph-combined.js (which are the same thing—I'd like to move to the .min.js naming convention for 2.0). It'll also make dygraph-gwt.jar.

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.

Use a module system Remove dygraphs-combined.js from source control
2 participants