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 Crypto Polyfill, Update Links, Refactor Code, and Improve Android SDK Guidance #403

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

sahilkakwani9
Copy link

Problem Statement

  1. The crypto-browserify polyfill was causing compilation errors and lacks active maintenance.
  2. Several hyperlinks within the lesson content were broken.
  3. Code snippets used for demonstration required refactoring for improved functionality and readability.
  4. The lesson lacked comprehensive troubleshooting guidance for Android SDK issues.
  5. The buffer polyfill's placement in the entry file led to compilation errors.

Summary of Changes

  1. Implemented react-native-quick-crypto for native crypto polyfilling, ensuring active maintenance and better performance.
  2. Updated and verified all hyperlinks to ensure proper functionality.
  3. Refactored code snippets to incorporate robust error handling using try-catch blocks.
  4. Added a troubleshooting section addressing NDK unavailability on client machines.
  5. Updated babel.config.js with necessary configurations to support new implementations.
  6. Reorganized polyfill code into a separate file for improved code organization and imported it at the top of the entry file.
  7. Introduced yarn scripts for streamlined package installation.

Additional Notes

  • These changes aim to enhance the overall quality, reliability, and user experience of the lesson.
  • The refactoring and additions should make the content more accessible and easier to follow for learners.
  • I've run this lab locally and ensured compatibility with the latest development environments and best practices.

Copy link
Collaborator

@mikemaccana mikemaccana left a comment

Choose a reason for hiding this comment

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

This has many useful bits especially around the Android SDK but needs significant changes to be merged. In particular, not using metaplex-foundation/js is one of the reasons this bounty was created. See the comments inline.

If those are fixed, however, we can get this in.

Please do not open a 3rd PR. Just update your branch with the fixes so we can see them being fixed here.

content/courses/mobile/solana-mobile-dapps-with-expo.md Outdated Show resolved Hide resolved
content/courses/mobile/solana-mobile-dapps-with-expo.md Outdated Show resolved Hide resolved
return formatDate(new Date(Date.now())) === nft.name;
});

if (nftOfTheDayIndex !== -1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

'Does not equal -1' is very old-style JS. Why not do const nftOfTheDay = loadedNFTs.find((loadedNft) => { ... }) and then if ( ! loadedNft ) {}?

Copy link
Author

Choose a reason for hiding this comment

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

but that will make the condition false

content/courses/mobile/solana-mobile-dapps-with-expo.md Outdated Show resolved Hide resolved
});

const data = await response.json();
const cid = data.value.cid;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is a cid? Don't answer, just name this better. See https://github.com/solana-foundation/developer-content/blob/main/CONTRIBUTING.md#code re: use full names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants