magic-js
magic-js copied to clipboard
Reduce unused javascript from assets.auth.magic.link
✅ Prerequisites
- [x] Did you perform a cursory search of open issues? Is this question already asked elsewhere?
- [x] Are you reporting to the correct repository (
magic-sdk
)?
❓ Question
assets.auth.magic.link is taking majority of resources. is there a way to reduce unused bytes ?


🌎 Environment
Software | Version(s) |
---|---|
magic-sdk |
8.1.1 |
Browser | Google Chrome |
yarn |
1.22.19 |
Operating System | Mac OS Monterey 12.4 (21F79) |
it would be great if we can get this trimmed. its 50% of our request
Thank you for bringing this up Kesar. We'll be discussing this internally and I'll respond once we have an update.
Thank you for bringing this up Kesar. We'll be discussing this internally and I'll respond once we have an update.
thanks! we've built https://www.npmjs.com/package/@everipedia/wagmi-magic-connector and its starting to get a bit of traction, it would be amazing if we could reduce that bundle problem so pages don't get bad performance from google which impacts SEO 👍🏻
Let us know if you need any help from our side, we are happy to help!
any update on this? we might need to use a different auth provider if this does not get solved. It really affect to SEO and performance to have such a big bundle
anyone in the boat?
@kesar We support a plethora of blockchains and use code splitting to only deliver what is needed based on the SDK use case. Unfortunately, most blockchain libraries are not optimized for bundle size. Our authentication relies on Ethereum libraries for creating the DID tokens. There is some work that can be done to reduce the overall bundle size however the biggest offenders won't be trivial.
I do think the lack of Cache TTL can be addressed in the interim.
We're consistently failing lighthouse largely because of the magic library.
What is the best workaround to optimize the package so we can get faster load times?
We're consistently failing lighthouse largely because of the magic library.
What is the best workaround to optimize the package so we can get faster load times?
which we ended up doing its to dynamic load blockchain libs when user clicks in login, that way lighthouse gets better score
We're consistently failing lighthouse largely because of the magic library. What is the best workaround to optimize the package so we can get faster load times?
which we ended up doing its to dynamic load blockchain libs when user clicks in login, that way lighthouse gets better score
@kesar Can you please go into more detail onto how you dynamically loaded the blockchain libs for magic? I need to do the same. I am using wagmi & everpedia connector too.