Skip to content

Commit 57e6b26

Browse files
committed
fix: updates
1 parent aaa85d0 commit 57e6b26

17 files changed

Lines changed: 352 additions & 312 deletions

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
.eslintcache
1313
.fusebox/
1414
.grunt
15+
.lake/
1516
.lock-wscript
1617
.next
1718
.node_repl_history
@@ -59,4 +60,5 @@ pids
5960
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
6061
web_modules/
6162
yarn-debug.log*
62-
yarn-error.log*
63+
yarn-error.log*
64+
.firecrawl/

.syncpackrc.json

Lines changed: 0 additions & 52 deletions
This file was deleted.

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,20 @@ Each example demonstrates different aspects of snaproll:
311311
- Performance optimization techniques
312312
- Multiple subscription management
313313

314+
## Timing precision and HTTP headers
315+
316+
For higher timer precision in simulation or measurement workloads, configure the top-level response with:
317+
318+
```http
319+
Cross-Origin-Opener-Policy: same-origin
320+
Cross-Origin-Embedder-Policy: require-corp
321+
```
322+
323+
`Cross-Origin-Embedder-Policy: credentialless` is a possible alternative in some deployments, but support is not universal (notably unavailable in Safari and Safari on iOS).
324+
314325
## API
315326

316-
### class Snaproll [](src/snaproll.ts#L459-L699 'Snaproll')
327+
### class Snaproll [](src/snaproll.ts#L460-L700 'Snaproll')
317328

318329
Fixed-timestep animation loop with independent draw and update rates.
319330

@@ -493,7 +504,7 @@ Cancels any previous ongoing operation before starting a new one. Results are de
493504
trigger(): void;
494505
```
495506

496-
### enum SnaprollActionType [↗](src/snaproll.ts#L7-L11 'SnaprollActionType')
507+
### enum SnaprollActionType [↗](src/snaproll.ts#L8-L12 'SnaprollActionType')
497508

498509
Animation frame phases.
499510

@@ -509,7 +520,7 @@ export declare enum SnaprollActionType
509520
| `Update` | <pre>1</pre> |
510521
| `Draw` | <pre>2</pre> |
511522

512-
### interface SnaprollActionBegin [↗](src/snaproll.ts#L16-L20 'SnaprollActionBegin')
523+
### interface SnaprollActionBegin [↗](src/snaproll.ts#L17-L21 'SnaprollActionBegin')
513524

514525
Frame initialization action.
515526

@@ -525,7 +536,7 @@ Current frame time
525536
timestamp: number
526537
```
527538

528-
### interface SnaprollActionDraw [↗](src/snaproll.ts#L37-L41 'SnaprollActionDraw')
539+
### interface SnaprollActionDraw [↗](src/snaproll.ts#L38-L42 'SnaprollActionDraw')
529540

530541
Interpolated drawing action.
531542

