facebookarchive/prepack

Make "Model Invariant Violation" more useful

Open

#1,271 创建于 2017年12月14日

在 GitHub 查看
 (7 评论) (0 反应) (0 负责人)JavaScript (520 fork)batch import
enhancementhelp wantedlevel 1 (super easy)

仓库指标

Star
 (14,268 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

When Prepack operates on a bundle and emits invariants checking whether the model is correct, we should be able to provide a more descriptive warning that describes which input file to change (the one we think is the model) as well as a suggestion of what to insert to fix the model and where.

Link to where we emit invariants: https://github.com/facebook/prepack/blob/a0ece2f8b418211254b1b4e52ade072c037a7799/src/utils/generator.js#L224

e.g.

"Prepack model invariant violation property of object in file:line expected to be found Suggestion: Change to "

Or in the case where the value was missing from the model, give an example line to add to the model.

贡献者指南