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.

貢獻者指南