Skip to content

Version 4.0.0

Choose a tag to compare

@jaydenseric jaydenseric released this 20 Nov 07:48
· 1 commit to master since this release

API changes

  • New addHurdle method.
  • New validateHash method that checks if a provided URL hash matches the configured format.
  • More specific naming for callbacks.
  • Callbacks now receive an element argument instead of receiving the element being bound this. Arrow functions can now be used in application code; no more const self = this!
  • Removed session features. They were rarely used as better solutions to their original use case have been found. This reduces complexity and simplifies documentation.
  • The old setHash method has been renamed setTarget, and accepts an element instead of an ID.
  • The old getTargetId method has been deprecated. You can get the current target element by reading a new target property.
  • The old clearHash method has been renamed clearTarget, and now only clears the window URL hash if a given element is targeted, or if the URL hash matches the configured Hurdler format. Support for browsers that do not have the history API (IE < 10) has been dropped.
  • The old run method has been renamed sprint and has a more elegant implementation off the back of the other changes.
    • Errors in hurdle tests are no longer caught and deliberately silenced.
    • Only DOM elements are iterated, instead of every DOM node type.

Optimizations

  • No longer implementing UMD. It adds too much junk to everyone’s application bundles. The main entrypoint is now plain CommonJS and the module entrypoint is still there for bundlers that can handle ES6 modules.
  • Dropped the ES6 class in favor of prototype to significantly cut down the amount of transpiled code.

Dev

  • Updated dev dependencies.
  • More standard Babel setup in place of the old Rollup way.
  • Using whitelist files approach instead of the old .npmignore file since it seems to be working ok these days.

Docs

  • Improved readme:
    • Logo tweaked and now pointing to the relevant version in the Github repo, via RawGit.
    • Added a lingo table and better explained the project.
    • Using documentation.js and tidy-markdown in place of jsdoc-to-markdown for generating the API in the readme from the source JSDoc.
  • Added new lingo keywords to the package.json.
  • Improved license comment block. Smaller and makes more sense when found in the middle of a minified bundle.