Releases: RyanMyrvold/Performance-Decorators
Releases · RyanMyrvold/Performance-Decorators
3.0.4
Full Changelog: 3.0.2...3.0.4
3.0.2
Full Changelog: 3.0.1...3.0.2
3.0.1
Full Changelog: 2.9.5...3.0.1
2.9.5
- Added
loadAsyncLocalStoragefunction to conditionally loadAsyncLocalStoragein Node environment. - Integrated
AsyncLocalStorageto store and retrieve request context during network requests.
Full Changelog: 2.9.4...2.9.5
2.9.4
Full Changelog: 2.9.3...2.9.4
2.9.3
Release Notes - October 17, 2024
Refactored LogNetworkRequests Decorator
- Removed global
fetchreplacement to eliminate race conditions when running multiple async functions concurrently. - Introduced a scoped
fetchWrapperto inject the wrapped fetch into the decorated method context, ensuring independent logging for each function. - Enhanced error handling to ensure fetch unavailability is managed gracefully, with appropriate warnings.
What's Changed
- Bump @types/node from 22.7.0 to 22.7.3 by @dependabot in #110
- Restyle Update README.md by @restyled-io in #113
- Update README.md by @RyanMyrvold in #112
- Bump @types/node from 22.7.3 to 22.7.4 by @dependabot in #111
- Bump @types/node from 22.7.4 to 22.7.5 by @dependabot in #114
- Bump typescript from 5.6.2 to 5.6.3 by @dependabot in #115
Full Changelog: 2.9.2...2.9.3
2.9.2
What's Changed
- Bump @types/node from 22.5.1 to 22.7.0 by @dependabot in #108
- Bump @types/jest from 29.5.12 to 29.5.13 by @dependabot in #105
- Bump typescript from 5.5.4 to 5.6.2 by @dependabot in #104
Full Changelog: 2.9.1...2.9.2
2.9.1
What's Changed
- Bump @types/node from 22.5.0 to 22.5.1 by @dependabot in #100
Full Changelog: 2.9.0...2.9.1
2.9.0
What's Changed
- Bump ts-jest from 29.2.2 to 29.2.5 by @dependabot in #99
- Bump typescript from 5.5.3 to 5.5.4 by @dependabot in #89
- Bump @types/node from 20.14.10 to 22.5.0 by @dependabot in #98
Full Changelog: 2.8.0...2.9.0
2.8.0
2.8.0
New Feature: LogReturnValue Decorator
Overview:
- The
LogReturnValuedecorator has been added to the Performance Decorators toolkit. This decorator logs the return value of a method each time it is called, making it easier to verify that methods return the expected results and aiding in the debugging process.
Key Features:
-
Return Value Logging:
- Automatically logs the return value of any method it is applied to, providing immediate feedback on method outputs.
-
Custom Logging Function:
- Supports a custom logging function, allowing users to define how the return values are logged.
-
Async and Sync Support:
- Works with both synchronous and asynchronous methods, ensuring that return values from Promises are also logged.
Usage Example:
import LogReturnValue from "performance-decorators/debugging";
class ExampleService {
@LogReturnValue()
calculateSum(a: number, b: number): number {
return a + b;
}
@LogReturnValue((value, methodName) => console.log(`[${methodName}] returned:`, value))
async fetchData(url: string): Promise<any> {
const response = await fetch(url);
return response.json();
}
}
const service = new ExampleService();
console.log(service.calculateSum(3, 4)); // Logs and returns 7
service.fetchData('https://api.example.com/data'); // Logs the returned JSON dataFull Changelog: 2.7.0...2.8.0