verida-js icon indicating copy to clipboard operation
verida-js copied to clipboard

Investigate potential alternatives to NodeJS modules

Open aurelticot opened this issue 3 years ago • 1 comments

Some of the libraries in this repository use NodeJS modules in their code.

These libraries are meant to be used either in a NodeJS app or in the browser. When in browser the NodeJS modules used in the code must be replaced by polyfills. This used to be done automatically by bundlers such as webpack.

But since version 5, webpack doesn't replace by the polyfills anymore (intentionally). This must be done by the developer building its app. Popular tools such as create-react-app embed webpack and hide its configuration, making dealing with the polyfills more difficult, having to use another tool like react-app-rewired to override the configuration.

To avoid such DX, it would be worth investigating where, in this repository, NodeJS modules are used, either directly or via the dependencies, and find potential alternative not relying on NodeJS module.

aurelticot avatar Dec 12 '22 08:12 aurelticot

As a reference https://github.com/facebook/create-react-app/issues/11756#issuecomment-996464456

aurelticot avatar Dec 12 '22 08:12 aurelticot