Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UnserializableComponentWrapper to allow using unserializable components #141

Open
TatuLund opened this issue Sep 20, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@TatuLund
Copy link

Unserializable component cannot be used as transient. Even if that would make serialization phase work, it would produce another problem. When deserialization is done, there would be null-entry in component hierarchy and that would produce NPE at some phase and things break. This is also why just blacklisting unserializable component in serialization by some other means wont work as is either.

Unserializable components do exists for various reasons. Spreadsheet is a good example in our framework: vaadin/flow-components#6612 Other potential candidates can be probably found from Directory add-ons.

As the problem is more generic than Spreadsheet. We could create UnserializableComponentWrapper, and add that as utility to KubernetesKit. UnserializableComponentWrapper would be a component itself. It would necessitate that there will be one wrapping div element in DOM as Composite wont allow wrapped component to change on the fly. Wrapper could have two lambda's as API. The other lambda would be "custom serializer", which would store part of the component state what is serializable. E.g. in case of Spreadsheet, you cannot serialize Workbook, but Workbook has API to get the Excel file, so you could get that as byte array. So that is serializable. The other API will generate a new component instance, e.g. Spreadsheet in this case, and there you could use the part of the state that was serializable. E.g. in this case you can get the bytearray back and set it to Workbook as Excel file.

@TatuLund TatuLund added the enhancement New feature or request label Sep 20, 2024
@vaadin vaadin deleted a comment from SAMBILI Sep 20, 2024
@tamasmak tamasmak self-assigned this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants