-
Notifications
You must be signed in to change notification settings - Fork 3
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
Consider removing Node built-in modules polyfills #450
Comments
See also: #449 |
@ShGKme If Buffer really available? I noticed that with the latest |
I had to do this to Text yesterday yes |
Buffer is not available. Well it is but its API is different from the Node.js Buffer API. Both share some API, but some parts do not behave the same, so basically you can not be sure 3rd party libraries only use API which works on browser and Node. Thats why you probably need to polyfill every node module (except |
Preface
In the past Webpack polyfilled built-in Node.js modules. It was changed in Webpack 5. But some modules require built-in Node module polyfills. To fix that currently the
node-polyfill-webpack-plugin
is used, which returns Webpack 4 behavior.The problem
Many Node polyfills are useless. (For example,
console
andBuffer
are available in Web Browsers). But they still increase the bundle size and bundling time.For example, for the Talk frontend, it adds about 189kb raw in the production build. It may sound small but:
This would be a breaking change. Any app building may break if it requires any polyfill.
To decrease the number of breaks we may provide fallback with polyfills, required by Nextcloud libs, by default:
stream
andpath
. For most app it might be enough.Why do not change anything here
Nextcloud Server + apps frontend is very large, and this small change may seem like a drop in the sea. But on the other hand, it is small and simple change (with a small breaking change).
The text was updated successfully, but these errors were encountered: