Skip to content

Migrate to Punky

  • Create folder managers inside js
  • Create managers/AssetManager.js and paste full new file
  • Create managers/DebugManager.js and paste full new file
  • Create folder utilities if not present inside js
  • Create utilities/EventSystem.js and paste full new file
  • Create utilities/getQueryParam.js and paste full new file
  • Create utilities/updateScrollTriggers.js and paste full new file

These files need to be modified, either partially or just copy-paste the entire new file on top of the old one. Itโ€™s specified in each of them.

  • CoreHandler - PASTE FULL NEW FILE
  • Project - Check first if thereโ€™s any script running in boostify onload or any place in the file, if not, just fully paste new file, if yes, combine both to preserve said scripts
  • Core - Check if thereโ€™s any libraries like Contact Form 7 active and combine with new file to preserve them
  • Main - Paste the import for EventSystem and replace only the constructor by the new one
  • Manager.js - Move into managers folder and PASTE FULL NEW FILE
  • ExtraAssets
    • Change name to resources.js, move into folder js next to Core, Project and Main
    • Change names of arrays to fit with the new ones
    • Add minimal libraries from starter
    • Change structure of resources to fit new options object and add modifyHeight property where needed
  • Transition index - Check the animations present and combine with new file so asset manager is only used to importAutoAnimations and destroyAutoAnimations, and delete all Hero animations from there
  • _handlerFolder/Handler.js - PASTE FULL NEW FILE
  • Hero animations
    • Remove return this.init() from constructor
    • Add this.timeline = tl before returning the tl in init() method
    • Add destroy method
  • Each handler
    • Change config to be a callback with this format ({element}) => ({})
    • Remove super.init() and super.events()
    • Remove libraryName and object from destroy method
  • Search for any instance of Manager.libraries.("gsap").ScrollTrigger or Manager.getLibrary("gsap").ScrollTrigger and replace by Manager.getLibrary("ScrollTrigger")
  • Change any direct import 'gsap' to Manager.getLibrary("gsap")
  • Delete preload folder

Execute command npm i @swup/body-class-plugin

You wonโ€™t be able to make the site function until you complete ALL above steps, except handlers, which will make only certain libraries not work. Once that is finished:

  • Check debug panels to see if everything makes sense
  • Check for debug panels opening in transition between pages - some destroy methods might be missing
  • Check console for errors or warnings from GSAP

Knowledge Check

Test your understanding of this section

Loading questions...