Skip to content

refactor(template): extract JSConfigHelper config builders and rendering helpers#61159

Draft
joshtrichards wants to merge 13 commits into
masterfrom
jtr/refactor-JSConfigHelper-Part2
Draft

refactor(template): extract JSConfigHelper config builders and rendering helpers#61159
joshtrichards wants to merge 13 commits into
masterfrom
jtr/refactor-JSConfigHelper-Part2

Conversation

@joshtrichards

Copy link
Copy Markdown
Member

Note: Must not be merged until after #61050 is merged; then this will need to be rebased onto master

Summary

Refactor JSConfigHelper to make getConfig() easier to follow and prepare the class for future targeted cleanup and performance work.

Changes

  • extract password-confirmation context building into dedicated helpers
  • extract request/user context building into dedicated helpers
  • extract enabled app web path resolution
  • extract core, locale, sharing, and theme config builders
  • extract initial state publishing
  • extract legacy JS global rendering
  • keep legacy JS global output and hook behavior unchanged

Notes

  • This is intended as a readability/maintainability refactor only.
  • No functional changes are intended.

Testing

  • existing tests pass
  • no behavioral changes intended

TODO

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

- Add class docblock
- Add key function docblocks
- Rename variables for improved clarity
- Replace vague comments
- Add key clarifying comments

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
… rendering

Pure extractions:

- getEnabledAppWebPaths
- buildCoreConfig
- buildThemeConfig
- buildLocaleConfig
- renderLegacyJsGlobals
- publishInitialState

Signed-off-by: Josh <josh.t.richards@gmail.com>
- buildPasswordConfirmationContext()
- buildRequestUserContext()
- getRelativeDataDirectoryForAdmin
- getLastConfirmTimestamp
- buildSharingAppConfig

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added this to the Nextcloud 35 milestone Jun 10, 2026
@joshtrichards joshtrichards added 2. developing Work in progress technical debt 🧱 🤔🚀 feature: templates ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress feature: templates ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) technical debt 🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant