Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Switch to ESM-only (unblocks ESM-only use-editable)

Aberta
#424 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
25/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
nodejs, react, typescript

Direção de pesquisa

The build is configured in tsdown.config.mts, and the entry fields (main, module, types, exports) live in package.json. Read both to see how the CJS and ESM outputs are produced today, then check the docs for the Jest setup guidance. Done means one ESM build, with attw's esm-only profile and publint both passing, the docs noting the Jest options, and a major changeset added. Leave the use-editable dependency bump until that package has shipped.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Switch react-live to ESM-only (drop the CJS build). This is a major version.

Why

This unblocks making use-editable ESM-only. react-live's CJS build (dist/index.js) does require("use-editable"), so if use-editable went ESM-only first, react-live users running Jest (default CJS mode) would break with "Must use import to load ES Module". Tested with Jest 30.5. Node handles require() of ESM since 20.19 / 22.12, but Jest's module loader doesn't.

Scope

  • "type": "module", single format: 'esm' build in tsdown.config.mts
  • Update main / module / types / exports to the ESM-only output
  • attw esm-only profile, publint clean
  • Docs: note ESM-only and the Jest guidance (ESM mode or transformIgnorePatterns)
  • Changeset (major)

Then

Make use-editable ESM-only: "type": "module", a single ESM build, main → dist/use-editable.js, drop module and .es.js. No exports map needed: Node resolves an ESM main without one (verified, and attw esm-only passes). Bump react-live's use-editable dependency once that's released.

Linguagem predominante
TypeScript
Estrelas
4.6k
Forks
260
Merge médio
17h 25min
PRs com merge (30d)
3

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de FormidableLabs/react-live

Todas as issues de FormidableLabs/react-live

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.