Skip to content

Add Custom Data-Attributes to Components for OUIA Compatibility #2303

@redallen

Description

@redallen

Custom data- attributes on our components can help QE teams with integration tests. One suggestion is OUIA. Investigate how to include such attributes behind a Local Storage flag (for now).

This runtime could be useful for consumers who wish to run their own integration tests that locate PF4 components by data- attributes.

On the other hand, this is a violation of KISS in our main dist where dead code for these extraneous attributes will exist for a runtime most consumers never use and certainly won't want to ship in production. Webpack will not tree-shake the code because it has no idea what localStorage will be at runtime.

We could release a separate react-core-test package with these attributes for every major release, or ship a new module type like amd and require integration tests use that unpopular module type that doesn't include the data- attributes.

Open to discussion.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions