`@@jsxConfig({version: 3})` silently disables the JSX transform
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 74/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- ocaml
- 领域
- compilers
调研方向
阅读 compiler/syntax/src/jsx_ppx.ml,重点查看第 53–56 行对 @@jsxConfig 版本的处理,以及第 107 行和第 124 行的转换检查。先检查附近的验证逻辑和 JSX 配置测试。添加测试,证明不支持的版本(例如 3)会在 version 字段报告错误;当无效配置不再导致 JSX 悄无声息地未被转换时,即为完成。
由索引模型根据 Issue 内容生成。
描述
@@jsxConfig accepts any version and stores it without checking (compiler/syntax/src/jsx_ppx.ml:53-56). The transform only runs when the version is 4 (jsx_ppx.ml:107, :124). Any other value, e.g. a leftover version: 3 from the JSX v3 days, silently turns the JSX transform off for the rest of the file. There is no error or warning.
@@jsxConfig({version: 3})
module C = {
@react.component
let make = () => React.null
}
let x = <div />
bsc -bs-jsx 4 -dsource on master (6ea63e5a91) shows the file untransformed: make keeps its @react.component attribute, there is no props type, and <div /> stays a JSX node. With version: 4, the same file is transformed as expected (type props, React.component, ReactDOM.jsx).
Expected: an error for unsupported JSX versions (only 4 exists since v11/v12), pointing at the version field. JSX v3 support is gone, so this should not fall through to an untransformed AST.
Possibly related cleanup: since only v4 remains, Jsx_common.version could become an enabled flag, and the no-op -bs-jsx-mode flag could go in v13.
- 主要语言
- OCaml
- 星标
- 7.5k
- 派生
- 484
- 平均合并
- 21 小时 9 分钟
- 30 天内合并 PR
- 255
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rescript-lang/rescript 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
rescript-lang/rescript#9135 ·
维护者通常 1 天内回复
-
Printed type declarations drop @tag, @notUndefined and runtime annotations可能已有人在做 @cknitt 今天认领。 未关闭
难度 4/5 1-2 天 新手友好度 25/100
rescript-lang/rescript#9134 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
rescript-lang/rescript#9130 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 1-2 天 新手友好度 55/100
rescript-lang/rescript#9122 ·
维护者通常 1 天内回复
-
Dev dependencies interacting可能已有人在做 @CarlOlson 于 3 天前认领。 未关闭
难度 4/5 1-2 天 新手友好度 25/100
rescript-lang/rescript#9089 · 1 条评论 ·
维护者通常 1 天内回复
查看 rescript-lang/rescript 的全部 Issue
相似的 Issue
-
bug medium priority openmp tokenizer wrong result
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
CanadaHonk/porffor#426 ·
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复