Open renatopeterman opened 8 years ago
It is currently not possible to disable state serialization for a request/context, but it wouldn't be huge change to support that feature. With that said, we will be releasing a new minor version of Marko Widgets with a much-improved state/widget config serialization mechanism that supports circular dependencies and it will automatically de-dupe repeated objects. We hope to have the new version available in a week or two. Would you still want to disable state serialization if we optimized how state was serialized to the browser?
Great! I believe will not be necessary to disable state serialization once we have this improved serialization feature released. But, for now, would be very helpful to have it disabled. What would be the necessary changes to disable it?
Any thoughts on the API for disabling state serialization? It would need to be set before rendering any components. Maybe introduce a tag that could be placed at the top of the page and that produces no output?:
<widgets-configure serialize-state=false/>
FYI, here is the related code:
/cc @mlrawlings @philidem
I like the idea, so I created the widgets-configure
tag here: https://github.com/renatopeterman/marko-widgets/tree/issue-148
It works, but I'm not sure how danger it is to use out.global
like this and I couldn't find a more elegant way to solve this right now. Any idea?
Using out.global
is the right thing to do, but it is probably better to namespace the config under a single property. Maybe out.global.widgetsConfig
. If you make that change and maybe provide some docs and tests then I would have no objection to merging. Thanks for working on this
Is it possible to disable the
data-w-state
serialization for a request?