Skip to content

Create utils.nodeSerializer method #3471

@WilcoFiers

Description

@WilcoFiers

Before axe-core sends information to frameMessanger, it has to serialise DqElements. This method would allow us to customize how elements are serialized. This can be particularly useful for gathering additional data necessary to run certain axe-core plugins. The API would look something like this:

axe.utils.nodeSerializer({
  serializeNode: dqElm => magic(dqElm),
  combineSpecs: (nodeSpec, frameSpec) => metaMagic(nodeSpec, frameSpec)
})

The serializeNode method would then be called in place of dqElm.toJson(), and combineSpecs would be called in place of DqElement.mergeSpecs(). To unset the nodeSerializer, we can use axe.utils.nodeSerializer(null). That lets us switch between different settings needed for different plugins and runs.

Metadata

Metadata

Assignees

Labels

coreIssues in the core code (lib/core)featNew feature or enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions