react-strict-dom icon indicating copy to clipboard operation
react-strict-dom copied to clipboard

Compiler: inline wrapper component on web

Open necolas opened this issue 1 year ago • 0 comments

Describe the feature request

Our plan is to try to inline the wrapper component on web, as it is relatively simple as long as some of its dependencies can refactored as importable code. For example, on web we'd take the source code:

import { css, html } from 'react-strict-dom';

const styles = css.create({...});

<html.div
  dir="rtl"
  role="none"
  style={[styles.one, styles.two]}
/>

<html.label
  for={for}
  style={styles.label}
/>

And turn it into something like:

import { css } from 'react-strict-dom';
import { privateStyles } from 'react-strict-dom/internals';

const styles = css.create({...});

<div
  dir="rtl"
  role="presentation"
  {...css.props(privateStyles.div, styles.one, styles.two)}
/>

<label
  dir="auto"
  htmlFor={for}
  {...css.props(privateStyles.label, styles.label}
/>

necolas avatar Feb 21 '24 18:02 necolas