Skip to content

perf: render standings directly from the model on the producing page#7655

Open
Rathoz wants to merge 2 commits into
standings-tests-aifrom
standings-skip-var-roundtrip
Open

perf: render standings directly from the model on the producing page#7655
Rathoz wants to merge 2 commits into
standings-tests-aifrom
standings-skip-var-roundtrip

Conversation

@Rathoz

@Rathoz Rathoz commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • StandingsStorage.run now returns {record, entries} where record is a model-ready shallow copy of the storage record with matches restored as a Lua table (not a JSON string), and pagename set to the current page title
  • StandingsTable.fromTemplate captures the return value and calls Standings.standingsFromRecord(stored.record, stored.entries) to build the model directly, then renders StandingsDisplay{standings = model} — eliminating the full stringify+parse round-trip through the wiki variable on the producing page
  • Widget/Standings accepts an alternative standings prop (a prebuilt StandingsModel); when present it skips Standings.getStandingsTable entirely; the existing pageName/standingsIndex path is untouched
  • The wiki-variable write (saveVars) is unchanged, so cross-template consumers (and later {{Standings}} transclusions on the same page) continue to work via the var path
  • A new spec case 'direct-path render matches var-path render' builds a standings table, renders it both via the returned model and via the page-variable read, and asserts the two HTML strings are identical

How did you test this change?

  • busted --run=ci: 606 successes / 0 failures / 0 errors (605 pre-existing + 1 new equality spec)
  • luacheck on all modified files: 0 warnings / 0 errors

🤖 Generated with Claude Code

Rathoz and others added 2 commits June 12, 2026 18:01
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Rathoz Rathoz requested review from a team as code owners June 12, 2026 16:03

@hjpalpha hjpalpha left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable on phone

@mbergen

mbergen commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

🤖 Generated with Claude Code

Does this only apply to the PR description or also the code itself?

@Rathoz

Rathoz commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Both, used it as a test scenario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants