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

Serializing Systems #43

Open
tukkek opened this issue Jul 12, 2018 · 0 comments
Open

Serializing Systems #43

tukkek opened this issue Jul 12, 2018 · 0 comments
Milestone

Comments

@tukkek
Copy link
Owner

tukkek commented Jul 12, 2018

using a serialization library would be great when saving Systems later on but no solution works out-of-the-box quite yet. serializr comes close but doesn't support polymorphism plus requires redundant schema declaration.
The alternative is to roll-out a custom procedure that sanitizes/regenerates all class+subclass instances on save/load - but that's a project in and of itself.
Another options is simply not to store Systems at all since that's the only object graph that would be a major pain to serialize in a custom manner. Once the technology is caught up this can be added more easily.

https://unpkg.com/serializr
import {createModelSchema,primitive,reference,list,object,identifier,serialize,deserialize,} from './lib/serializr';
The "Create schema and store it on constructor" seems to be the most elegant when it comes to modules, since each file could easily handle its own setDefaultModelSchema() call (short of some unexpected dependency issue). See https://github.com/mobxjs/serializr .
Main blocker (polymorphism support) mobxjs/serializr#65

@tukkek tukkek added this to the Mid term milestone Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant