[PR #4009] [MERGED] refactor: update to dioc v3 #4634

Closed
opened 2026-03-17 02:09:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4009
Author: @AndrewBastin
Created: 4/25/2024
Status: Merged
Merged: 4/29/2024
Merged by: @AndrewBastin

Base: release/2024.3.2Head: refactor/dioc-v3


📝 Commits (5)

  • 3786119 refactor: initial move to dioc v3
  • ec225fa refactor: move remaining platform bits into dioc v3 style
  • 6dd8dba refactor: update static spotlight searcher tests
  • 4553510 chore: bump dioc to v3.0.1
  • 7bb0706 refactor: move service init logic to the onServiceInit method

📊 Changes

46 files changed (+173 additions, -170 deletions)

View changed files

📝 packages/hoppscotch-common/package.json (+1 -1)
📝 packages/hoppscotch-common/src/components.d.ts (+1 -0)
📝 packages/hoppscotch-common/src/helpers/teams/TeamsSearch.service.ts (+1 -1)
📝 packages/hoppscotch-common/src/modules/dioc.ts (+3 -4)
📝 packages/hoppscotch-common/src/platform/index.ts (+2 -2)
📝 packages/hoppscotch-common/src/platform/inspectors.ts (+4 -3)
📝 packages/hoppscotch-common/src/platform/interceptors.ts (+4 -3)
📝 packages/hoppscotch-common/src/platform/spotlight.ts (+3 -3)
📝 packages/hoppscotch-common/src/platform/std/inspections/extension.inspector.ts (+1 -3)
📝 packages/hoppscotch-common/src/platform/std/interceptors/extension.ts (+1 -3)
📝 packages/hoppscotch-common/src/services/context-menu/menu/environment.menu.ts (+1 -3)
📝 packages/hoppscotch-common/src/services/context-menu/menu/parameter.menu.ts (+1 -3)
📝 packages/hoppscotch-common/src/services/context-menu/menu/url.menu.ts (+1 -3)
📝 packages/hoppscotch-common/src/services/cookie-jar.service.ts (+0 -4)
📝 packages/hoppscotch-common/src/services/debug.service.ts (+1 -3)
📝 packages/hoppscotch-common/src/services/inspection/index.ts (+1 -3)
📝 packages/hoppscotch-common/src/services/inspection/inspectors/environment.inspector.ts (+1 -3)
📝 packages/hoppscotch-common/src/services/inspection/inspectors/header.inspector.ts (+1 -3)
📝 packages/hoppscotch-common/src/services/inspection/inspectors/response.inspector.ts (+1 -3)
📝 packages/hoppscotch-common/src/services/interceptor.service.ts (+1 -3)

...and 26 more files

📄 Description

This PR introduces changes to keep the Hoppscotch codebase mostly in line with the changes introduces in dioc version 3.0.1 which tries to update certain bits of how a Container context is passed down to services.

What's changed

  • Upgraded dioc to 3.0.1 on all packages.
  • Services which do not do anything other than call the super constructor have their constructor definitions removed so that the normal service constructors are called automatically.
  • Services which do logic on their constructors are moved to the new onServiceInit method overridable by services to implement their initialisation logic. The constructor after moving the logic is removed.
  • For StaticSpotlightSearcherService, an abstract Service that is implemented that standardized static search logic has a constructor which takes arguments, since there are many implementations of this class, for the time being, the constructor is kept on the inherited services but logic is mostly moved ton onServiceInit. TODOs are kept to notify that this a thing we will have to refactor down the line.

This PR shouldn't introduce any new end-user functionality of changes in behaviour.

Notes to the reviewer

  • Make sure all services have their constructors removed and moved to onServiceInit (except for StaticSpotlightSearcherService and its children).

🔄 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/4009 **Author:** [@AndrewBastin](https://github.com/AndrewBastin) **Created:** 4/25/2024 **Status:** ✅ Merged **Merged:** 4/29/2024 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2024.3.2` ← **Head:** `refactor/dioc-v3` --- ### 📝 Commits (5) - [`3786119`](https://github.com/hoppscotch/hoppscotch/commit/378611972e15a98ab6f8abc9c29067c7e0d457d3) refactor: initial move to dioc v3 - [`ec225fa`](https://github.com/hoppscotch/hoppscotch/commit/ec225fa8c1df6843fa0654ff4e88ac15728384af) refactor: move remaining platform bits into dioc v3 style - [`6dd8dba`](https://github.com/hoppscotch/hoppscotch/commit/6dd8dbaeb3c7ae102d69b3a43bc419dd819c1318) refactor: update static spotlight searcher tests - [`4553510`](https://github.com/hoppscotch/hoppscotch/commit/455351041109b0e289ad54cd23f40b2695558a68) chore: bump dioc to v3.0.1 - [`7bb0706`](https://github.com/hoppscotch/hoppscotch/commit/7bb07065e8938d48729622f023cb2cdd72bd2ef1) refactor: move service init logic to the `onServiceInit` method ### 📊 Changes **46 files changed** (+173 additions, -170 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/package.json` (+1 -1) 📝 `packages/hoppscotch-common/src/components.d.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/helpers/teams/TeamsSearch.service.ts` (+1 -1) 📝 `packages/hoppscotch-common/src/modules/dioc.ts` (+3 -4) 📝 `packages/hoppscotch-common/src/platform/index.ts` (+2 -2) 📝 `packages/hoppscotch-common/src/platform/inspectors.ts` (+4 -3) 📝 `packages/hoppscotch-common/src/platform/interceptors.ts` (+4 -3) 📝 `packages/hoppscotch-common/src/platform/spotlight.ts` (+3 -3) 📝 `packages/hoppscotch-common/src/platform/std/inspections/extension.inspector.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/platform/std/interceptors/extension.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/services/context-menu/menu/environment.menu.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/services/context-menu/menu/parameter.menu.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/services/context-menu/menu/url.menu.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/services/cookie-jar.service.ts` (+0 -4) 📝 `packages/hoppscotch-common/src/services/debug.service.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/services/inspection/index.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/services/inspection/inspectors/environment.inspector.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/services/inspection/inspectors/header.inspector.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/services/inspection/inspectors/response.inspector.ts` (+1 -3) 📝 `packages/hoppscotch-common/src/services/interceptor.service.ts` (+1 -3) _...and 26 more files_ </details> ### 📄 Description This PR introduces changes to keep the Hoppscotch codebase mostly in line with the changes introduces in [`dioc`](https://github.com/AndrewBastin/dioc) version `3.0.1` which tries to update certain bits of how a `Container` context is passed down to services. ## What's changed - Upgraded `dioc` to `3.0.1` on all packages. - Services which do not do anything other than call the super constructor have their constructor definitions removed so that the normal service constructors are called automatically. - Services which do logic on their constructors are moved to the new `onServiceInit` method overridable by services to implement their initialisation logic. The constructor after moving the logic is removed. - For `StaticSpotlightSearcherService`, an abstract Service that is implemented that standardized static search logic has a constructor which takes arguments, since there are many implementations of this class, for the time being, the constructor is kept on the inherited services but logic is mostly moved ton `onServiceInit`. TODOs are kept to notify that this a thing we will have to refactor down the line. This PR shouldn't introduce any new end-user functionality of changes in behaviour. ## Notes to the reviewer - Make sure all services have their constructors removed and moved to `onServiceInit` (except for `StaticSpotlightSearcherService` and its children). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:09:07 +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#4634
No description provided.