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

Convert to ES module #8

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

stilist
Copy link
Contributor

@stilist stilist commented May 4, 2017

This PR converts the code to use ES6+ features:

  • import dependencies
  • convert plugin from extending L.Control to a native ES class
  • export plugin (though it's also still declared as L.Control.GlobeMiniMap, so it's API-compatible)

I was careful to only make syntax changes, and leave the code inside the functions alone.

To support these changes, I added a Webpack setup that automatically generates a UMD wrapper for the imports and compiles the class down to ES5. This does result in a ~50% increase in the size of the compiled and uglified JS (from 3375 bytes to 5264 bytes), but once this PR lands the plugin can be refactored to get the build size back down.

Other changes:

@stilist
Copy link
Contributor Author

stilist commented May 4, 2017

Also, I updated the package version from 0.0.1 to 0.1.0 in package.json, because 1) I think this plugin is pretty reliable, and 2) it's technically accurate SemVer because the topojsonSrc option was added after 0.0.1. (New features require incrementing the minor version number.)

I think it would be good to publish a Github release some time soon, though perhaps after the refactor I referenced in the PR?

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.

None yet

1 participant