getodk / central-frontend

Vue.js based frontend for ODK Central
https://docs.getodk.org/central-intro/
Apache License 2.0
32 stars 59 forks source link

Move i18n from EntityMetadataRow to en.json5 #947

Closed matthew-white closed 8 months ago

matthew-white commented 8 months ago

I randomly noticed that EntityMetadataRow has an <i18n> custom block. We previously found that <i18n> custom blocks resulted in noticeably reduced performance for the submissions table: because the table uses infinite scroll, it can render many row components, each of which has to do a small amount of work to initialize its i18n. Surprisingly, that work did end up adding up, so we removed <i18n> custom blocks from the row components. The entities table can similarly render many row components, so I think we should remove the <i18n> custom block from EntityMetadataRow. I've moved the one message in EntityMetadataRow to en.json5.

Why is this the best possible solution? Were any other approaches considered?

At some point, we're planning to replace these tables' infinite scroll with pagination, after which this may no longer be a concern. It's also conceivable that Vue I18n has addressed this performance issue since the last time I checked. However, I think there's little downside to moving this one message to en.json5. If it can help prevent performance issues before the time that we introduce pagination, I think that'll be worth it. We can always move the message back if/when we're confident it's OK to do so.

What has been done to verify that this works as intended?

I verified locally that the row still shows the correct tooltip for the button.

Before submitting this PR, please make sure you have: