facebookarchive/prepack

Make "Model Invariant Violation" more useful

Open

#1271 aperta il 14 dic 2017

Vedi su GitHub
 (7 commenti) (0 reazioni) (0 assegnatari)JavaScript (520 fork)batch import
enhancementhelp wantedlevel 1 (super easy)

Metriche repository

Star
 (14.268 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor