facebookarchive/prepack

Make "Model Invariant Violation" more useful

Open

#1.271 geöffnet am 14. Dez. 2017

Auf GitHub ansehen
 (7 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (520 Forks)batch import
enhancementhelp wantedlevel 1 (super easy)

Repository-Metriken

Stars
 (14.268 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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.

Contributor Guide