v12: Ditch CJS build
Mantenedores costumam responder em até 1 dia
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
- Refatoração
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- node.js, typescript
- Domínio
- backend, build-system
Direção de pesquisa
Start by surveying Node.js versions that support require(esm), then inspect the repository’s CI matrices, package engines fields, documentation, runtime dependencies, and build and deployment configuration. Check whether any runtime dependency uses top-level await and identify an integration test that can catch it. Done means the supported Node.js versions and CI reflect the survey, the dependency constraint is guarded by a test, and builds no longer produce CJS.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
A common user request is to provide a default export from our SDKs: import Sentry from '@sentry/somesdk' rather than import * as Sentry from '@sentry/somesdk'.
However, this is quite annoying to do, for the fact that we build for both CJS and ESM, using the same types definitions, as typescript represents the default export quite differently between CJS and ESM. (For good reason; they're semantically different in very subtle ways that are impossible to represent 100% faithfully, even if these only become an issue in certain edge cases.)
Option 1: build types twice
This is definitely a possibility, and not terrible. It does increase our build times a tiny bit, but many projects do hybrid builds this way, and it's typically not that bad. It'll increase the download size of our packages by a modest amount, but the run-time cost stays what it is today.
As this is less good than Option 2 below, it's a known-mediocre fallback (maybe still better than "leave it, no change") if we run into problems.
Option 2: Ditch CJS
This has a ton of benefits. Faster CI (because we can cut out entire dimensions of several build/test matrices), smaller download size, etc. And, we can do it with only a very modest platform support coverage hit, because new Node versions all support require(esm).
The only hazard (apart from version support) is that if anything in the runtime dependency chain uses top-level await, it blows up.
Done when...
- Survey node versions that support
require(esm)to confirm we have the appetite to restrict our supported node versions to that list, and then do so. (Adjust CI matrices,enginesfields, docs, etc.) - Ensure that none of our runtime dependencies use top-level await. This is probably fine, mostly the only runtime deps we have outside of this repo are either optional peer-deps that the user provides,
@sentry/conventions, and@opentelemetry/api. But we should check, and have an integration test that'll fail if this changes. (Currently it seems safe.) - Update our build and deployment mechanisms to no longer build CJS.
- Linguagem predominante
- TypeScript
- Estrelas
- 8.8k
- Forks
- 1.9k
- Merge médio
- 1d 8h
- PRs com merge (30d)
- 744
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o 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 getsentry/sentry-javascript
-
AWS Lambda Waiting for: Product Owner
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
getsentry/sentry-javascript#26910 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Only create Nuxt database and storage spans when there is a parent spanTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. AbertaImprovement Nuxt
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
getsentry/sentry-javascript#25805 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Only create Cloudflare storage and D1 db spans when there is a parent spanTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. AbertaCloudflare Workers Improvement Spans
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
getsentry/sentry-javascript#25804 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Core Feature: Typescript Meta: Breaking
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
getsentry/sentry-javascript#25286 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
javascript
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
getsentry/sentry-javascript#24200 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de getsentry/sentry-javascript
Issues semelhantes
-
Postgres upgrade golden leaves fixture URL query parameters in the expected output comparisonAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
garrytan/gbrain#10437 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Bedrock "Too many tokens" throttle is not auto-retried, unlike "Too many requests"Talvez já em andamento @acmerfight assumiu hoje. Abertauntriaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
earendil-works/pi#12573 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
agentes-chat/agentes-chat#1506 ·
Mantenedores costumam responder em até 1 dia
-
comp/desktop desktop/files os/windows P2 type/perf
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
NousResearch/hermes-agent#160359 ·
Mantenedores costumam responder em até 1 dia
-
Missing repro Platform: Android
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
software-mansion/react-native-reanimated#11554 · 1 comentário ·
Mantenedores costumam responder em até 1 dia