@@ -541,7 +552,7 @@ Interpolation factor \[0, 1)
541552
alpha: number
542553
```
543554
544-
### interface SnaprollActionUpdate [↗](src/snaproll.ts#L26-L32 'SnaprollActionUpdate')
555+
### interface SnaprollActionUpdate [↗](src/snaproll.ts#L27-L33 'SnaprollActionUpdate')
545556
546557
Fixed timestep animation logic action. The updateStep counts down remaining updates in the current frame.
547558
@@ -633,7 +644,7 @@ Array of recommended draw rates (Hz), sorted descending and de-duplicated. All v
633644
values: number[];
634645
```
635646
636-
### interface SnaprollOptions [↗](src/snaproll.ts#L94-L110 'SnaprollOptions')
647+
### interface SnaprollOptions [↗](src/snaproll.ts#L95-L111 'SnaprollOptions')
637648
638649
Configuration interface for animation loop.
639650
@@ -669,7 +680,7 @@ Update rate in Hz, determines fixed timestep size.
669680
updateRate: number
670681
```
671682
672-
### interface SnaprollResetOptions [↗](src/snaproll.ts#L118-L145 'SnaprollResetOptions')
683+
### interface SnaprollResetOptions [↗](src/snaproll.ts#L119-L146 'SnaprollResetOptions')
673684
674685
Options accepted by [Snaproll.reset](#snaprollreset).
675686
@@ -714,7 +725,7 @@ Preserve existing subscription callbacks during reset.
714725
keepSubscriptions?: boolean;
715726
```
716727
717-
### interface SnaprollSubscriptionControls [↗](src/snaproll.ts#L62-L69 'SnaprollSubscriptionControls')
728+
### interface SnaprollSubscriptionControls [↗](src/snaproll.ts#L63-L70 'SnaprollSubscriptionControls')
718729
719730
Control interface for managing individual animation subscriptions.
720731
@@ -772,7 +783,7 @@ declare module 'snaproll' {
772783
}
773784
```
774785
775-
### type SnaprollContext [↗](src/snaproll.ts#L52-L53 'SnaprollContext')
786+
### type SnaprollContext [↗](src/snaproll.ts#L53-L54 'SnaprollContext')
776787
777788
Context object passed to subscription callbacks during animation frames.
778789
@@ -795,7 +806,7 @@ export type SnaprollDrawRateAdvisorSubscription = (
795806
) => void
796807
```
797808
798-
### type SnaprollSubscription [↗](src/snaproll.ts#L83 'SnaprollSubscription')
809+
### type SnaprollSubscription [↗](src/snaproll.ts#L84 'SnaprollSubscription')
799810
800811
Subscription callback function.
801812

examples/canvas-2d-bouncing-balls.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const setupCanvas = (): void => {
7272
7373
ctx = canvas.getContext('2d', {
7474
alpha: false,
75-
willReadFrequently: false
75+
willReadFrequently: false,
7676
})
7777
if (!ctx) return
7878

knip.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"ignoreBinaries": ["ncu", "taze"],
1818
"ignoreDependencies": [
1919
"@commitlint/cli",
20+
"@escapace/syncpack-configuration",
2021
"@microsoft/api-extractor",
2122
"@tweakpane/core",
2223
"eslint-config-escapace",

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,22 @@
1111
"@commitlint/cli": "20.4.2",
1212
"@commitlint/config-conventional": "20.4.2",
1313
"@escapace/pnpm-pack": "0.8.0",
14+
"@escapace/syncpack-configuration": "0.1.0",
1415
"@ls-lint/ls-lint": "2.3.1",
1516
"@tweakpane/core": "2.0.5",
1617
"@vitejs/plugin-vue": "6.0.4",
1718
"@vitest/coverage-v8": "4.0.18",
1819
"@vueuse/core": "14.2.1",
19-
"es-toolkit": "1.44.0",
20+
"es-toolkit": "1.45.0",
2021
"eslint": "9.39.3",
2122
"eslint-config-escapace": "5.14.0",
2223
"esroll": "1.1.5",
2324
"jsdom": "28.1.0",
2425
"knip": "5.85.0",
25-
"lefthook": "2.1.1",
26+
"lefthook": "2.1.2",
2627
"prettier": "3.8.1",
2728
"prettier-config-escapace": "1.2.2",
28-
"syncpack": "14.0.0",
29+
"syncpack": "14.0.1",
2930
"tsx": "4.21.0",
3031
"tweakpane": "4.0.5",
3132
"typescript": "5.9.3",
@@ -68,7 +69,7 @@
6869
"ls-lint": "ls-lint --config .ls-lint.yaml",
6970
"pack": "pnpm-pack package --pack-destination lib",
7071
"prepare": "lefthook install",
71-
"syncpack": "syncpack fix-mismatches && syncpack set-semver-ranges && syncpack format",
72+
"syncpack": "syncpack fix && syncpack format",
7273
"test": "vitest --no-watch --coverage",
7374
"typecheck": "tsc --noEmit",
7475
"update": "ncu --cooldown 7 -p pnpm -u --peer --dep dev,peer,prod,optional && pnpm run syncpack"

0 commit comments

Comments
 (0)