-
Notifications
You must be signed in to change notification settings - Fork 97
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
Support LocationFallback on ILinkResources #728
Conversation
Is there any practical need for the location distinction? Surprisingly having multiple |
src/DotVVM.Framework/ResourceManagement/LocalResourceUrlManager.cs
Outdated
Show resolved
Hide resolved
src/DotVVM.Framework/ResourceManagement/LocalResourceUrlManager.cs
Outdated
Show resolved
Hide resolved
src/DotVVM.Framework/ResourceManagement/LocalResourceUrlManager.cs
Outdated
Show resolved
Hide resolved
src/DotVVM.Framework/ResourceManagement/LocalResourceUrlManager.cs
Outdated
Show resolved
Hide resolved
The feature may have been designed to handle a failure in loading of a 3rd party resource but this intention is not enforced. The way it's designed (looking at the fallback condition) means it can be used to handle errors in a piece of javascript code. Having a fallback in that case could be useful. Personally, I think we should support this scenario. But if we decide not to, I think, at the very least, we should notify the user that having multiple (There's also my need to test |
Merging after discussion with @exyi. |
Fixes #715.
This PR adds support for
LinkResourceBase.LocationFallback
during URL building and resolution ofILinkResources
by adding alocation
query parameter to thedotvvmResource
route.To illustrate the problem this PR solves, let's have the following resource registration:
Without the query parameter, the generated URL of the fallback location is the same as of the primary location and thus it has no effect.
I realize the main purpose of the
LocationFallback
property is having a backup plan for when a CDN is unavailable, and that aFileResourceLocation
as fallback for anotherFileResourceLocation
seems a little nonsensical but it is a valid configuration if only for testing theLocationFallback
feature.