Automated Migration for Breaking Changes to the Type System
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 20/100
- Tipo de issue
- Funcionalidade
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- typescript
- Domínio
- compilers
Direção de pesquisa
Comece lendo as breaking changes descritas em TypeScript issue 33272 e analisando a TypeScript Compiler API como base proposta para codemods. Defina quais migrações somente de tipos podem ser automatizadas, como a ferramenta relata os casos que introduziriam erros e como os usuários a invocam. O trabalho estará concluído quando houver um design de migração com escopo definido e uma separação clara entre transformações automatizadas e decisões humanas.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Automated Migration for Breaking Changes to the Type System
Search Terms
codemod, migration, upgrade
Suggestion
semi-automated migration when there are breaking changes in the type system
One way of implementing this would be via codemods (could use the TS Compiler API) that do trivial update tasks as described in https://github.com/microsoft/TypeScript/issues/33272
Use Cases
- Would make it easier for users to upgrade to the latest TypeScript
- Would make it easier for the TS team to upgrade TypeScript
- Might enable TS to evolve faster, as the pain from these "breaking" changes will be smaller
The changes described in https://github.com/microsoft/TypeScript/issues/33272, for example, were mostly trivial, and ideally would not need much human intervention.
Type-only changes are especially amenable to this kind of treatment, because no one's app will misbehave at runtime if there is a bug in the transformation.
I say 'semi-automated' because in cases where the tool can't figure out the problem, the tool could yield to human judgment. Tooling for this doesn't have to be perfect, but a small amount of automation could go a long way.
Examples
example.ts
const myPromise: Promise<{}> = dontCarePromise();
tsc --upgrade --from=3.5 --to=3.6 example.ts
const myPromise: Promise<unknown> = dontCarePromise();
The example is from https://github.com/microsoft/TypeScript/issues/33272.
In a case where the conversion would lead to a new type error, I'd expect the tool to bail out, explain the situation, and let the human decide what to do.
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
- Linguagem predominante
- Go
- Estrelas
- 111k
- Forks
- 14.4k
- Merge médio
- 1d 19h
- PRs com merge (30d)
- 117
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoft/TypeScript
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
microsoft/TypeScript#64322 · 2 comentários · 1 reação · 2 responsáveis ·
-
Possible Improvement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
microsoft/TypeScript#64278 · 1 comentário · 1 reação ·
-
Docs
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
microsoft/TypeScript#64118 · 1 comentário ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
microsoft/TypeScript#64094 ·
-
Docs
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
microsoft/TypeScript#63959 · 5 comentários ·
Todas as issues de microsoft/TypeScript
Issues semelhantes
-
optimization optimization:agents-md-curator
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
githubnext/gh-aw-cao#13143 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
blinklabs-io/bursa#904 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comentários ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 90/100