Publisher Form changes
WebHare 5.6 will bring a lot of changes to the JavaScript form apis, so we recommend testing your forms against the 'master' branch as soon as you can.
Form/component initialization race
There are currently some subtle races in form registration code (you may already have seen 'Cannot set value on non-FormControl' in your console). Forms handlers and dompack.register handled components
race against each other to be initialized. Generally the formhandler registration wins and some code has come to rely on this, causing subtle bugs on slow connections. We cannot fix this with the current
approach as there's no way for the form hander to know which components it should wait for.
To fix this a new base class JSFormElement has been added to @webhare/forms. Your custom components should derive from this. Form handler activation is delayed until the components are [registered]](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/whenDefined).
Removal of compat/upload APIs and upload before submission
We have replaced the JavaScript compat/upload API and related libraries (such as webserver/filetransfer.whlib) with @webhare/upload and GetUploadedFile in HareScript (and related TypeScript APIs in @webhare/services).
Additionaly we've changed the RPC Form code to no longer start uploading files and images immediately after selecting them - we'll now wait for an actual Submit or RPC to occur. This simplifies bookkeeping
on the server side and is better for privacy - it gives you a chance to see which image you selected and delete it before it gets sent to the server.
Custom form components may break due to this change.
(We still want to modify the invokeRPC process to only upload files/images (and other fields) if explicitly needed by that RPC)
Synchronous value API
The form APIs are more complex to use than they need to be for frontend JavasScript code to interace with them
Custom form components should implement the FormFieldLike interface and specifically implement a value property with getters and setters.
To do this it's easiest extend from JSFormElement and be defined using customElements.define, not dompack.register