Upgrade vis-network from 8.5.5 to 10.0.3#100
Merged
Merged
Conversation
Bumps the bundled vis-network library 5 years forward via the foreign-resources mechanism added in the previous PR. Pulls in roughly 22 KB of additional bundle size and a long tail of upstream fixes. Two changes: - resources/lib/foreign-resources.yaml: bump version, src, integrity, and purl to vis-network 10.0.3. The tarball structure, license (Apache-2.0 OR MIT), and LICENSE files are unchanged from 8.5.5. - resources/js/NetworkData.js: build the node tooltip as an HTMLElement instead of a string with HTML markup. v9.0.0 (Jan 2021) included an XSS fix that made node.title plain-text by default; passing an Element is the upstream-supported way to retain HTML rendering. The element is assembled with createTextNode for the user-supplied page title and document fragments wrapped in <i> for the parts the extension adds (the '(real title)' and '(redirect)' suffixes). User-supplied content is never set via innerHTML, so this approach is XSS-safe by construction — a safer state than 8.5.5 left things in. Closes #77.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #77.
Bumps the bundled
vis-networklibrary 5 years forward (8.5.5 → 10.0.3) via the foreign-resources mechanism added in #99. About +22 KB to the bundle, plus a long tail of upstream fixes.Summary
Two changes in one commit:
resources/lib/foreign-resources.yaml— bumpversion,src(npm tarball),integrity(sha384), andpurlto vis-network 10.0.3. The tarball structure, license (Apache-2.0 OR MIT), homepage, authors, and dest-map paths are unchanged from 8.5.5; the LICENSE files inside the tarball are byte-identical between versions, so they don't appear in the diff.resources/js/NetworkData.js— build the node tooltip as anHTMLElementinstead of a string with HTML markup. v9.0.0 (visjs/vis-network#1275, Jan 2021) was an XSS fix that madenode.titleplain-text by default; passing anHTMLElementis the upstream-supported way to retain HTML rendering. The element is assembled withcreateTextNodefor user-supplied content (page title, displayTitle) and<i>wrappers for the parts the extension adds (the(real title)and(redirect)suffixes). Because user-supplied content is never set viainnerHTML, this is XSS-safe by construction — strictly safer than 8.5.5's old behaviour, where a wiki page with<or>in its{{DISPLAYTITLE}}would break out of the tooltip's HTML context.Audit of breaking changes 8.5.5 → 10.0.3
I went through release notes for all 24 releases between 8.5.6 and 10.0.3:
node.titlefrom "string interpreted as HTML" to "string interpreted as plain text". Addressed here.new vis.Network,new vis.DataSet,.update,.get, thedoubleClick/hold/select/zoom/dragEndevents,node.image/node.shape: 'image'/node.label/node.title,groups[*].image).Test plan
php maintenance/run.php manageForeignResources verify --extension Network— exits 0 (the on-disk bytes match the declaredintegrity)composer phpunit— 36/36vendor/bin/phpcs -p -s— cleanvendor/bin/phpstan analyse— No errorsvendor/bin/psalm— No errors foundFooRedirect → Foo) shows the target with italicised(redirect)suffix{{DISPLAYTITLE:foo}}(where displayTitle ≠ page title) shows the displayTitle with italicised(Foo)suffixmanageForeignResources verify) + code-style passThe image-shape branch (Title Icon-rendered nodes) is unchanged by v9+ —
node.imageandnode.shape: 'image'are independent of the tooltip code path. Verified by source audit of v10's Popup and DataSet pipelines; not exercised in the local browser test because the Title Icon extension isn't installed in the dev wiki.