akvelon / dart-highlighting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migrate from CircularJSON to Flatted

alexeyinkin opened this issue · comments

commented

As I found out, Flatted probably doesn't do anything for us. After we parse the stringified object with Flatted we get the initial circular object.

Its scope of use is probably parsing circular JSON objects between services.

Yes. We actually do not need the perfect serialize-deserialize pass. We serialize with CircularJSON but deserialize with the ordinary JSON and then look for CircularJSON-specific tokens. This works because CircularJSON produces valid JSON syntax.

They deprecated CircularJSON in favor of Flatted, but it uses its custom syntax and so cannot be deserialized with JSON.parse(). So it will not fit the workflow.