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: allow all dom elements for the chakra factory #5508

Merged
merged 4 commits into from Feb 17, 2022

Conversation

TimKolberger
Copy link
Contributor

@TimKolberger TimKolberger commented Feb 1, 2022

📝 Description

Allow all JSX.IntrinsicElements for the chakra factory. This allows to use every DOM element with the shorthand version:

<chakra.header>Header</chakra.header>
<chakra.main>Main</chakra.main>
<chakra.footer>Many more</chakra.footer>

⛳️ Current behavior (updates)

It's a hardcoded list

🚀 New behavior

It derives the types from JSX.IntrinsicElements and resolves the components lazy with a Proxy and a Map as cache.

💣 Is this a breaking change (Yes/No):

No

📝 Additional Information

MDN Proxy

@changeset-bot
Copy link

changeset-bot bot commented Feb 1, 2022

🦋 Changeset detected

Latest commit: b98f89b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@chakra-ui/system Minor
@chakra-ui/provider Patch
@chakra-ui/react Patch
@chakra-ui/skeleton Patch
@chakra-ui/props-docs Patch
@chakra-ui/test-utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 1, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/chakra-ui/chakra-ui-storybook/Ank8TniCjfxRRtgLuwPVAghr9nnm
✅ Preview: https://chakra-ui-storybook-git-feat-factory-proxy-chakra-ui.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 1, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b98f89b:

Sandbox Source
create-react-app-ts Configuration

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2022

📦 A new release has been made for this pull request

To play around with this release, you can install @chakra-ui/react@0.0.0-pr-202215114917 in your project

Latest commit: b98f89b

] as const

export type DOMElements = UnionStringArray<typeof domElements>
export type DOMElements = keyof JSX.IntrinsicElements
Copy link
Member

Choose a reason for hiding this comment

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

Such a breath of fresh air! Thanks for working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Styled System 💅🏻 Type: Feature 🚀 Issue or PR that adds a feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants