hashgraph / hedera-sdk-js

Hedera™ Hashgraph SDK for JavaScript/TypeScript
https://docs.hedera.com/guides/docs/sdks
Apache License 2.0
253 stars 131 forks source link

chore: update long to v5.x #2322

Open mehcode opened 3 weeks ago

mehcode commented 3 weeks ago

Long v5 is very old (2+ years) at this point. There are no breaking changes from v4. The primary change is using an ESM module style compared to CommonJS.

If you'll look at the diff of this PR, the Hedera SDK already depended on Long v5 and generated code for Long v5 via ProtobufJS but implicitly casted the Long v5 type to Long v4 when presenting it the consumers of the SDK. This is effectively a bug fix.

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

svetoslav-nikol0v commented 3 weeks ago

Hello mehcode, What do you mean by This is effectively a bug fix? Is there an actual bug caused by Long v4?

mehcode commented 3 weeks ago

The Hashgraph SDK does not actually use Long v4. The primary usage comes from generated code from ProtobufJS. The ProtobufJS library uses Long v5. This only works right now because there are no breaking changes from v4 to v5. It's still technically a bug because the Hashgraph SDK is misrepresenting an object created with Long v5 (inside of code generated by ProtobufJS) as Long v4.