Skip to main content

Defer attribute on Siteglide scripts

Omar requested this:
Is there a way to add DEFER attribute to system generated scripts when loading polyfill.min.js, siteglide.js, siteglide_ecommerce.js?

6 comments

Log in to comment and vote

Comments6

  • Matt Jones

    •

    Feb 16, 2023

    Just thinking, do we still need polyfil.js support for ES6 features if Internet Explorer is not supported anymore? Best practice would also be to use something like modernizer which only pulls in the polyfil if the browser requires it- allowing the majority of browsers to skip it and save a synchronous request!

  • Matt Walter changed status to In Review
    Team•

    Apr 6, 2022

  • Omar Paulo

    •

    Nov 12, 2021

    hi Dean,
    Yes we can remove the system generated JS files, but that also prevents any form submission. Which is not an option. It's been over a year, is there hope for this feature?

    • Dean Vizer

      •

      Nov 12, 2021

      Omar Paulo: Correct, that was added alongisde this for pages where the script isn't needed at all. It doesn't change this task which is why we've left it open.
      While not on our immediate task list (it is currently queued) this is something that we will do and will update this entry when progress is being made

  • Dean Vizer

    •

    Mar 23, 2021

    As a note, you can now remove both polyfill and siteglide JS files by adding a flag under metadata in pages via CLI. We have documented this at the bottom of the page here - https://developers.siteglide.com/pages-with-siteglide-cli
    We will continue exploring deferring the files mentioned above

    • Nick Fenmor Collins

      •

      Mar 23, 2021

      Dean Vizer: Thanks Dean Vizer ..that's great to hear :-)