[PR #8229] [MERGED] perf: reduce personal extension list response size #8196

Closed
opened 2026-10-25 04:04:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8229
Author: @minikkeuen
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @SpicyMarinara

Base: staging ← Head: pr/personal-extension-list-optimization


📝 Commits (2)

  • 9cd8d73 perf: reduce personal extension list response size
  • a7cf0b9 Merge branch 'staging' into pr/personal-extension-list-optimization

📊 Changes

6 files changed (+157 additions, -13 deletions)

View changed files

📝 packages/client/src/components/panels/settings/PersonalExtensionsSettings.tsx (+10 -10)
📝 packages/client/src/hooks/use-personal-extensions.ts (+2 -1)
📝 packages/client/src/lib/personal-extension-transfer.ts (+1 -1)
📝 packages/server/src/routes/personal-extensions.routes.ts (+11 -1)
📝 packages/shared/src/types/personal-extension.ts (+5 -0)
➕ scripts/regressions/extension-list-response.regression.ts (+128 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8228

Why this change

  • GET /api/personal-extensions returns the full css, js, and serverJs source code of historical extension revisions, although the extension list and revision history UI only require revision metadata.
  • As revision histories accumulate, this unnecessarily increases API response size, network transfer, and client-side JSON parsing overhead.
  • In a local dataset containing 25 extensions and 150 historical revisions, omitting historical revision source code reduced the serialized response size by approximately 84%.

What changed

  • Omit historical revision css, js, and serverJs fields from the extension list API response.
  • Preserve revision metadata required for history display and server-side rollback.
  • Introduce PersonalExtensionListItem and update corresponding client types.
  • Keep current extension source code, stored revision data, and existing update/rollback responses unchanged.
  • Add regression tests for list serialization, editing, rollback, and extension storage compatibility.

No changes to revision retention policies, storage schemas, or extension execution behavior.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Ran the application in a local source installation and manually verified the External Extensions settings page in Safari.
  • Verified that the extension list loads and displays correctly after the optimization.
  • Observed faster extension list loading.
  • Confirmed an optimized /api/personal-extensions network response of 844.7 KB.
  • Regression tests covering list serialization, editing, rollback, and extension storage compatibility passed.
  • Confirmed that existing extension data remained unchanged.
  • pnpm check passed.

Response size comparison

Calculated from serialized JSON responses using local extension data containing 25 extensions and 150 historical revisions:

Metric Before After
JSON response size 21.09 MiB 3.37 MiB
Reduction — ~84%

These values represent serialized JSON sizes, not measured HTTP latency.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Not applicable. No UI changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8229 **Author:** [@minikkeuen](https://github.com/minikkeuen) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `pr/personal-extension-list-optimization` --- ### 📝 Commits (2) - [`9cd8d73`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9cd8d739b5f658aa516ab880046cf7b69cfd3f81) perf: reduce personal extension list response size - [`a7cf0b9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a7cf0b9b09c9ad578f0ce243dfc68a4e36e383b1) Merge branch 'staging' into pr/personal-extension-list-optimization ### 📊 Changes **6 files changed** (+157 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/panels/settings/PersonalExtensionsSettings.tsx` (+10 -10) 📝 `packages/client/src/hooks/use-personal-extensions.ts` (+2 -1) 📝 `packages/client/src/lib/personal-extension-transfer.ts` (+1 -1) 📝 `packages/server/src/routes/personal-extensions.routes.ts` (+11 -1) 📝 `packages/shared/src/types/personal-extension.ts` (+5 -0) ➕ `scripts/regressions/extension-list-response.regression.ts` (+128 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #8228 ## Why this change - `GET /api/personal-extensions` returns the full `css`, `js`, and `serverJs` source code of historical extension revisions, although the extension list and revision history UI only require revision metadata. - As revision histories accumulate, this unnecessarily increases API response size, network transfer, and client-side JSON parsing overhead. - In a local dataset containing 25 extensions and 150 historical revisions, omitting historical revision source code reduced the serialized response size by approximately 84%. ## What changed - Omit historical revision `css`, `js`, and `serverJs` fields from the extension list API response. - Preserve revision metadata required for history display and server-side rollback. - Introduce `PersonalExtensionListItem` and update corresponding client types. - Keep current extension source code, stored revision data, and existing update/rollback responses unchanged. - Add regression tests for list serialization, editing, rollback, and extension storage compatibility. No changes to revision retention policies, storage schemas, or extension execution behavior. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Ran the application in a local source installation and manually verified the External Extensions settings page in Safari. - Verified that the extension list loads and displays correctly after the optimization. - Observed faster extension list loading. - Confirmed an optimized `/api/personal-extensions` network response of 844.7 KB. - Regression tests covering list serialization, editing, rollback, and extension storage compatibility passed. - Confirmed that existing extension data remained unchanged. - `pnpm check` passed. **Response size comparison** Calculated from serialized JSON responses using local extension data containing 25 extensions and 150 historical revisions: | Metric | Before | After | |---|---:|---:| | JSON response size | 21.09 MiB | 3.37 MiB | | Reduction | — | ~84% | These values represent serialized JSON sizes, not measured HTTP latency. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Not applicable. No UI changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-25 04:04:37 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8196
No description provided.