Skip to content

Remove encoding library bloat in @hamony-js/staking JavaScript SDK #108

@klngrs

Description

@klngrs

When analyzing a recent build, I noticed that @harmony-js/staking is causing my bundle size to blow up due to the use of "text-encoding", which is now a deprecated library.

image

Reference:

import { TextEncoder } from 'text-encoding';

  1. I searched @harmony-js and it appears this library is only used in the staking sdk: https://github.com/harmony-one/sdk/search?q=%22text-encoding%22
  2. It looks like harmony is only using the UTF-8 encoder, since that's the default if no params are passed.
    https://github.com/harmony-one/sdk/blob/master/packages/harmony-staking/src/stakingTransaction.ts#L324

Given the above, I'd like to propose a leaner / tree-shakeable alternative to the deprecated "text-encoding"

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