Skip to content

Allow using TypeScript in iD's source? #8651

@til-schneider

Description

@til-schneider

I'd like to start a discussion whether iD should allow to use TypeScript in its source.

Using TypeScript in iD's source was rejected by @bhousel in 2018. But it seems as he changed his opinion about TypeScript since then as he is using TypeScript in id-sdk and RapiD - Facebook's fork of iD (as he pointed out in a comment and in his presentation at SOTM-US in 2019).

In my experience, using TypeScript does nothing less than taking the coding experience to a whole new level: When using an editor with TypeScript support (like VS Code for instance) you get code assistance as you type. This makes coding much more fluid and less error-prone than the indirect and delayed console outputs of the build or - even worse - errors which occur at runtime.

In my private fork of iD I added type information to iD (in the form of .d.ts files), which prevents me from looking up internal APIs all the time. If the iD team decides to allow TypeScript, I would be happy to contribute this work (by migrating the according .js files to .ts files, instead of adding .d.ts files).

In order to allow TypeScript, iD's build has to be changed in order to support this. I already contributed TypeScript build support (using the TypeScript compiler) in my PR "Add support for ReactJS". As I wrote in a comment, I would also contribute TypeScript build support using esbuild if the iD team decides rather to go this way, which would dramatically speed up build time.

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