Skip to content

v0.5.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 10 Nov 12:20
· 32 commits to main since this release
v0.5.0
b1574fe
  • BREAKING CHANGES: require TypeScript 5.7 or above

    JavaScript has two buffer types: ArrayBuffer and SharedArrayBuffer.
    Before ES2024, TypeScript treated them as a single type.
    ES2024 introduced distinct features for ArrayBuffer and SharedArrayBuffer.
    To take this divergence into account, TypeScript 5.7 added a generic parameter to buffer views.
    By default, it is set to ArrayBufferLike that is a supertype to ArrayBuffer and SharedArrayBuffer.
    This change is backward compatible.

    TypeScript 5.9 went beyond and introduced a breaking change:
    Buffer's views no longer extend ArrayBuffer.
    Moreover, ArrayBufferLike cannot be assigned to ArrayBuffer.

    To accommodate with this change, all BARE read functions now return a view parametrized with ArrayBuffer.
    For example, readU8Array returns Uint8Array<ArrayBuffer>.
    Because we now use parametrized views like Uint8Array<ArrayBuffer>, you have to use TypeScript 5.7 or above.

    BARE write functions still accept view with any buffer types.

  • Export the default bare configuration

    import * as bare from "@bare-ts/lib"
    
    const config: bare.Config = bare.DEFAULT_CONFIG
  • Support require(esm) in Node.js v22.10 and above

    This package now has the new exports condition module-sync.
    It allows users of Node.js v22.10 and above to import the ESM version of the package using require.
    It avoids the issues of dual-package hazard.

  • Remove package.json main and module fields

    The main and module fields supplemented by the exports fields.
    exports is supported since Node.js v12.7.0
    Since we require a version above, we can safely remove main.

    All major bundlers now support exports.
    Hence, we can also remove the module field.