Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#424 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
TypeScript
星标
4.6k
派生
260
平均合并
17 小时 25 分钟
30 天内合并 PR
3

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

FormidableLabs/react-live 的其他 Issue

查看 FormidableLabs/react-live 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。