-
Notifications
You must be signed in to change notification settings - Fork 204
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
Polyfill node libraries within the sdk #645
Comments
Strongly support this recommendation. This polyfill issue has generated a ton of questions and frustrations in the dev community. |
We do include polyfills for all necessary libraries in our browser build (currently this is just Problems tend to arise when using 3rd party frameworks to build for the browser, e.g. React or Vite, which have their own build processes we cannot control. We attempt to make it possible for these frameworks to identify and use our browser build (with its added polyfills), by declaring it in our package.json, but we cannot control if a framework decides to instead consume the code declared under "module" or "main" (which are meant for Node.js). We unfortunately do not test with every browser framework and do not know their build processes. If you have suggestions for improvements we can make to better support a framework, please let us know, I think we'd be more than happy to make this process easier for everyone. Note my reply to your other comment here about the |
Problem
According to the FAQ page:
It seems that most sdk maintainers in the industry have opted for doing package level polyfills and automatically including checks to see crypto, buffer, and other relevant libraries are available instead of asking for the user to polyfill on their end.
It seems the direction that the Algorand SDK has chosen will cause more problems for its users not experienced with webpack or are simply looking for a hassle free way to start building with Algorand. I believe this is net detrimental to the developer experience.
Solution
Including all relevant polyfill libraries and do a sanity check to see if a native version exists given the execution environment instead of asking users to do polyfills.
The text was updated successfully, but these errors were encountered: