Skip to content

Support Houdini Typed OM #882

@kof

Description

@kof

Houdini typed values API can be polyfilled with a fallback to strings, so we can actually start using in the latest versions and get perf benefits.

https://ishoudinireadyyet.com/
https://developers.google.com/web/updates/2018/03/cssom

Current way:

  rule.style.margin = '5px';
  rule.style.margin // 5px

New way:

rule.attributeStyleMap.set('margin', CSS.px(10))
rule.attributeStyleMap.get('margin') // CSSUnitValue {value: 10, unit: 'px'}

We can easily feature test it and use the new API always when supported. We don't care about all the CSS.whatever methods, they should be polyfilled in a separate product, we should just use attributeStyleMap when available, it also supports old-style strings.

Todo

  • add conditional to DomRenderer
  • add documentation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions