microsoft / microsoft/TypeScript

Should `lib` support `disposable`? Should `decorators` be merged with `esnext.decorators`?

Open
#54,822 1 comment 0 reactions 1 assignee View on GitHub

@rbuckton is already working on this.

Since Jun 29, 2023.

Needs Investigation
Dominant language
Go
Stars
111k
Forks
14.4k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

Currently, you can access all the explicit resource management stuff via the following lib option:

    "lib": ["es2022", "esnext.disposable"],

However, the following doesn't work:

    "lib": ["es2022", "disposable"],

Should it? It is kind of weird that there is no disposable setting whereas you can for decorators.

When I looked into this, I realized an oddity - that there is both a decorators and esnext.decorators, but that they are not the same thing despite both being part of esnext. The only difference is that esnext.decorators defines Symbol.metadata.

These are both part of esnext, so should they be merged?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.