Skip to content

Bundle remaining XStatic dependencies#2214

Merged
RogerHaase merged 9 commits intomoinwiki:masterfrom
roland-ruedenauer:xstatic
Mar 30, 2026
Merged

Bundle remaining XStatic dependencies#2214
RogerHaase merged 9 commits intomoinwiki:masterfrom
roland-ruedenauer:xstatic

Conversation

@roland-ruedenauer
Copy link
Copy Markdown
Contributor

Bundle the remaining 3 XStatic dependencies and upgrade svgedit to version 7.4.1

  • remove dependency setuptools (getting rid of pkg_resources workaround
  • upgrade to svgedit 7.4.1 and make SVGDRAW items work (again?)
  • wikiconfig.py must be changed (import and use of get_xstatic_module_path_map)

* add field 'itemtype' when saving an item in TarMixin.put_member
* adjust unit tests: always pass 'itemtype' with item metadata
… when it is already present

* an unnecessary reload causes any modifications made to the metadata to be discarded
* this is also a minor performance improvement
The svgedit distribution sources were retrieved using
* npm -i svgedit
* rm -rf src/moin/xstatic/svgedit_moin/*
* cp -r -p node_modules/svgedit/dist/editor src/moin/xstatic/svgedit_moin/

Sources copied from svgedit 7.4.1 were not modified.

svgedit 7.x must be used as ESM module. The file 'svgeditor.js' creating the editor is
imported as module script in 'base.html'.

The svgedit extension 'ext-moin2' handles interfacing with Moin2. Executing 'Save' from the
editor menu will pass svg and png content to Moin2 via a form POST.
The extension also prevents displaying a browser dialog on form submission after saving the svg.

Some noteworthy changes applied to the Moin code
* pass fully qualified item names to svgedit (namespace was missing before)
* change arguments of ContentMixin.put_member;
  this also resolved issues resulting from always opening the temporary tarfile in append mode.
* return redirect after handling POST request
@RogerHaase RogerHaase merged commit 3ac44f8 into moinwiki:master Mar 30, 2026
10 checks passed
@roland-ruedenauer roland-ruedenauer deleted the xstatic branch March 30, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants