Skip to content

v0.0.5

Choose a tag to compare

@willstocks willstocks released this 11 Feb 09:40
· 43 commits to master since this release
2fa37e8

README

Updated parameter details
Updated example scripts
Updated deployment instructions (include "local")
Updated stats

The actual scripts

Major overhaul:

  • I realised I had two functions that were simply there to call other functions. They weren't doing anything for themselves! Therefore, function dynamicPolyfill, function pageLoaded and function checkNativeSupport have now all been combined into a single, function: function dynamicPolyfill - closes #14
  • Allow array to be passed for:
    • features (parameter 1)
    • scriptURL (parameter 2)
    • initFunction (parameter 3)
      You can still pass simple strings to each if you want though
      Closes #10 and closes #8
  • Iterate through array values using Array.forEach()
  • Split out loadMyScript repeated code into a helper function - minimising duplication! See #12.
  • Refactored init function to include a micro-helper function to avoid duplication! See #12.
  • initialiseMyScript is no longer called from the "core" pageLoaded function - instead it is called depending on whether the scripts that are to be used have loaded or not. See #12.
  • initialiseMyScript had an unnecessary var (var fn = new Function) which has been instead moved inline into the try{}. See #12.
  • fns in loadPolyfill was unused... not sure how it even got there! See #12.
  • Fix erroneous try{}catch{}
  • Remove console.log from dynamicPolyfill.js that shouldn't have remained
  • Fix issue where if initFunction wasn't an array, it wouldn't execute
  • Order functions logically
  • Inline comments to explain what each step is doing
  • Retain backwards compatibility!
  • Support for Safari and its weird behaviours. Closes #13.
  • General tidying up of code. See #12.
  • Formatting fixes
  • Add various console messages to dynamicpolyfill-consolemessages.js for troubleshooting/debugging/fun purposes [NOW DEPRECATED]

Deprecated dynamicpolyfill-consolemessages.js due to complexity to maintain (if you really want it - log an issue and I'll re-add it!)