Skip to content

Commit

Permalink
Fix/elapsed time (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbismut authored Mar 27, 2023
1 parent d9474c9 commit 3701753
Show file tree
Hide file tree
Showing 11 changed files with 4,996 additions and 8,545 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-avocados-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@use-gesture/core': patch
---

fix: set startTime inside start function
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<body>
<div id="root"></div>
<script type="module" src="./src/index.jsx"></script>
<script type="module" src="./src/index.tsx"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/screenlog.min.js"></script>
</body>
</html>
12 changes: 6 additions & 6 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"scripts": {
"dev": "vite --port 4000 --host",
"build": "vite build",
"serve": "vite preview"
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@leva-ui/plugin-spring": "*",
Expand All @@ -29,9 +29,9 @@
"@types/react": "^18.0.24",
"@types/react-dom": "^18.0.8",
"@types/three": "^0.140.0",
"@vitejs/plugin-react": "^1.3.2",
"typescript": "^4.8.4",
"typescript-plugin-css-modules": "^4.1.1",
"vite": "^4.0.3"
"@vitejs/plugin-react": "^3.1.0",
"typescript": "^4.9.4",
"typescript-plugin-css-modules": "^5.0.0",
"vite": "^4.2.1"
}
}
3 changes: 0 additions & 3 deletions demo/serve.json

This file was deleted.

2 changes: 1 addition & 1 deletion demo/src/index.jsx → demo/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import './index.css'
// window.screenLog.init()

const rootElement = document.getElementById('root')
const root = createRoot(rootElement)
const root = createRoot(rootElement!)
root.render(
<React.StrictMode>
<App />
Expand Down
1 change: 1 addition & 0 deletions demo/src/vite.env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
12 changes: 6 additions & 6 deletions demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"types": ["vite/client"],
"allowJs": true,
"skipLibCheck": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "node",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"jsx": "react-jsx",
"plugins": [{ "name": "typescript-plugin-css-modules" }]
},
"include": ["./src"]
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
9 changes: 9 additions & 0 deletions demo/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@changesets/cli": "^2.26.0",
"@preconstruct/cli": "^2.3.0",
"@changesets/cli": "^2.26.1",
"@preconstruct/cli": "^2.4.1",
"@size-limit/preset-small-lib": "^7.0.8",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.2.0",
Expand All @@ -99,7 +99,7 @@
"eslint-plugin-testing-library": "^5.10.0",
"husky": "^8.0.3",
"jest": "^27.5.1",
"pnpm": "^7.26.1",
"pnpm": "^7.30.3",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.8.3",
"pretty-quick": "^3.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/engines/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ export abstract class Engine<Key extends GestureKey> {
state.currentTarget = event.currentTarget!
state.lastOffset = config.from ? call(config.from, state) : state.offset
state.offset = state.lastOffset
state.startTime = state.timeStamp = event.timeStamp
}
state.startTime = state.timeStamp = event.timeStamp
}

/**
Expand Down
Loading

0 comments on commit 3701753

Please sign in to comment.