Closed steveluscher closed 4 months ago
Rebased on top of @Nesopie's ESM changes. Let's get this in!
You don’t feel like backporting this to bs58 version 4.x, do you @junderw? There are reasons we can’t upgrade to v6 and have to stay on 4.x.
Give me a list of commands to backport and publish all these backports without updating the npm latest tag for everything, and I'll consider running those commands when I have free time.
It would probably take me a few minutes to find everything, cherry-pick, push a branch for previous major version(s) push a tag to Github, publish to npm under a new non-latest tag etc. And then I would need to do the same for bs58 and bump the dependency etc.
Probably about 15-20 minutes of work depending on how much I can concentrate without messing up.
But if you give me a list of commands and I can check that they're sane, running them would be a few seconds.
Assuming base-x and bs58 are sibling directories and these repos are origin
remotes is fine.
For sure!
# Rewind to base-x@3.0.9
cd base-x
git checkout v3.0.9
git clean -dfx .
npm i
# Backport change, build, and test
git cherry-pick 261fb3636147815a7705375cfe7c1217db15e8f5
rm -rf src
npm run build
git add -A
git cherry-pick --continue --no-edit
npm run test
# Publish base-x@3.0.10
npm version 3.0.10 # automatically adds the git tag v3.0.10
npm publish --tag bp # avoids updating the latest tag on npm
npm dist-tag rm base-x bp # deletes the temporary npm tag we just created
# Create a backport branch for posterity and push the whole thing to Github
git checkout -b v3.x
git push origin v3.x # the branch
git push origin v3.0.10 # the tag
That's it. bs58@4.0.1
will pick up this new version by virtue of it depending on base-x@^3.0.2
. No need to backport anything to bs58
.
ok, should be published.
Thank you!
This yields a performance improvement over indexing into
source
over and over.source
is asserted to be a string,psz
is monotonically increasing, andpsz >= source.length
is a good indication that you've run out of characters.Originally proposed by @oscxc in #74.
Benchmarks
Before
After