Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update to dioc v3 #4009

Merged

Conversation

AndrewBastin
Copy link
Member

@AndrewBastin AndrewBastin commented Apr 25, 2024

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).

Copy link
Member

@jamesgeorge007 jamesgeorge007 left a comment

Choose a reason for hiding this comment

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

There're type errors wrt useService composable usage. Can you look into it?

@AndrewBastin AndrewBastin merged commit be57255 into hoppscotch:release/2024.3.2 Apr 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants