Skip to content

Deprecate signals on JsonParser

Emmanuele Bassi requested to merge ebassi/parser-signals into master

Signals were never a good solution for injecting custom JSON into the data stream: they come with a bunch of performance and ergonomics implications.

Ideally, we should never have to deal with overriding the parsing process; that was just something I added so I could implement ClutterScript, with its ability to inject object members while parsing JSON but before transforming the JSON data into its intermediate representation. These days, signals are mainly an hindrance: validation and fallback values should be performed after the JSON stream has been converted into JSON objects.

To avoid breaking backward compatibility, JsonParser now checks if there are signal handlers or vfunc overrides, before trying to emit the signals.

Edited by Emmanuele Bassi

Merge request reports