Closed rcj-siteimprove closed 2 days ago
Latest commit: d6f056d835c5d79048364f0e3ea532bf9330968a
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
!pr extract
Let's go a bit back on the changes.
Instead of adding the type parameter everywhere, we can keep it on the toJSON()
method. Also need to keep sure all properties are optionals.
class Diagnostic {
…
public toJSON(options: json.SerializationOptions) { … }
}
class DiagWithNodeAndFooAndBar {
…
public toJSON(options: Node.SerializationOptions & Foo.SerializationOptions & Bar.SerializationOptions) { … }
This does, however require we also change the existing ones for consistency.
!pr extract
Let's go a bit back on the changes. Instead of adding the type parameter everywhere, we can keep it on the
toJSON()
method. Also need to keep sure all properties are optionals.class Diagnostic { … public toJSON(options: json.SerializationOptions) { … } } class DiagWithNodeAndFooAndBar { … public toJSON(options: Node.SerializationOptions & Foo.SerializationOptions & Bar.SerializationOptions) { … }
This does, however require we also change the existing ones for consistency.
@Jym77 This should be done now
!pr extract
Propagate the serialization options in
Diagnostic
subclasses so that they are eventually applied when serializingElement
s.I have deliberately only propagated the options where they would eventually be passed to
Element.toJSON
. Propagating them to all sub-calls would explode and the options wouldn't be used for anything anyway, so it seems somewhat a waste of time.