Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support de-camelCasing JSX html attributes #55

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

Open
blakef wants to merge 1 commit into preactjs:main
base: main
Choose a base branch
Loading
from blakef:feature-attribute-transform

Conversation

@blakef
Copy link

@blakef blakef commented Feb 5, 2018

Taken the list of Preact supported attributes and transform these attributes when building the rendered string.

tconroy, gpoitch, developit, and talentlessguy reacted with thumbs up emoji senorcris and tconroy reacted with hooray emoji
Taken the list of Preact supported attributes[1] and transform these
attributes when building the rendered string.
[1] https://github.com/developit/preact/blob/f717ee8e53248d75ff8c1a46966adeec295d339b/src/preact.d.ts#L547 
Copy link
Contributor

@gpoitch gpoitch left a comment

Choose a reason for hiding this comment

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

Need to double check some of the attrs formatting. Noted a few, but there are some others.

spellCheck: 'spell-check',
srcDoc: 'src-doc',
srcLang: 'src-lang',
srcSet: 'src-set',
Copy link
Contributor

Choose a reason for hiding this comment

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

'srcset'

srcDoc: 'src-doc',
srcLang: 'src-lang',
srcSet: 'src-set',
tabIndex: 'tab-index',
Copy link
Contributor

Choose a reason for hiding this comment

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

'tabindex'

Copy link
Member

Hiya! Sorry for the delay in responding to PRs. I'm wondering about the size impact of this, versus using a regular expression transform like name.replace(/([A-Z])/,'-1ドル').toLowerCase().

Copy link
Member

@developit the RegEx approach would suffer from the issue of transforming tabIndex to tab-index instead of tabindex.

Combining both with a list of html attributes that need the hyphen to be removed might be a way to go.

Any other ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@gpoitch gpoitch gpoitch requested changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /