bokeh icon indicating copy to clipboard operation
bokeh copied to clipboard

Investigate using `Object.preventExtensions()` on model instances

Open mattpap opened this issue 1 year ago • 1 comments

Currently nothing prevents users to set attributes/properties on models instances, like trying to set nonexistent InputWidget.enabled instead of the correct InputWidget.disabled. This is especially easy to mix up in all variants of CustomJS models, where no editor feedback is currently possible.

mattpap avatar Jun 12 '24 19:06 mattpap

If that won't work, an alternative is to Proxy model instances just in CustomJS and alike, and intercept appropriately attribute setting. In that limited context slowness of Proxy objects will be negligible.

mattpap avatar Jun 12 '24 19:06 mattpap