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

RFC: future of this package #600

Open
ShGKme opened this issue Aug 7, 2024 · 2 comments
Open

RFC: future of this package #600

ShGKme opened this issue Aug 7, 2024 · 2 comments

Comments

@ShGKme
Copy link
Collaborator

ShGKme commented Aug 7, 2024

I'd like to discuss the future of this package since we are migrating to @nextcloud/vite-config.

Current state

  • We are actively working on @nextcloud/vite-config, migrating to it, and call the migration a performance improvement for apps
  • This config is almost not maintained for a while

Issues with webpack-vue-config

  1. 🐌 It is slow and requires much RAM for production build
  2. 📦 It inject CSS into JS making impacting web performance
  3. ⛓️‍💥 Bad extending. It just exports config which is then mutated, making it not configurable on hight-level and less stable for changes
  4. 🌲 It has an old issue with less effective Tree Shaking

These issues can be solved:

  1. Migrating from babel + ts-loader + Terser to ESBuild makes it much faster (requires even less RAM than Vite)
  2. Adding MiniCssExtractPlugin to extract CSS
  3. Adding a good support for extending and configuration similar to @nextcloud/vite-config
  4. Not solvable afaik

Also, there is RSPack, Rust-based Webpack compatible bundler.

Issue with Vite

  1. 🍴 It requires much more RAM on production build than Webpack + ESBuild
  2. 🔬 It has an old problem with multiple JS entrypoints. It's optimized for building libraries and results in tons of micro-chunkswhich is bad for performance. It is not so configurable in chunk generation as Webpack. it is not a problem for typical Vite users with index.html entrypoint, but it is for Nextcloud apps
  3. 🔎 Still lack of plugins. For even basic things we create our own plugins or use not widely-used ones

Some of the problem might be solved via rolldown (likely brining new in the beginning) or fixed in future.

Further options

1. Consider Vite the only recommended option

And mark this package as deprecated and maintenance-only

2. Support both

And develop a new major of nextcloud/webpack-config with some of problems solved.

@skjnldsv
Copy link
Contributor

skjnldsv commented Aug 7, 2024

1. Consider Vite the only recommended option

👍

@ShGKme
Copy link
Collaborator Author

ShGKme commented Aug 15, 2024

  1. Support both

👍

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

No branches or pull requests

2 participants