[PR #3348] [MERGED] refactor: minor performance improvements on teams related operations #4351

Closed
opened 2026-03-17 01:53:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3348
Author: @AndrewBastin
Created: 9/13/2023
Status: Merged
Merged: 9/18/2023
Merged by: @AndrewBastin

Base: mainHead: perf/reduce-backend-calls


📝 Commits (8)

  • a674870 refactor: introduce a global managed team list adapter
  • aadcf97 refactor: collection expansion fetches requests and collections parallelly
  • a107ac3 refactor: move workspace store into service
  • 668d428 chore: write doc comments for WorkspaceService
  • e89a2bc refactor: move workspace service
  • 84df4e6 chore: add tests for workspace service
  • 5678083 chore: export Workspace and WorkspaceServiceEvent types of Workspace Service
  • 09b4d40 fix: add missing call in the tested function

📊 Changes

16 files changed (+520 additions, -202 deletions)

View changed files

📝 packages/hoppscotch-common/src/components.d.ts (+1 -1)
📝 packages/hoppscotch-common/src/components/app/Header.vue (+11 -13)
📝 packages/hoppscotch-common/src/components/collections/index.vue (+11 -10)
📝 packages/hoppscotch-common/src/components/environments/Selector.vue (+6 -10)
📝 packages/hoppscotch-common/src/components/environments/index.vue (+5 -9)
📝 packages/hoppscotch-common/src/components/http/TestResult.vue (+4 -2)
📝 packages/hoppscotch-common/src/components/teams/index.vue (+4 -9)
📝 packages/hoppscotch-common/src/components/workspace/Current.vue (+4 -3)
📝 packages/hoppscotch-common/src/components/workspace/Selector.vue (+32 -12)
📝 packages/hoppscotch-common/src/helpers/teams/TeamCollectionAdapter.ts (+55 -44)
📝 packages/hoppscotch-common/src/helpers/teams/TeamListAdapter.ts (+5 -2)
packages/hoppscotch-common/src/newstore/workspace.ts (+0 -67)
packages/hoppscotch-common/src/services/__tests__/workspace.service.spec.ts (+238 -0)
📝 packages/hoppscotch-common/src/services/spotlight/searchers/collections.searcher.ts (+4 -4)
📝 packages/hoppscotch-common/src/services/spotlight/searchers/workspace.searcher.ts (+5 -16)
packages/hoppscotch-common/src/services/workspace.service.ts (+135 -0)

📄 Description

This PR introduces minor performance related improvements in the teams related operations.

What's changed

  • Refactor newstore/workspace into WorkspaceService
  • Introduced unit tests for WorkspaceService
  • Instead of having multiple instances of TeamListAdapter, the app as a whole gets a single TeamListAdapter instance that is shared by the entire app while being managed by WorkspaceService.
  • TeamCollectionAdapter now fetches the children collection and requests in parallel instead of serially.

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

🔄 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/hoppscotch/hoppscotch/pull/3348 **Author:** [@AndrewBastin](https://github.com/AndrewBastin) **Created:** 9/13/2023 **Status:** ✅ Merged **Merged:** 9/18/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `main` ← **Head:** `perf/reduce-backend-calls` --- ### 📝 Commits (8) - [`a674870`](https://github.com/hoppscotch/hoppscotch/commit/a6748704eb827e0e6b0854fda925318c59d10c9b) refactor: introduce a global managed team list adapter - [`aadcf97`](https://github.com/hoppscotch/hoppscotch/commit/aadcf9728f5218e9e44284138ba176dfcaa5d030) refactor: collection expansion fetches requests and collections parallelly - [`a107ac3`](https://github.com/hoppscotch/hoppscotch/commit/a107ac308f3480bd44bacf0d159ab2e02171e2e9) refactor: move workspace store into service - [`668d428`](https://github.com/hoppscotch/hoppscotch/commit/668d42874364db20e166e51e13420939a004d983) chore: write doc comments for WorkspaceService - [`e89a2bc`](https://github.com/hoppscotch/hoppscotch/commit/e89a2bc241397bcaf4b720f9ade9235f05f73060) refactor: move workspace service - [`84df4e6`](https://github.com/hoppscotch/hoppscotch/commit/84df4e6886fc8a0b80590439c69310b1005cf015) chore: add tests for workspace service - [`5678083`](https://github.com/hoppscotch/hoppscotch/commit/56780830683016917fc57cf96d57571abe91a27e) chore: export Workspace and WorkspaceServiceEvent types of Workspace Service - [`09b4d40`](https://github.com/hoppscotch/hoppscotch/commit/09b4d40383d1f426df781b3408cd38b79ce72c3c) fix: add missing call in the tested function ### 📊 Changes **16 files changed** (+520 additions, -202 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components.d.ts` (+1 -1) 📝 `packages/hoppscotch-common/src/components/app/Header.vue` (+11 -13) 📝 `packages/hoppscotch-common/src/components/collections/index.vue` (+11 -10) 📝 `packages/hoppscotch-common/src/components/environments/Selector.vue` (+6 -10) 📝 `packages/hoppscotch-common/src/components/environments/index.vue` (+5 -9) 📝 `packages/hoppscotch-common/src/components/http/TestResult.vue` (+4 -2) 📝 `packages/hoppscotch-common/src/components/teams/index.vue` (+4 -9) 📝 `packages/hoppscotch-common/src/components/workspace/Current.vue` (+4 -3) 📝 `packages/hoppscotch-common/src/components/workspace/Selector.vue` (+32 -12) 📝 `packages/hoppscotch-common/src/helpers/teams/TeamCollectionAdapter.ts` (+55 -44) 📝 `packages/hoppscotch-common/src/helpers/teams/TeamListAdapter.ts` (+5 -2) ➖ `packages/hoppscotch-common/src/newstore/workspace.ts` (+0 -67) ➕ `packages/hoppscotch-common/src/services/__tests__/workspace.service.spec.ts` (+238 -0) 📝 `packages/hoppscotch-common/src/services/spotlight/searchers/collections.searcher.ts` (+4 -4) 📝 `packages/hoppscotch-common/src/services/spotlight/searchers/workspace.searcher.ts` (+5 -16) ➕ `packages/hoppscotch-common/src/services/workspace.service.ts` (+135 -0) </details> ### 📄 Description This PR introduces minor performance related improvements in the teams related operations. ### What's changed - Refactor `newstore/workspace` into `WorkspaceService` - Introduced unit tests for `WorkspaceService` - Instead of having multiple instances of `TeamListAdapter`, the app as a whole gets a single TeamListAdapter instance that is shared by the entire app while being managed by `WorkspaceService`. - `TeamCollectionAdapter` now fetches the children collection and requests in parallel instead of serially. ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project - [ ] My code requires changes to the documentation - [x] I have updated the documentation as required - [x] All the tests have passed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:53:50 +03: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
starred/hoppscotch#4351
No description provided.