Problem or motivation
asyncStorageScope.ts imports node:async_hooks unconditionally:
https://github.com/HugoRCD/evlog/blob/main/packages/evlog/src/shared/asyncStorageScope.ts
This means the dependency gets pulled into the bundle even for consumers who don't use the async-storage-scope feature. In environments like Cloudflare Workers, this forces the nodejs_compat compatibility flag to be enabled, even when nothing in the app actually relies on it.
Proposed feature
Node-dependent features (like async_hooks) should be exported from a separate entry point, rather than bundled with the core package. This way, consumers who don't need those features aren't forced to pull in Node-specific dependencies or enable compatibility flags for runtimes that don't support them.
Possible implementation (optional)
No response
Alternatives you’ve considered (optional)
No response
Problem or motivation
asyncStorageScope.tsimportsnode:async_hooksunconditionally:https://github.com/HugoRCD/evlog/blob/main/packages/evlog/src/shared/asyncStorageScope.ts
This means the dependency gets pulled into the bundle even for consumers who don't use the async-storage-scope feature. In environments like Cloudflare Workers, this forces the
nodejs_compatcompatibility flag to be enabled, even when nothing in the app actually relies on it.Proposed feature
Node-dependent features (like
async_hooks) should be exported from a separate entry point, rather than bundled with the core package. This way, consumers who don't need those features aren't forced to pull in Node-specific dependencies or enable compatibility flags for runtimes that don't support them.Possible implementation (optional)
No response
Alternatives you’ve considered (optional)
No response