Skip to content

Image: modern API and implementation #1786

@necolas

Description

@necolas

Is your feature request related to a problem? Please describe.

Provider a high-performance Image implementation for web. This issue is to discuss how we should rewrite Image to support modern web features.

Describe a solution you'd like

The new Image should implement the following feature requests…

  1. Support browser ML-generated alt text.
  2. Support browser lazy loading.
  3. Support browser crossOrigin configuration.
  4. Display image in Windows High Contrast mode.
  5. Support image DPI switching.
  6. Support for CSS like backgroundBlendMode.
  7. Available for SSR.

The new Image will not support the following APIs…

  1. No tintColor, resizeMode, and shadow* styles.
  2. No repeat value for resizeMode.

The proposed Image API looks like this…

<Image
  alternativeText=''
  crossOrigin='anonymous'
  decoding='async'
  draggable='false'
  focusable='false'
  loading='lazy'
  nativeID=''
  onError={() => {}}
  onLoad={() => {}}
  source={[ {uri, scale}, {uri, scale} ]}
  style={{}}
  testID=''
/>

Any dynamic loading via XHR/fetch would have to be layered upon that.

Additional context

Please comment with addition context and use cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions