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: migrate system service to trpc #284

Merged
merged 5 commits into from
Jan 23, 2023
Merged

Conversation

meienberger
Copy link
Collaborator

@meienberger meienberger commented Dec 21, 2022

Purpose

This pull request introduces tRPC to replace GraphQL in the client. By progressively moving to tRPC we can leverage the NextJS server instead of having a separate container running for the api. This will allow to move faster when refactoring and adding new features. Also only one build and run step would be necessary to run Tipi instead of having a client/server distinction.

Changes

  • setup trpc client and router
  • rename api to api-legacy in order to use both nextjs api and the current api implementation at the same time
  • added server env variables and folder mappings to client
  • jest projects config to support 2 configs for same next js project (server, client)
  • create new trpc router for system queries
  • replace graphql system queries where used with trpc
  • new Container layout to simplify data state management (error, loading, data)
  • Duplicate EventDispatcher, Logger, TipiCache and TipiConfig to client/server

@meienberger meienberger changed the base branch from master to develop December 21, 2022 23:30
@meienberger meienberger changed the title poc: migrate system service to trpc refactor: migrate system service to trpc Dec 24, 2022
@meienberger meienberger force-pushed the feat/poc-trpc branch 4 times, most recently from 2f695bd to 8a79341 Compare December 24, 2022 17:54
@codecov-commenter
Copy link

codecov-commenter commented Dec 24, 2022

Codecov Report

Base: 87.65% // Head: 85.82% // Decreases project coverage by -1.83% ⚠️

Coverage data is based on head (9e85bea) compared to base (34e6ff3).
Patch coverage: 75.93% of modified lines in pull request are covered.

❗ Current head 9e85bea differs from pull request most recent head 1ff3620. Consider uploading reports for the commit 1ff3620 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #284      +/-   ##
===========================================
- Coverage    87.65%   85.82%   -1.84%     
===========================================
  Files          108      109       +1     
  Lines         2171     2250      +79     
  Branches       349      385      +36     
===========================================
+ Hits          1903     1931      +28     
- Misses         261      307      +46     
- Partials         7       12       +5     
Impacted Files Coverage Δ
...rc/client/components/StatusScreen/StatusScreen.tsx 100.00% <ø> (ø)
...dashboard/src/client/core/apollo/links/httpLink.ts 0.00% <ø> (ø)
...ackages/dashboard/src/client/generated/graphql.tsx 78.57% <ø> (+1.21%) ⬆️
.../dashboard/src/client/hooks/useCachedRessources.ts 0.00% <0.00%> (ø)
packages/dashboard/src/client/state/systemStore.ts 80.00% <0.00%> (+5.00%) ⬆️
packages/dashboard/src/client/utils/typescript.ts 0.00% <ø> (ø)
...board/src/server/common/get-server-auth-session.ts 0.00% <0.00%> (ø)
packages/dashboard/src/server/context.ts 0.00% <0.00%> (ø)
...ackages/dashboard/src/server/core/Logger/Logger.ts 0.00% <0.00%> (ø)
packages/dashboard/src/server/routers/_app.ts 0.00% <0.00%> (ø)
... and 31 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@meienberger meienberger force-pushed the feat/poc-trpc branch 2 times, most recently from c1bfa7c to 3ee207e Compare December 24, 2022 19:52
@meienberger meienberger marked this pull request as ready for review December 24, 2022 19:59
@meienberger meienberger changed the base branch from develop to refactor/dashboard-client-folder December 25, 2022 09:47
Base automatically changed from refactor/dashboard-client-folder to develop December 26, 2022 03:22
@sonarcloud
Copy link

sonarcloud bot commented Dec 27, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

No Coverage information No Coverage information
12.5% 12.5% Duplication

@meienberger meienberger merged commit 92c1a76 into develop Jan 23, 2023
@meienberger meienberger deleted the feat/poc-trpc branch January 23, 2023 19:04
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

2 participants