Issue Bug Closed

#56233Load order of js files differs

Daniel Siepmann 02/24/14, 12:02 updated 01/30/15, 10:05

Description

There is a difference of ordering for js files, in case they are compressed / concatenated or not.
Looks like pagerenderer inverses the “forceOnTop files” while the ResourceCompressor doesn’t.

if ($properties['forceOnTop']) {
    if ($properties['section'] === self::PART_HEADER) {
        $jsFiles = $tag . LF . $jsFiles;
    } else {
        $jsFooterFiles = $tag . LF . $jsFooterFiles;
    }
} else {
    if ($properties['section'] === self::PART_HEADER) {
        $jsFiles .= LF . $tag;
    } else {
        $jsFooterFiles .= LF . $tag;
    }
}

Instead of prepanding the file we should use the same logic as in ResourceCompressor. We should build arrays for each kind of section and merge them at the end.

The change of order should be communicated on launch. That’s a breaking change for JS developers. They have to check the order of there JS files.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.