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

refactor: popper package #3583

Merged
merged 22 commits into from
Mar 17, 2021
Merged

refactor: popper package #3583

merged 22 commits into from
Mar 17, 2021

Conversation

segunadebayo
Copy link
Member

@segunadebayo segunadebayo commented Mar 15, 2021

Closes #3433 #2481 #3385 #3089 #3384 #3440

📝 Description

This PR refactors the internal popper package to:

  • Leverage CSS custom properties to set the things like the arrow's placement, size, shadow color + transform-origin of the popper based on the dynamic position.
  • Removes all internal state used in usePopper and let popper.js write the styles internal. I found this is more reliable and works consistently.
  • Use the lite version of popper.js to get a smaller bundle size
  • Co-locate all modifiers logic into the popperGenerator which gives us an agnostic base for all popper implementations across React and Vue.

⛳️ Current behavior (updates)

There seem to be a lot of inconsistencies or issues with the placement of components and there were some hacks we had but didn't work well.

🚀 New behavior

Allows popper.js to handle all style computation and remove internal state. This is consistent and more reliable

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

No, as usePopper is an internal API

📝 Additional Information

@vercel
Copy link

vercel bot commented Mar 15, 2021

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/3zgmZFBQN1gAJhsNAmGjhrBpRWF9
✅ Preview: https://chakra-ui-git-refactor-popper-chakra-ui.vercel.app

@changeset-bot
Copy link

changeset-bot bot commented Mar 15, 2021

🦋 Changeset detected

Latest commit: 47e3d79

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

This PR includes changesets to release 57 packages
Name Type
@chakra-ui/styled-system Minor
@chakra-ui/system Minor
@chakra-ui/cli Minor
@chakra-ui/menu Patch
@chakra-ui/popover Patch
@chakra-ui/theme Patch
@chakra-ui/tooltip Patch
@chakra-ui/popper Major
@chakra-ui/utils Minor
@chakra-ui/props-docs Patch
@chakra-ui/accordion Patch
@chakra-ui/alert Patch
@chakra-ui/avatar Patch
@chakra-ui/breadcrumb Patch
@chakra-ui/button Patch
@chakra-ui/checkbox Patch
@chakra-ui/close-button Patch
@chakra-ui/control-box Patch
@chakra-ui/editable Patch
@chakra-ui/form-control Patch
@chakra-ui/icon Patch
@chakra-ui/icons Patch
@chakra-ui/image Patch
@chakra-ui/input Patch
@chakra-ui/layout Patch
@chakra-ui/media-query Patch
@chakra-ui/modal Patch
@chakra-ui/number-input Patch
@chakra-ui/pin-input Patch
@chakra-ui/progress Patch
@chakra-ui/radio Patch
@chakra-ui/react Patch
@chakra-ui/select Patch
@chakra-ui/skeleton Patch
@chakra-ui/skip-nav Patch
@chakra-ui/slider Patch
@chakra-ui/spinner Patch
@chakra-ui/stat Patch
@chakra-ui/switch Patch
@chakra-ui/table Patch
@chakra-ui/tabs Patch
@chakra-ui/tag Patch
@chakra-ui/textarea Patch
@chakra-ui/theme-tools Patch
@chakra-ui/toast Patch
@chakra-ui/visually-hidden Patch
@chakra-ui/docs Patch
@chakra-ui/clickable Patch
@chakra-ui/color-mode Patch
@chakra-ui/counter Patch
@chakra-ui/focus-lock Patch
@chakra-ui/hooks Patch
@chakra-ui/live-region Patch
@chakra-ui/portal Patch
@chakra-ui/transition Patch
@chakra-ui/test-utils Patch
@chakra-ui/descendant 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

@segunadebayo segunadebayo added Popper.js 🍿 Issue or PR related to Popper.js core team 🌼 This was created by the core team labels Mar 15, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 15, 2021

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 47e3d79:

Sandbox Source
create-react-app-ts Configuration
exciting-snyder-o8bms Issue #3433

Callum Mellor-Reed added 4 commits March 16, 2021 14:21
Remove generic string type in system and styled-system which conflicts
with the generated textStyles type
… config

This config is only consumed by extractPropertyPath, which we don't use
for layerStyles or textStyles theme generation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core team 🌼 This was created by the core team Popper.js 🍿 Issue or PR related to Popper.js
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect MenuList positioning before first open
3 participants