Comments (14)
So I repeated this. Here's an interesting result:
I'm seeing the dependencies of the torus
and blocto
wallet adapters, for example, but @solana/wallet-adapter-*
is missing from the node_modules
shown.
If I back out and click ".." on the right, I see:
This is showing a src
directory with .ts/.tsx files, not the JS files that are actually used in the build -- it must be using the sourcemap.
If I search the generated build/static/js
directory for "blocto", I see the Blocto SDK is being included -- but the blocto
package with the adapter is not. Same with "torus".
This indicates to me that the sub-dependencies of the adapters are being included, but the tree shaking is working for the adapters. I'll see what can be done to fix this.
from wallet-adapter.
Can you say more about your project environment and build setup? If your transpiler is set up for tree shaking, this shouldn't happen.
from wallet-adapter.
I'm new to react or js. So, can't answer that. Basically I cloned this repo and did
yarn install
yarn build
Then the build size in 13MB. I added GENERATE_SOURCEMAP=false
in build scripts to remove source map to reduce the size to 3MB.
Then I followed this to analyse the build. Attached analyse screenshot.
Do you suggest I need to do yarn eject
to configure those things as mentioned in that repo? Any doc or blogpost how I can set tree shaking for this kinda project to get going?
from wallet-adapter.
Thanks for the additional detail, I'll look into this.
from wallet-adapter.
This is fixed by 6d9c3a7 and has been published as a minor (breaking change) release to the affected packages.
The change that broke tree shaking was for #4 but I think the starter projects provide reasonable ways to get transpiling of modules working now.
from wallet-adapter.
Thanks will try. Dunno why github not giving mails/notifs.
from wallet-adapter.
Hello @jordansexton, I've removed node modules, changed the version of this package to 0.10.0 in package.json of the repo I've used. But still build consists all these wallets. Am I doing this right?
from wallet-adapter.
Can you mention more about what your project structure / build toolchain looks like? The build now exports esnext modules, so tree shaking should work out of the box for most build systems.
from wallet-adapter.
I've cloning this repo - https://github.com/exiled-apes/candy-machine-mint, changing version of wallet adapter from 0.9.0 to 0.10.0 and then doing
yarn install
yarn build
And then doing yarn analyze
as mentioned above.
from wallet-adapter.
Cool, thank you for providing those steps. I'll do the same tomorrow and check it out.
from wallet-adapter.
#121 could help here.
from wallet-adapter.
I've tested out building the library after converting all the relevant packages to ESM: #132
Unfortunately, running yarn analyze
from the react-ui-starter package leads to the same result.
Looking at the Blocto SDK's dist
dir, the problem seems to be that it exports a UMD that can't be tree shaken effectively.
Still working on a solution here.
from wallet-adapter.
This has been implemented by converting the core and wallet packages to ESM with sideEffects: false
to improve tree shaking. Adapters like Torus, Blocto, and Sollet still require loading third party deps, but these will only be included if used in your application.
from wallet-adapter.
Published:
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
- @solana/[email protected]
from wallet-adapter.
Related Issues (20)
- wallet-standard:app-ready is missing object
- auto redirection after Solana Wallet Integration - to https://solanamobile.com/wallets HOT 1
- Is this possible to use solana-wallet-adapter in asp.net website? HOT 1
- How to correctly implement a token minting flow with Solana in a React app?
- No way to filter out wallet-standard wallets or the mobile wallet adapter on `<WalletProvider>` HOT 1
- Webpack typeError, fails in NextJS 14 and 13 (react 18.2.0) HOT 1
- Why did many adapters were removed 8 months ago HOT 1
- can we show list of wallets in as wagmi provide us this functionality ot list the wallets in wallet connect as web3modal? HOT 1
- There are no errors when running the project, but the wallet connection button is disabled. HOT 1
- TransportRaceCondition in ledger-transport.js changed to TransportPendingOperation HOT 12
- wallet connet work local good but when i deploy to vercel not work ? HOT 3
- Not working devnet network for SolflareWalletAdapter HOT 1
- Please give a option to use custom Websocket RPC endpoint in react package HOT 1
- TypeError: off is not a function HOT 3
- Module not found errors when trying to run packages/starter/create-react-app-starter HOT 2
- Sending transaction with devnet connection does not work with Solflare wallet HOT 3
- Firebase auth HOT 1
- Where to import useWalletMultiButton in CustomConnectButton HOT 1
- signMessage for Safepal HOT 1
- signMessage for Ledger HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wallet-adapter.