Possible to define callbacks entirely in JS?

I have an app that makes heavy use of clientside callbacks. In fact, the majority of callbacks are clientside.

Still, each clientside callback is defined in Python, with their relevant Input, Output, and State.

I’m wondering is it possible to define clientside callbacks entirely in JS, meaning not just the JS function but also inputs, outputs and state?

Reason: purely DX. Current options are:

  1. callback definition in Python, with the function in a JS file
    • a bit annoying, e.g. when troubleshooting
  2. JS in a Python string
    • IDE support for code in strings is limited

Ideally: everything related to a clientside callback should be in one place in a JS file.

Hello @frnhr,

This is an interesting idea.

@alexcjohnson , @Philippe, what are your thoughts on it?

I’m thinking that technically this is possible. The developer could add the callbacks via the renderer?