-
-
Notifications
You must be signed in to change notification settings - Fork 865
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor to DOM package * Refactor * Latest * v11.13.0-beta.0 * Skip check * Fixing size measurement * Latest * Fixing publish command * Latest * Fixing test * Fixing test * Removing unused test * Latest * Adding playwright suite * Updating docker image for playwright * Updating * Latest * Adding config * Running yarn install * Attempting to install make * Make bundlesize optional dep * Fixing lockfile * Replacing bundlesize * Fixing * Skip test on CI * Adding hover
- Loading branch information
1 parent
f12b84d
commit d97b58f
Showing
136 changed files
with
1,069 additions
and
936 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,8 @@ yarn-error.log | |
.next | ||
stats.html | ||
|
||
lerna-debug.log | ||
lerna-debug.log | ||
|
||
playwright-report | ||
test-results | ||
test_results |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-3.53 KB
.yarn/cache/decompress-response-npm-4.2.1-abe5b4ebe4-4e783ca4df.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-5.09 KB
.yarn/cache/github-from-package-npm-0.0.0-519f80c9a1-14e448192a.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<html> | ||
<head> | ||
<style> | ||
body { | ||
margin: 0; | ||
} | ||
|
||
.box { | ||
width: 100px; | ||
height: 100px; | ||
background-color: #0077ff; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="box" id="hover">test</div> | ||
<div class="box" id="multi">multi</div> | ||
<div class="box" id="once">once</div> | ||
<script type="module" src="/src/inc.js"></script> | ||
<script type="module"> | ||
const { hover } = window.MotionDOM | ||
|
||
hover("#hover", ({ currentTarget }) => { | ||
currentTarget.innerHTML = "start" | ||
|
||
return () => { | ||
currentTarget.innerHTML = "end" | ||
} | ||
}) | ||
|
||
let multiCount = 0 | ||
hover("#multi", ({ currentTarget }) => { | ||
currentTarget.innerHTML = multiCount | ||
multiCount++ | ||
|
||
return () => { | ||
currentTarget.innerHTML = multiCount | ||
multiCount++ | ||
} | ||
}) | ||
|
||
let onceCount = 0 | ||
hover( | ||
"#once", | ||
({ currentTarget }) => { | ||
currentTarget.innerHTML = onceCount | ||
onceCount++ | ||
|
||
return () => { | ||
currentTarget.innerHTML = onceCount | ||
onceCount++ | ||
} | ||
}, | ||
{ once: true } | ||
) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as MotionDOM from "motion-dom" | ||
|
||
window.MotionDOM = MotionDOM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import fs from "fs" | ||
import path from "path" | ||
|
||
const packagePath = path.join( | ||
process.cwd(), | ||
"packages/framer-motion/package.json" | ||
) | ||
const pkg = JSON.parse(fs.readFileSync(packagePath, "utf8")) | ||
|
||
if (!pkg.bundlesize) { | ||
console.log("No bundlesize configuration found") | ||
process.exit(0) | ||
} | ||
|
||
let hasFailures = false | ||
|
||
pkg.bundlesize.forEach(async ({ path: filePath, maxSize }) => { | ||
const fullPath = path.join( | ||
process.cwd(), | ||
"packages/framer-motion", | ||
filePath | ||
) | ||
|
||
if (!fs.existsSync(fullPath)) { | ||
console.error(`❌ File not found: ${filePath}`) | ||
hasFailures = true | ||
return | ||
} | ||
|
||
// Create gzipped version of file | ||
const fileContent = fs.readFileSync(fullPath) | ||
const gzipped = await import("zlib").then((zlib) => { | ||
return new Promise((resolve, reject) => { | ||
zlib.gzip(fileContent, (error, result) => { | ||
if (error) reject(error) | ||
else resolve(result) | ||
}) | ||
}) | ||
}) | ||
|
||
const gzippedSize = gzipped.length | ||
const maxBytes = parseFloat(maxSize) * 1024 | ||
const gzippedSizeKb = (gzippedSize / 1024).toFixed(2) | ||
|
||
if (gzippedSize > maxBytes) { | ||
console.error( | ||
`❌ ${filePath} is ${gzippedSizeKb} kB (${maxSize} allowed)` | ||
) | ||
hasFailures = true | ||
} else { | ||
console.log( | ||
`✅ ${filePath} is ${gzippedSizeKb} kB (${maxSize} allowed)` | ||
) | ||
} | ||
}) | ||
|
||
if (hasFailures) { | ||
process.exit(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,23 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": [ | ||
"dom", | ||
"dom.iterable", | ||
"esnext" | ||
], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": false, | ||
"noEmit": true, | ||
"incremental": true, | ||
"module": "esnext", | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve", | ||
"plugins": [ | ||
{ | ||
"name": "next" | ||
} | ||
] | ||
}, | ||
"include": [ | ||
"next-env.d.ts", | ||
".next/types/**/*.ts", | ||
"**/*.ts", | ||
"**/*.tsx" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
"compilerOptions": { | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": false, | ||
"noEmit": true, | ||
"incremental": true, | ||
"module": "esnext", | ||
"esModuleInterop": true, | ||
"moduleResolution": "bundler", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve", | ||
"plugins": [ | ||
{ | ||
"name": "next" | ||
} | ||
] | ||
}, | ||
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"], | ||
"exclude": ["node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"module": "ESNext", | ||
"skipLibCheck": true, | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"module": "esnext", | ||
"skipLibCheck": true, | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "react-jsx", | ||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "react-jsx", | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"include": ["src"], | ||
"references": [{ "path": "./tsconfig.node.json" }] | ||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"include": ["src"], | ||
"references": [{ "path": "./tsconfig.node.json" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"skipLibCheck": true, | ||
"module": "ESNext", | ||
"moduleResolution": "bundler", | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true | ||
}, | ||
"include": ["vite.config.ts"] | ||
"compilerOptions": { | ||
"composite": true, | ||
"skipLibCheck": true, | ||
"module": "esnext", | ||
"moduleResolution": "bundler", | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true | ||
}, | ||
"include": ["vite.config.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{ | ||
"version": "11.12.0", | ||
"packages": [ | ||
"packages/*", | ||
"dev/*" | ||
], | ||
"npmClient": "yarn", | ||
"useWorkspaces": true | ||
} | ||
"version": "11.13.0-beta.0", | ||
"packages": [ | ||
"packages/*", | ||
"dev/*" | ||
], | ||
"npmClient": "yarn" | ||
} |
Oops, something went wrong.