Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chris Van Oort 110 posts 370 karma points
    Aug 17, 2023 @ 14:31
    Chris Van Oort
    0

    Serving umbraco forms assets with async defer?

    We're running Umbraco 10 + Umbraco Forms 10 and currently doing this to load the resources for forms in our template: @Html.RenderUmbracoFormDependencies()

    We're doing a bit of chasing zeros with https://pagespeed.web.dev/, but I had a couple of questions about what's actually necessary.

    It looks like RenderUmbracoFormDependencies loads these two assets:

    <script src=/App_Plugins/UmbracoForms/Assets/promise-polyfill/dist/polyfill.min.js type=application/javascript></script>
    
    
    <script src=/App_Plugins/UmbracoForms/Assets/aspnet-client-validation/dist/aspnet-validation.min.js type=application/javascript></script
    

    >

    • Are there ever any instances where more resources would be rendered? (https://docs.umbraco.com/umbraco-forms/developer/prepping-frontend)
      • I don't see the two JS files I'm seeing get loaded mentioned on the documentation page.
      • Promises are widely supported, I think I can just drop this polyfill? https://caniuse.com/promises
      • There's a ton of JS files in the App_Plugins web directory
      • If these two are the only ones that would get loaded, I could potentially toss them into my Smidge bundle. Any explicit support for that?
    • Are there any method overloads so I can specify async and/or defer attributes on the JS files?

    Thank you!

    Chris

Please Sign in or register to post replies

Write your reply to:

Draft