Skip to content

[REQ] Support TypeScript Server generation #4183

Open
@HiromiShikata

Description

@HiromiShikata

Is your feature request related to a problem? Please describe.

I want to make a server generator of Node using typescript with koa.js.
There is a very nice useful class AbstructTypeScriptClientCodegen for clients, but not for servers.

Describe the solution you'd like

  1. Rename AbstructTypeScriptClientCodegen to AbstructTypeScriptCodegen, and remove getTag() from this
  2. Create AbstructTypeScriptClientCodegen again, add getTag() to this.
  3. Create AbstructTypeScriptServerCodegen, add getTag() to this.

Provably this is a minimal impact and maintainable solution because there are some client generators.
(And we need to change TypeScriptNodeClientCodegen to extends AbstractTypeScriptServerCodegen from AbstractTypeScriptClientCodegen maybe.)

Describe alternatives you've considered

Have only AbstractTypeScriptCodegen

  • Need to add getTag() to all typescript client generators.
  • If increase method for typescript client, we need to change all typescript client generators.

Copy AbstractTypeScriptServerCodegen from AbstructTypeScriptClientCodegen.

  • Almost all functions will overlap with those of client.
    • There are many codes that dependencies TypeScript. It's pretty hard to maintain both codes, I think.

Create AbstractTypeScriptServerCodegen that extends AbstructTypeScriptClientCodegen.

  • if new medhod added to AbstractTypeScriptClientCodegen, it may occur probrem in server.
    • But difficult to notice those problems when working because the name is misleading.

Additional context

TypeScript is used by clients and servers. But other Languages also can have servers and clients.
I would be happy to discuss the good balance of abstraction in this nice project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions