Earn 7.0% APY staking with Solana Compass
Help decentralize and secure the Solana network delegating your stake to us and earn an impressive 7.0% APY yield on your SOL, while supporting us to create new guides and tools. Learn more
Earn 7.0% APY staking with Solana Compass
Help decentralize and secure the Solana network delegating your stake to us and earn an impressive 7.0% APY yield on your SOL, while supporting us to create new guides and tools.
Breakpoint 2023: Introducing the New Web3.js
Steven Luscher presents the new Web3.js with enhanced features and performance improvements.
The New Web3.js: A Healthier Option for Developers
Comparing the new API to vegetables, Steven highlighted the importance of creating an API that is robust and sustainable in the long run. The aim for the new Web3.js is to deliver a library that promotes best practices, leading to more stable and successful applications without the common pitfalls of overly sugary APIs that can lead to technical debt and performance issues.
The Demand for a Better Web3.js
Performance Improvements and Reductions in Library Size
There have been significant improvements in the performance and size of the new Web3.js. The library has been reduced in size by as much as 14 times in typical applications, making it efficient for web environments and mobile users who may experience poor connectivity. Performance metrics also showed notable speed improvements in transaction signing and block hash operations.
Technical Deep Dive: Subscription APIs, Keys, Transaction Builders, and TypeScript
Steven went into detail about several technical aspects of the new library, including a simpler and more efficient transport interface, a dynamic and slim RPC API, modern subscription APIs for better error handling and gap recovery, improvements to cryptographic key management, unified transaction building, and enhanced TypeScript support.
Facts + Figures
- The new Web3.js was described by Steven Luscher as being more like vegetables rather than candy; it aims for long-term developer success rather than short-term ease of use.
- Despite being downloaded 400,000 times a week, feedback indicated developers wanted more from the library.
- Size reductions in the new Web3.js have been substantial, with a full browser bundle dropping from 90 kilobytes in the old version to 33 kilobytes in the new, a 2.7 times improvement—and potentially down to 17 kilobytes for environments supporting ED25519 natively.
- An AWS service bundle for transaction handling was reduced in size from 5.4 megabytes in the old version to 1.7 megabytes with the new Web3.js.
- Solana's official explorer saw a 26% reduction in first-page load size after replacing the old Web3.js with the new.
- The RPC API of a new Web3.js is now TypeScript-based and can easily extend to support additional RPC methods.
- Transaction builders unify legacy and version transactions into a single, more efficient class.
- TypeScript integration ensures developers catch errors early in the development process, reducing runtime errors.
- "I like to think of the new Web3JS API as more like vegetables. You eat them, you chew on them, they sharpen your teeth."
- "Folks from Mango told us, Steve, your transaction confirmation strategy just doesn't work for us. We need something different."
- "For the past six months or so, me and this crack team of developers... have been working on a new version of Web3JS."
- "Just migrating to the new Web3JS let you throw out a quarter of the code."
- "Keys now are based on native JS crypto keys."
- "We want to offer you APIs that are closer to your customers' desires."
- "Tell us if you find something broken. Tell us if we missed including something."
- "Solana FM, get at me. And let's get this done."
What is Web3.js?
Why was a new version of Web3.js necessary?
How does the new Web3.js improve performance and size?
The new Web3.js improves performance by facilitating faster transactions, reduced latency, and a higher rate of operations per second. It reduces size by implementing tree shaking, which means projects only include the code they actually use, significantly slimming down the library footprint.
What are some of the technical improvements in the new Web3.js?
How does the new Web3.js leverage TypeScript to benefit developers?
The new Web3.js leverages TypeScript to help developers catch errors during the coding phase rather than in production, reducing runtime errors and ensuring a smoother development process and more reliable end-user experience.
- Key Points:
- Facts + Figures
- Top quotes
- Questions Answered