hashicorp / react-components

A set of HashiCorp branded react components currently maintained and used by the marketing dev team
https://react-components.vercel.app
Mozilla Public License 2.0
60 stars 17 forks source link

chore(deps): Bump `framer-motion` #1002

Closed nandereck closed 1 year ago

nandereck commented 1 year ago

Reference

Description

We are currently using an old version of framer-motion. The most recent version offers new, useful functionality. This PR does several things:

MotionConfig features

MotionConfig is used across our properties and it allows us to reduce our bundle size by lazy loading specific framer-motion features. Previously, we hand-picked features to load but it looks like this is no longer supported. This PR updates MotionConfig to use domMax instead of hand-picked features. When this change was tested before, I believe the difference in bundle size was pretty small (which was the reason why we hand-picked features initially).

Validation Steps

In order to test this change, I've created a PR in web that bumps framer-motion and uses the canary releases for these components.

Home

COM

Terraform Overview

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 8c921574a9434062eb8e22493aa782c4730af309

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

This PR includes changesets to release 2 packages | Name | Type | | ------------------------------ | ----- | | @hashicorp/react-motion-config | Minor | | @hashicorp/react-notification | Minor |

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[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2023 6:50pm
github-actions[bot] commented 1 year ago

:package: Canary Packages Published

Latest commit: 8c921574a9434062eb8e22493aa782c4730af309

Published 2 packages #### @hashicorp/react-motion-config@0.4.0-canary-20230927184943 ``` npm install @hashicorp/react-motion-config@canary ``` #### @hashicorp/react-notification@0.6.0-canary-20230927184943 ``` npm install @hashicorp/react-notification@canary ```
nandereck commented 1 year ago

@dstaley - mind taking a look at this PR? I think I have all my bases covered but would love for someone to poke holes in this. We paired on this awhile back but I put it down when higher priority work came up.

Beyond a general review, two specific things come to mind that I'd love feedback on:

dstaley commented 1 year ago

One other instance I know we're using framer-motion is in the notifications for the localized site redirects. You should be able to trigger them by setting your browser's language to Spanish/French/Japanese (such that console.log(navigator.languages) returns an array where the first element contains es/fr/ja). I think that one relied on layout animations, so it'd be a good test case to ensure this change works as expected.