Skip to content

Consider using @overeng/effect-utils for shared browser utilities #964

@schickling

Description

@schickling

Summary

We've been porting several utilities from this repository into @overeng/effect-utils, an Effect-first utilities package. These utilities are now available with full Effect integration and typed errors.

Ported Utilities

The following utilities from @livestore/utils and @livestore/adapter-web have been ported:

Browser Utilities (@overeng/utils/browser)

Original Location Ported As Description
adapter-web/src/opfs-utils.ts OPFS.* OPFS utilities with Effect-wrapped errors
utils/src/browser.ts detectBrowserName(), isBrowser() Browser detection
utils/src/effect/WebLock.ts WebLock.* Web Locks API with Effect integration
utils/src/base64.ts base64.* Base64 encode/decode

Isomorphic Utilities (@overeng/utils)

Original Location Ported As Description
utils/src/guards.ts isNotNull, isNil, isNotNil, etc. Type guards
utils/src/effect/Error.ts UnknownError Generic tagged error
utils/src/misc.ts prettyBytes Byte formatting

Improvements in the Port

  • Full Effect integration: All async operations wrapped in Effect.Effect with typed errors
  • Schema.TaggedError: Proper error classes (OPFSNotSupportedError, OPFSError, WebLockNotSupportedError, UnknownError)
  • Environment guards: Safe checks for navigator.storage, navigator.locks, etc.
  • TypeScript strict mode: Compatible with exactOptionalPropertyTypes, noUncheckedIndexedAccess

Proposal

Would you be interested in:

  1. Option A: Adding @overeng/utils as a dependency and re-exporting from @livestore/utils
  2. Option B: Adding as a git submodule for more control
  3. Option C: Collaborating on a shared utilities package

This could reduce maintenance burden and allow both projects to benefit from improvements.

Links


This issue was created on behalf of @schickling by Claude Code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions