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

Type DTOs using domain oriented design that client/server types extend from #2066

Closed
karrui opened this issue Jun 3, 2021 · 2 comments · Fixed by #2527
Closed

Type DTOs using domain oriented design that client/server types extend from #2066

karrui opened this issue Jun 3, 2021 · 2 comments · Fixed by #2527
Assignees
Labels
P2 planned for next 1-2 months react feature blocking

Comments

@karrui
Copy link
Contributor

karrui commented Jun 3, 2021

Currently, our DTO types are too coupled with server-side implementation, making the client dependent on server-side modules (such as mongo) to get the appropriate types.

This issue proposes DTO types to be completely free of such dependencies and instead be client/server agnostic. Server side types should instead extend from the DTO types to generate their own typings.

This change will properly allow types to be shared between frontend and backend without any (possibly incompatible - between commonjs and node implementations, for example) dependencies

Current implementation

        ILogic & Document
            /
        LogicDto <-- depending on Mongo (server) related types 
          /
      client

Proposed implementation

       LogicDto
        /   \
       /     \
  client      \
               \
         ILogic & Document
@karrui karrui added the discuss to be discussed label Jun 3, 2021
@r00dgirl r00dgirl added P2 planned for next 1-2 months and removed discuss to be discussed labels Jun 7, 2021
karrui added a commit that referenced this issue Jun 7, 2021
in preparation for extending from to close #2066
karrui added a commit that referenced this issue Jun 9, 2021
in preparation for extending from to close #2066
@karrui karrui closed this as completed in 27180ff Jun 10, 2021
@karrui karrui reopened this Jun 10, 2021
@karrui
Copy link
Contributor Author

karrui commented Jun 10, 2021

Accidentally closed by commit message

@karrui
Copy link
Contributor Author

karrui commented Oct 25, 2021

Only src/shared/util/logic.ts is remaining

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 planned for next 1-2 months react feature blocking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants