Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: option to force dynamic jsx precompile props #259

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

marvinhagemeister
Copy link
Contributor

@marvinhagemeister marvinhagemeister commented Jun 24, 2024

There are scenarios where framework plugins want to be able to intercept creation of properties. Some Fresh plugins like the current unocss and twind plugin want to intercept all class/className props to render CSS. All other properties not in the list should be treated as usual.

const a = <div class="foo" />

// Before: Not interceptible
const tpl = [
  '<div class="foo"></div>'
]
const a = jsxTemplate(tpl)

// After: interceptible if prop is excluded
const tpl = [
  "<div ",
  "></div>"
]
const a = jsxTemplate(tpl, jsxAttr("class", "foo"))

Related denoland/fresh#2540

There are scenarios where framework plugins want to be able to intercept creation of properties. Some Fresh plugins like the current unocss and twind plugin want to intercept all `class/className` props to render CSS.
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM too

@marvinhagemeister marvinhagemeister merged commit 4d8955f into main Jun 24, 2024
2 checks passed
@marvinhagemeister marvinhagemeister deleted the jsx-precompile-dynamic-props branch June 24, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants