internetarchive / dweb-mirror

Offline Internet Archive project
https://www-dweb-mirror.dev.archive.org/
GNU Affero General Public License v3.0
256 stars 27 forks source link

Meta issue for upgrading to latest version of packages #374

Open mitra42 opened 1 year ago

mitra42 commented 1 year ago

These are known problems with current versions as of 2022-1-17 (includes all comments till that date)

[ ] @internetarchive/bookreader v5 seems to be substantially different and fails with a lot of React errors [ ] sharp 0.31.3 had problems loading - I've seen these elsewhere and may be a node version issue but 0.31.2 is fine [ ] level 8.x has major changes from 5.x and its unclear the value of upgrading [ ] Using current @internetarchive/dweb-archive-dist but that will have dependencies [ ] Using current @internetarchive/dweb-archivecontroller but that will have dependencies [ ] Using current @internetarchive/dweb-transports but that will have dependencies

mitra42 commented 1 year ago

Fixed update to async3 - two breaking changes in queue.drain and "until" see https://github.com/caolan/async/blob/master/CHANGELOG.md

mitra42 commented 1 year ago

Sharp 0.31.3 works as long as node is at least v14 (Macs are v18 at this point)

mitra42 commented 1 year ago

Looks like sharp 0.31.3 is a problem, going back to 0.31.2 and not sure of any reason to push this - maybe fixed in later version.

mitra42 commented 1 year ago

The code in Hashstore.js is based on level 5, there are major API level differences with level 8 see https://github.com/Level/level/blob/master/UPGRADING.md The changes should be contained to Hashstore.js, but might not be trivial and its unclear what if any value would be gained. This is left to a future exercise.

mitra42 commented 1 year ago

multihashes 0.4.x -> 4.x significant changes which may or may not break things - esp using Uint8 instead of Buffer. It seems to work. It is used in one line only, in MirrorFS.js

function multihash58sha1(buf) { return multihashes.toB58String(multihashes.encode(buf, 'sha1')); }

This appears to work, so upgrading, but may role back if issues.

mitra42 commented 1 year ago

Note that readable-stream was upgraded from v3.4.0 to v4.3.0 which has breaking changes as it matches that in node, but because require('stream').Transform is running in node, readable-stream isnt actually used. If it run into problems maybe need to revert.