Skip to content

Use ES6 modules - #674

Merged
danvk merged 17 commits into
masterfrom
module
Oct 25, 2015
Merged

Use ES6 modules#674
danvk merged 17 commits into
masterfrom
module

Conversation

@danvk

@danvk danvk commented Oct 23, 2015

Copy link
Copy Markdown
Owner

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

timeu commented Oct 25, 2015

Copy link
Copy Markdown
Collaborator

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

danvk commented Oct 26, 2015

Copy link
Copy Markdown
Owner Author

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