Problem/Motivation
Libraries allow custom weights to be specified for each individual file, this has been shown to be fragile/brittle in issues such as #3222107: Library order asset weights do not work properly when a large number of javascript files is loaded between two jQuery UI libraries and #3397713: [Performance regression] Starting with Drupal 10.1, some sites hit PHP for every page view due to aggregated asset URL hash mismatch from different order of asset items - it means that the ordering of assets can be very unpredictable (when different assets have the same weight, when different libraries are loaded on different pages etc.) and we already have a dependency system between libraries that covers the use-case. It also blocks further aggregation improvements like #3232810: [PP-1] Allow setting aggregation groups for js files in library definitions.
Steps to reproduce
Proposed resolution
Remove weights from all core library definitions and rely exclusively on dependency declarations to determine ordering between libraries.
Where files within a library definition depend on each other, they can be declared in the order they should be loaded on the page.
This doesn't remove support for weights from the libraries API, that is deferred until #3467488: Deprecate support for per-file weight in libraries API because we have additional decisions to make for CSS.
Remaining tasks
Un-postpone #3232810: [PP-1] Allow setting aggregation groups for js files in library definitions, #1924522: Remove separate CSS_AGGREGATE_THEME aggregate file, #3467488: Deprecate support for per-file weight in libraries API and related issues.