-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External resources do not appear to honour priority order #146
Comments
No it should do as you expect, CDF will stagger any external dependencies so will always render them separately (unless you've configured it to fetch external resources locally ... not recommended). Can you replicate with a simple setup? seems odd since this is pretty basic functionality of cdf. |
Thanks for the quick response Shannon, I will see if I can replicate it in a clean build. FWIW this is a Umbraco v7.7.0 site currently. |
Just need to find out if this is the order that the views are rendering and where you are rendering your scripts out, etc... or if it's just a strange bug that's never been discovered somehow :) My advise though is to avoid registering dependencies inside partials, etc... I realize that was one of the original ideas behind this lib but it's not exactly best practices since depending on how you are rendering views there's various ways to make this fail (i.e. caching views, child actions, other odd ordering). I'd advise creating named bundles if you can which cdf supports too. |
Aha, named bundles you say. I've not come across those so will look into that. |
Sorry not a ton of docs but you can find info here https://github.com/Shazwazza/ClientDependency/wiki#pre-defined-bundles |
Then you need to require your bundle like |
In an Umbraco site I have a master view that adds common scripts like so:
In a child view I then might register additional scripts like so:
The problem I have is that common.js has references to the Google Maps APi which fail because the API is not loaded in until after the script itself because the final rendering order is as follows:
WHen in fact I would expect, and need, it to be the other way around:
Is this by design?
The text was updated successfully, but these errors were encountered: