Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Conversation

@HexaField
Copy link
Contributor

@HexaField HexaField commented Oct 19, 2023

Summary

🤖 Generated by Copilot at 90f8ce8

This pull request refactors several files in the client-core and editor packages to use the Engine instance for accessing the backend services, instead of the deprecated API class. This improves the code quality, consistency, and performance of the client and the editor. It also deletes an unused file InviteTypeService.ts.

References

closes #insert number here

Explanation

🤖 Generated by Copilot at 90f8ce8

  • Refactored various services and components to use the Engine instance instead of the API class that was deprecated (link, link, link, link, link, link, link, link, link, link, link)
  • Removed unused imports of matches and API from LocationInstanceConnectionService.ts, OEmbedService.ts, and EditorActiveInstanceService.ts (link, link, link)
  • Added imports of Engine from @etherealengine/engine/src/ecs/classes/Engine to access the api property for interacting with the backend services (link, link)
  • Replaced the usage of API.instance.client.service with Engine.instance.api.service in the LocationInstanceConnectionService class (link)
  • Moved the fetchData and provisionServer methods from the OEmbedService and EditorActiveInstanceService classes to the OEmbedState and EditorActiveInstanceState state definitions respectively, to simplify the classes and make the methods more accessible as properties of the states (link, link)
  • Removed the OEmbedActions and EditorActiveInstanceAction classes and the OEmbedServiceReceptor and EditorActiveInstanceServiceReceptor functions from the OEmbedService and EditorActiveInstanceService files, to eliminate the unnecessary use of actions and receptors for the services, since the state can be updated directly by the fetchData and provisionServer methods (link, link)
  • Fixed a syntax error by adding a closing parenthesis to the end of the EditorActiveInstanceState state definition (link)
  • Replaced the import and usage of EditorActiveInstanceService with EditorActiveInstanceState in the EditorInstanceNetworkingSystem and WorldInstanceConnection files, to use the updated state definition that contains the getActiveInstances and provisionServer methods (link, link, link, link)
  • Relocated the EditorActiveInstanceService file from the packages/editor/src/components/realtime folder to the packages/client-core/src/common/services folder, to reorganize the code structure and improve the modularity and reusability of the service (link)
  • Deleted the InviteTypeService file from the packages/client-core/src/social/services folder, as it was no longer needed (link)

🤖 Generated by Copilot at 90f8ce8

We're sailing on the Engine now, me hearties, yo ho ho
We've left the old API behind, it's time to let it go
We've cleaned up all the state and actions, made the code more neat
We'll heave away on the count of three, and make this ship complete

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewers

@HexaField HexaField marked this pull request as draft October 19, 2023 02:07
@HexaField HexaField changed the title migrate unused OEmbedService to new code standard migrate states to new code standard Oct 19, 2023
@HexaField HexaField marked this pull request as ready for review October 19, 2023 22:09
Copy link
Contributor

@aditya-mitra aditya-mitra left a comment

Choose a reason for hiding this comment

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

Looks good to me!
(Just need to resolve the merge conflicts)

@HexaField HexaField merged commit 0acd276 into dev Oct 20, 2023
@HexaField HexaField deleted the refactor-OEmbedService branch October 20, 2023 03:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants