Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291341

Add a topological sort facility

$
0
0

Problem/Motivation

<?php
$graph
['head']['edges']['tail'] = 1;
include_once
'core/lib/Drupal/Component/Graph/Graph.php';
$x = new Drupal\Component\Graph\Graph($graph);
var_export($x->searchAndSort());
?>

Does not include a weight for tail. This causes problems when a full Topologically Sorted List is needed.

I'm not sure we need all this but #1762204: Introduce new asset declaration architecture to facilitate removal of global drupal_add_js/css() needs a complete TSL to dump css /js

Proposed resolution

We need to add some methods to get a TSL. Current patch introduces a new class to do that.

Remaining tasks

Add more documentation, write tests.

API changes

It's an API addition, a new TopologicalSort class.


Viewing all articles
Browse latest Browse all 291341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>