JavaScript.RequestRegistration - File Order Issue

Description

We're running into issues with the core implementation of JavaScript.RequestRegistration. We have installed a newer version of Knockout.js thus creating a newer entry in the JavaScriptLibraries folder. Due to the default nature of how these are registered - it's the file order priority that screws this up.

Example:
Knockout.js 3.3.0 is installed. Also added are Kncokout.Mapping 2.4.1, and we install Knockout.validation.js 2.0.3
During development - we upgrade to knockout.js 3.4.1 - install the extension as per the rules. Because Mapping and validation are not also updated (they don't need to be) we run into issues.

It's in the JavaScript.cs file (located here) at lines 449 - the private static in GetFileOrder function.

If the javascript library isn't one of the default core (jquery, hoverintent, etc) - it gets the DefaultPriority (100) PLUS the JavaScriptLibrary table's Package ID.

Thus - but upgrading our knockout version - it has a Primary key ID of 165 (plus 100 = 265) which is higher than the validation package id.

This breaks our custom modules even though we are following DNN best practices. The work around is to change the knockout.js extension to load in the HEAD But this is not the preferred solution!!!

It would be ideal if we could pass a priority into the JavaScript.RequestRegistration call - that takes the overall highest priority or something similar. Or best if because the dependencies are known by knockout.mapping and knockout.validation - that it would load knockout.js first.

Here's a screenshot of the JavaScriptLibraries table: https://www.screencast.com/t/zbi1ISQE

QA Test Plan

None

Assignee

Unassigned

Reporter

Andy Walker

Story Size

Unknown

Severity

Major

Triage

New

Reported in Build #

None

Fixed in Build

None

Dev Owner

None

Includes Code Fix

No

Documentation Required

None

Trouble Ticket

None

Requires More Info

None

QA Story Points

None

QA Owner

None

Injected

None

Automation Required

None

Code Review Owner

None

Components

Affects versions

Priority

High
Configure