Skip to content

Move middleware codebase to TypeScript #1365

@Laurin-W

Description

@Laurin-W

From a developer experience point of view, it can be extremely hard to know what the type of an object in a moleculer service might look like. Also, many service actions do not have parameter checks enabled.
With ldo that we are implementing soon, there will be improvements on that front as well.
Note that the frontend supports ts already.

Node 23.6 now supports type-stripping out of the box. Deno as a potential runtime alternative seems to be almost compatible out of the box. There are other approaches to running typescript too, among them tsx, swc, tsc.

There are a few things to consider:

  • We need to keep support for users of the framework that still use javascript.
  • Moleculer is javascript based. There is an open PR to improve type support. Maybe this is coming in v0.15 but we might as well take the PR and add the feature to the type namespace by ourselves for the time being.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions