-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove terser for react-native support #2263
Conversation
@Perronef5 is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
Cool, let's run the tests and see what happens! |
Something happened 😅 @Henry-E Can we retry? Seems to be a connection issue |
Probably a merge Before merging though @Perronef5 does this affect the original reason for the It seems like this might break the minification needed for next.js (though not sure, only gathered that from a cursory google search). |
Dang thats a good point. Let me test with |
Any findings here? I can't see why Anchor specifically would need to be minified for Next.js. Mango uses Next.js with multiple dependencies that are not minified. |
Cool, just wanted to get confirmation either way as to whether it would be an issue to remove it. From what you're saying it's sounding less like it should be an issue. |
Hey sorry for the late reply. I did get it working with NextJS so we should be good. I see you merged already just wanted to share my findings 👍🏽 |
Co-authored-by: Luis Perrone <perronef5@users.noreply.github.com>
CHANGES 📲
rollup-plugin-terser
for react-native support.Reasoning
The
anchor-ts
client uses rollup to bundlets
code for the browser. In the process of bundling, it passes the code through aminification/uglification
plugin calledrollup-plugin-terser
.The
terser
mangles the code in a way that the the variable assigned to the import of@solana/web3.js
is reused.Something similar to this is happening in the final output:
Issues supporting this claim:
#1082
#2054
#1747
https://stackoverflow.com/questions/70652456/solanaweb-3-js-package-typeerror-s-transactioninstruction-is-not-a-constructor/70964609#70964609