datocms-plugin-sdk 2.2.5 resolves Penpal 4.1.1.
This version of Penpal inherently produces an issue that can compound to plugins exhibiting significant/visible input lag.
In Penpal 4.1.1, its steady-state call and reply handlers access event.data before validating event.source and event.origin. In Chromium, qualifying cross-origin messages can consequently trigger expensive deserialisation in every plugin iframe. In our traces, these receivers averaged roughly 5–6 ms per callback and caused noticeable typing latency.
The issue appears resolved in Penpal 7+, however I appreciate that upgrading to that isn't trivial.
Our own solution is to maintain a local patch that checks source and origin before accessing data. This removed the associated V8.DeserializeIsolate and V8.DeserializeContext work, reduced average receiver time to under 1 ms, and improved typing lag enormously.
The general resolution would be either to:
- migrate to the newer Penpal version; or
- apply an equivalent patch in the SDK
datocms-plugin-sdk2.2.5 resolves Penpal 4.1.1.This version of Penpal inherently produces an issue that can compound to plugins exhibiting significant/visible input lag.
In Penpal 4.1.1, its steady-state call and reply handlers access
event.databefore validatingevent.sourceandevent.origin. In Chromium, qualifying cross-origin messages can consequently trigger expensive deserialisation in every plugin iframe. In our traces, these receivers averaged roughly 5–6 ms per callback and caused noticeable typing latency.The issue appears resolved in Penpal 7+, however I appreciate that upgrading to that isn't trivial.
Our own solution is to maintain a local patch that checks source and origin before accessing data. This removed the associated
V8.DeserializeIsolateandV8.DeserializeContextwork, reduced average receiver time to under 1 ms, and improved typing lag enormously.The general resolution would be either to: