Skip to content
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

fix: android build fail with rnx kit & treeShaking enabled #380

Merged
merged 5 commits into from
Mar 9, 2024

Conversation

ashwin1014
Copy link
Contributor

@ashwin1014 ashwin1014 commented Mar 8, 2024

📜 Description

Fixed build issues when using @rnx-kit.

💡 Motivation and Context

When using tools like @rnx-kit from microsoft, which uses esbuild to handle bundling and also enables treeShaking, the build fails

📢 Changelog

  • instead of direct export of type Ex: export { KeyboardToolbarProps } we export using "type": export { type KeyboardToolbarProps }

📸 Screenshots (if appropriate):

Screenshot 2024-03-07 at 23 01 07 Screenshot 2024-03-07 at 23 00 53

@kirillzyusko kirillzyusko self-assigned this Mar 8, 2024
@kirillzyusko kirillzyusko added 🚀 optimization You optimize something and it becomes working faster 🐛 bug Something isn't working labels Mar 8, 2024
};
// Define a function to apply the monkey patch
export const applyMonkeyPatch = () => {
Object.assign(NativeAndroidManager.default, ModifiedNativeAndroidManager);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll check how it works today and if everything is okay, then I'll merge it 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had a little help from gpt!

@kirillzyusko
Copy link
Owner

kirillzyusko commented Mar 8, 2024

@ashwin1014 you also need to run yarn prettier '**/*' --write --ignore-unknown to fix eslint stage

And there is one more eslint violation - please, fix it 🙏

@kirillzyusko
Copy link
Owner

@ashwin1014 by the way - did you check? Do these changes help to fix build issues?

@ashwin1014
Copy link
Contributor Author

@ashwin1014 by the way - did you check? Do these changes help to fix build issues?

i was usually doing these changes manually from node_modules on my project. Then it used to build correctly

@ashwin1014
Copy link
Contributor Author

@ashwin1014 you also need to run yarn prettier '**/*' --write --ignore-unknown to fix eslint stage

And there is one more eslint violation - please, fix it 🙏

Will do

@kirillzyusko kirillzyusko merged commit 5a516aa into kirillzyusko:main Mar 9, 2024
5 of 6 checks passed
@kirillzyusko
Copy link
Owner

@ashwin1014 thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🚀 optimization You optimize something and it becomes working faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants