Expose emitted module specifiers on AMD outfile emit
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- typescript
- Domínio
- compilers
Direção de pesquisa
Comece rastreando os componentes internos do emissor do TypeScript que determinam os especificadores de módulos AMD ao emitir para um único arquivo de saída. Revise a API do compilador em torno de SourceFile.fileName, SourceFile[] e Host.writeFile e, em seguida, defina como os especificadores emitidos devem ser expostos. O trabalho estará concluído quando os chamadores puderem obter os especificadores exatos contidos no bundle gravado sem precisar adivinhá-los.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Search Terms
amd outfile module specifier
Suggestion
Currently when utilising the compiler APIs to emit as AMD to a single outfile, the emitted module specifier in the outfile is not exposed, but does not match the source file SourceFile.fileName or any other attribute.
It appears that there are internals of the TypeScript emitter which determine the module specifier that is included output. For example, if given /foo/bar/baz.ts and /foo/qat/qux.ts being part of the same program, when emitted as AMD in a single bundle the module specifier, the outfile will define() a module named bar/baz and qat/qux. It appears that the algorithm used looks for the common root and removes the extension to determine the module specifier.
Use Cases
When loading the bundle with an AMD loader, knowing what a module specifier is in the outfile is needed to be able to specify a module to load in a require() statement. So if we were automating a custom build, outputting a "bundle" and determining which module to require() to bootstrap the application, we have to "guess" and hope that the emitter doesn't change its algorithm of determining the module specifiers.
Examples
I'm not totally sure, but a public API that would take a SourceFile[] and provide back a string[] array of module specifiers. This could be used in Host.writeFile() to determine what module specifiers are contained in the written file.
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