Skip to content

Commit 6fd0793

Browse files
committed
update framer-motion to 4.0.0
1 parent b97a940 commit 6fd0793

File tree

7 files changed

+49
-50
lines changed

7 files changed

+49
-50
lines changed

gatsby-browser.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ import "src/styles/tailwind-utils.css"
2020

2121
import * as React from 'react'
2222
import Layout from 'src/components/Layout'
23-
import {
24-
MotionConfig,
25-
AnimationFeature,
26-
} from "framer-motion"
2723
import { Provider } from "jotai"
2824
import { MDXProvider } from "@mdx-js/react"
2925
import { YouTube } from 'mdx-embed'
@@ -47,9 +43,7 @@ const wrapRootElement = ({ element }) => {
4743
return (
4844
<MDXProvider components={components}>
4945
<Provider>
50-
<MotionConfig features={[AnimationFeature]}>
51-
{element}
52-
</MotionConfig>
46+
{element}
5347
</Provider>
5448
</MDXProvider>
5549
)

gatsby-ssr.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
// You can delete this file if you're not using it
88
import * as React from 'react'
99
import Layout from 'src/components/Layout'
10-
import {
11-
MotionConfig,
12-
AnimationFeature,
13-
} from "framer-motion"
1410
import { Provider } from "jotai"
1511
import { MDXProvider } from "@mdx-js/react"
1612
import { YouTube } from 'mdx-embed'
@@ -29,9 +25,7 @@ const wrapRootElement = ({ element }) => {
2925
return (
3026
<MDXProvider components={components}>
3127
<Provider>
32-
<MotionConfig features={[AnimationFeature]}>
33-
{element}
34-
</MotionConfig>
28+
{element}
3529
</Provider>
3630
</MDXProvider>
3731
)

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"fontsource-jost": "^4.0.0",
2020
"fontsource-noto-sans-jp": "^4.0.0",
2121
"fontsource-noto-serif-jp": "^4.0.0",
22-
"framer-motion": "^3.10.0",
22+
"framer-motion": "^4.0.0",
2323
"gatsby": "^3.1.0",
2424
"gatsby-plugin-draft": "^0.1.0",
2525
"gatsby-plugin-feed": "^3.1.0",
@@ -101,7 +101,7 @@
101101
"url": "git+https://github.com/dowdiness/yowai-zine.git"
102102
},
103103
"scripts": {
104-
"build": "GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES=false gatsby build --log-pages",
104+
"build": "gatsby build --log-pages",
105105
"develop": "gatsby develop",
106106
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
107107
"start": "npm run develop",

src/__generated__/gatsby-types.ts

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Layout/domAnimation.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { domAnimation } from 'framer-motion'
2+
export default domAnimation

src/components/Layout/index.tsx

+21-17
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import loadable from '@loadable/component'
66
// @ts-ignore
77
import ErrorBoundary from 'src/components/Element/ErrorBoundary'
88

9-
import { m as motion, useViewportScroll, useTransform } from 'framer-motion'
9+
import { m as motion, useViewportScroll, useTransform, LazyMotion } from 'framer-motion'
1010
import useMouse from 'src/hooks/useMouse'
1111

1212
const AudioModal = loadable(() => import('src/components/AudioPlayer/Audio'))
1313

14+
const loadFeatures = () => import('./domAnimation').then(res => res.default)
15+
1416
type LayoutProps = {
1517
location: Location
1618
}
@@ -22,23 +24,25 @@ const Layout: React.FC<LayoutProps> = ({ children, location }) => {
2224

2325
return (
2426
<ErrorBoundary>
25-
<div
26-
className="container"
27-
>
28-
{/* <Header className="container fixed inset-x-0 top-0 z-40" location={location} /> */}
29-
<main>{children}</main>
30-
<Footer className="z-40 py-16" />
31-
<motion.div
32-
className="fixed top-0 right-0 z-50 w-2 h-screen bg-blue-600"
33-
style={{ scaleY: multipleScaleY, translateY: '-50%' }}
27+
<LazyMotion strict features={loadFeatures}>
28+
<div
29+
className="container"
30+
>
31+
{/* <Header className="container fixed inset-x-0 top-0 z-40" location={location} /> */}
32+
<main>{children}</main>
33+
<Footer className="z-40 py-16" />
34+
<motion.div
35+
className="fixed top-0 right-0 z-50 w-2 h-screen bg-blue-600"
36+
style={{ scaleY: multipleScaleY, translateY: '-50%' }}
37+
/>
38+
</div>
39+
<div
40+
ref={mouse.cursorRef}
41+
id="cursor"
42+
className={`fixed top-0 left-0 z-20 pointer-events-none hidden sm:block`}
3443
/>
35-
</div>
36-
<div
37-
ref={mouse.cursorRef}
38-
id="cursor"
39-
className={`fixed top-0 left-0 z-20 pointer-events-none hidden sm:block`}
40-
/>
41-
<AudioModal />
44+
<AudioModal />
45+
</LazyMotion>
4246
</ErrorBoundary>
4347
)
4448
}

yarn.lock

+10-5
Original file line numberDiff line numberDiff line change
@@ -6785,16 +6785,16 @@ fragment-cache@^0.2.1:
67856785
dependencies:
67866786
map-cache "^0.2.2"
67876787

6788-
framer-motion@^3.10.0:
6789-
version "3.10.0"
6790-
resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-3.10.0.tgz#3840612b754aaab6b7857096d7473521b7e3436e"
6791-
integrity sha512-i+Pp3bwMGHFZw3OnsMJGWeAxlAg6ye6Hbek3xRuoCmGjpOQrGKG7Ra249YFAk32wMSwmAbGUzxTE1fgP3ZOmnQ==
6788+
framer-motion@^4.0.0:
6789+
version "4.0.0"
6790+
resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-4.0.0.tgz#3eab6d79e9a662ed8dfcfd05e680ba3a6b841672"
6791+
integrity sha512-j7lPnXEZdpkAelLRU8FhaZC3UbqnZwSTT/W9rSRwb3cKX4eWrekakK86cVkUE79v1HRE9IPzdPVNP9/e8CPRag==
67926792
dependencies:
67936793
framesync "5.2.0"
67946794
hey-listen "^1.0.8"
67956795
popmotion "9.3.1"
67966796
style-value-types "4.1.1"
6797-
tslib "^1.10.0"
6797+
tslib "^2.1.0"
67986798
optionalDependencies:
67996799
"@emotion/is-prop-valid" "^0.8.2"
68006800

@@ -15016,6 +15016,11 @@ tslib@^2.0.0, tslib@~2.0.0, tslib@~2.0.1:
1501615016
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c"
1501715017
integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==
1501815018

15019+
tslib@^2.1.0:
15020+
version "2.1.0"
15021+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a"
15022+
integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==
15023+
1501915024
tsutils@^3.17.1:
1502015025
version "3.17.1"
1502115026
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"

0 commit comments

Comments
 (0)