facebookarchive/prepack

Make "Model Invariant Violation" more useful

Open

#1,271 opened on 2017年12月14日

GitHub で見る
 (7 comments) (0 reactions) (0 assignees)JavaScript (520 forks)batch import
enhancementhelp wantedlevel 1 (super easy)

Repository metrics

Stars
 (14,268 stars)
PR merge metrics
 (30d に merged 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.

コントリビューターガイド