Page MenuHomePhabricator

packagefiles should accept wildcards
Closed, DeclinedPublic


It's really tedious having to update skin.json on every single rename of a file. Renaming should be cheap.

Most code editors are good at updating references to require statements when a file gets renamed, but they are not MediaWiki aware.

It's proposed ResourceLoader packageFiles accept a wildcard meaning "any file in this folder". I think this will save a lot of developer frustration.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle added a subscriber: Krinkle.

Specifying a wildcard would require performing directory scanning at runtime (negatively affecting user experience), or complicating state management in a way that I think is too costly to maintain for the marginal gain it offers. (E.g. worse startup performance, or module module_deps usage, which I'd like to avoid due to the cachce churn and deployment delays it causes.) As such, I'll decline this task in accordance with our priorities.

There is however already work upcoming in the pipeline that I think has a better pay-off, namely to automate extension.json updates by automatically scanning for require() statements and interface messages, and ensuring extension.json is up-to-date based on that. This would be invoked similar to how we do with other management scripts such as for autoloader, and foreign resources. Perhaps these can be combined and thrown into a watchmode-capable script one can run in the background. Or run ad-hoc as it shouldn't come up that often when maintaining production code.