PageForms bundles libraries such as FullCalendar, jsTree, and Select2, and also loads some such as Leaflet from remote URLs.
All should be managed as foreign resources, for easier updating and auditing.
(See the parent task for more info.)
PageForms bundles libraries such as FullCalendar, jsTree, and Select2, and also loads some such as Leaflet from remote URLs.
All should be managed as foreign resources, for easier updating and auditing.
(See the parent task for more info.)
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Open | None | T275660 Proliferate foreign-resources.yaml in mediawiki extensions and skins | |||
| Open | Collins | T398898 Add a foreign-resources.yaml file to PageForms |
Change #1167665 had a related patch set uploaded (by Wandji collins; author: Wandji collins):
[mediawiki/extensions/PageForms@master] Adding foreign resource yaml file for managing external libs
Change #1167665 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Adding foreign resource yaml file for managing external libs
Change #1167725 had a related patch set uploaded (by Wandji collins; author: Wandji collins):
[mediawiki/extensions/PageForms@master] Update Foreign resources yaml file content
@Collins, @Samwilson - please see my comment on the patch; I think I know why it's failing.
@Samwilson - if I want to release a new version of Page Forms before this 2nd patch gets merged in, should I revert the 1st patch (which I obviously accepted too soon), or is it harmless?
@Yaron_Koren It's harmless I think. If CI were to start validating foreign resources (I'm not sure if/when that'll happen) then it might start failing, but hopefully by then we'll have the proper stuff in place!
@Collins I think Yaron's right in the above, and that now the modified libs are set to be doc-only it's probably pretty close to being ready to merge. Only the files that are being moved into libs/foreign/ should be removed form linting.
Change #1167725 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Register all JS libraries used as "foreign resources"
@Collins - thank you for creating this patch! This looks like a big improvement to Page Forms.
Change #1182248 had a related patch set uploaded (by Samwilson; author: Samwilson):
[mediawiki/extensions/PageForms@master] Update Sortable.js and add foreign-resources script
Change #1182248 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Update Sortable.js to remove local modifications
Change #1182254 had a related patch set uploaded (by Samwilson; author: Samwilson):
[mediawiki/extensions/PageForms@master] Add foreign-resources.cdx.json file
Change #1182254 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Add foreign-resources.cdx.json file
Not quite, although we could perhaps open separate tasks for the remaining work if you want. That might make it easier for people to pick up bits of it.
I'd to try to tidy up jstree, select2, and jspreadsheet as they are currently documentation-only and contain local modifications that should probably be sorted out.
Can you provide me with a tip on how to do this tidying up? I would love to handle it.
Oh sure! That'd be great.
You can see for example on this patch I updated Sortable to remove the local modifications. That entailed changing how it was being loaded (i.e. switching to require()).
I'd recommend tackling the others one at a time. It looks like jstree might be a similar loading issue to Sortable, so that might be a good one to start with. Update it in foreign-resources.yaml so the code is being downloaded (i.e. change it from doc-only to tar or whatever's appropriate), and then look at the changes that it's made. Then update all the usages of that library in the PageForms code and test each to make sure it still works. The docs of the tree input type have an example of tree data that you can use to test.
Okay! I will have a look, then submit a patch for jstree first, and we can take it up from there.
Change #1186039 had a related patch set uploaded (by Wandji collins; author: Wandji collins):
[mediawiki/extensions/PageForms@master] Update jstree.js to remove local modifications
Is this maybe related? https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PageForms/+/1306378