Repository navigation
Load no NeoWiki frontend for readers of pages that show no Subjects - #1917
Open
alistair3149 wants to merge 1 commit into
Open
alistair3149 wants to merge 1 commit into
alistair3149 wants to merge 1 commit into
Conversation
Every content page loaded NeoWiki's whole frontend, which does nothing
for a reader of a page that shows no Subjects. A content page now loads
it only where it shows a View, its Main Subject in full or a
{{#create_subject}} button, or where the viewer may edit the page and
so gets the Subject creator. A reader of any other page skips 204 KB of
JavaScript; on a throttled mobile profile, a plain article's load drops
from 2.8 s to 1.4 s. Other pages are unchanged.
- NeoWikiHooks::needsFrontend() decides, with
ViewHtmlBuilder::containsView(), new, and containsMainSubjectInFull(),
and the {{#create_subject}} check onBeforePageDisplay() already made.
- docs/extending/extending.md says where NeoWikiGetFrontendModules
modules load on a content page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alistair3149
force-pushed
the
alistair3149/no-frontend-without-neowiki-ui
branch
from
November 21, 2026 00:41
f2cbf44 to
0e61070
Compare
alistair3149
marked this pull request as ready for review
November 21, 2026 00:42
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.
Every content page loaded NeoWiki's whole frontend, which does nothing for a reader of a page that shows no Subjects. A content page now loads it only where it shows a View, its Main Subject in full or a
{{#create_subject}}button, or where the viewer may edit the page and so gets the Subject creator. A reader of any other page skips 204 KB of JavaScript; on a throttled mobile profile, a plain article's load drops from 2.8 s to 1.4 s. Other pages are unchanged.Human input
Goal and shape: @alistair3149 asked for a spike on the frontend bundle's size, saying NeoWiki should not load frontend code a page does not need, and picked this change from its findings to do as its own PR. The proposal they picked was "load nothing on pages with no Views or Subjects for viewers who can't create one"; the design within it is Claude's.
Outcome: not reviewed by a human yet; @alistair3149 asked for the history to be squashed before pushing. Left for you: which pages still load the frontend, and the line in
extending.mdthat tells extension authors.Claude's calls
{{#view}}, loads none of NeoWiki's frontend for a reader.NeoWikiGetFrontendModulesfollow the frontend: a reader of a page that shows no Subjects no longer loads them.{{#view}}and the other placeholder writers set at parse time: pages cached before the upgrade would lack it, and their Views would stay blank for readers until reparsed.MediaWiki:Sitenotice, which the page HTML does not hold: no such use is known.The change
NeoWikiHooks::needsFrontend()decides, withViewHtmlBuilder::containsView(), new, andcontainsMainSubjectInFull(), and the{{#create_subject}}checkonBeforePageDisplay()already made.docs/extending/extending.mdsays whereNeoWikiGetFrontendModulesmodules load on a content page.Release notes
Verification evidence
make ci: PHPUnit 5225 tests, 10 skipped; phpcs and phpstan without errors. Seen failing first: the reader test and thecontainsView()tests against master, the{{#create_subject}}test and the rewritten-markup case against earlier states of this branch; the test for a reader of a page whose Main Subject NeoWiki shows fails against a mutant that decides before placing it.make tsciequivalents: vitest 216 files, 4006 tests; build and lint green. No TypeScript changes.ext.neowikinor RedHerb's modules; a reader of Claude Monet gets the infobox; an editor of the plain article gets the frontend, and "Create subject" opens the creator; a reader of a page carrying{{#create_subject}}gets the frontend config and the button opens its dialog; no page errors.load3.04 → 1.37 s, script time per page load 216 → 101 ms. Without RedHerb, master'sloadwas 2.84 s.review-tests(every in-scope class measured; it found the{{#create_subject}}case, which a fresh text review of the docs line had flagged too),/code-review(high) and/simplify(four angles). Applied: the button case, a View check that tolerates markup a parser rewrote and checks the cheaper mount first, tests for both and for the editor's app container and a reader's RDF links. Considered and left: the parse-time flag and Views outside the page body, above.