quasarframework / quasar

Quasar Framework - Build high-performance VueJS user interfaces in record time
https://quasar.dev
MIT License
25.87k stars 3.51k forks source link

Webpack 5 support #8102

Closed IlCallo closed 3 years ago

IlCallo commented 3 years ago

https://webpack.js.org/blog/2020-10-10-webpack-5-release/ https://webpack.js.org/migrate/5/

webpack 5 is out and it's time we go way down into that rabbit hole :D

We'll use this issue to keep track of everything. We plan to ship Quasar 2 with Webpack 5 support, or add it right after with a @quasar/app update, ~but could push back the upgrade to Quasar 3 if we find out there are too many breaking changes for devs~ this is needed as some webpack 4 issues are pretty severe

If anyone from team or community wants to jump in and point out something we are missing, both on current issues or new features we can leverage, please do :)

Let's avoid spam and "+1", we are going to delete/hide those comments

Existing issues due to webpack 4

New feature we want to leverage from webpack 5

Loaders to upgrade

Issues with webpack 5 migration

Related issues

Things which could be explored, but which aren't really "in-scope" for the migration

Additional context Vue CLI still has not switched, but something is moving:

React is moving there too and have an exaustive list of stuff to upgrade and problems to solve:

Angular CLI already supports Webpack 5 as experimental (we could check if we can learn something from their code), and is discussing about Module Federation feature:

Blfrg commented 3 years ago

Regarding:

pug-plain-loader (used in docs) not updated since years, webpack 5 status support unknown

I'm using a forked version because as you noted, it hasn't been updated for a while. The proper version by Evan has a dependency error and doesn't work with pug v3. See Other Packages in the forked readme for details.

This only depends on the latest version of loader-utils by webpack, so I believe it will be compatible. I can test/confirm once ready to review.

IlCallo commented 3 years ago

@Blfrg thanks, updated into the initial post :)

yusufkandemir commented 3 years ago

@IlCallo just a little update: workbox-webpack-plugin v6(stable) is released, and the latest version is v6.0.2.

IlCallo commented 3 years ago

Perfect, updated into the first post

hawkeye64 commented 3 years ago

@IlCallo There is a temporary fork of postcss-rtl that's been upgraded to work with latest postcss plugin structure. https://www.npmjs.com/package/@mjhenkes/postcss-rtl I am thinking we may need to fork that (the form) ourselves and maintain a @quasar/postcss-rtl

IlCallo commented 3 years ago

I added this to the original post, but I'm not sure taking the burden of yet another package to maintain for ourselves is the right way...

hawkeye64 commented 3 years ago

I agree. I am using rtlcss, but Razvan says that doesn't handle all of our cases properly. It may be better to PR that package with what's needed. Right now I can't say I know what is missing from rtlcss, but it is actively maintained.

haoqunjiang commented 3 years ago

FYI the vue fork of preload-webpack-plugin has supported webpack 5 https://github.com/vuejs/preload-webpack-plugin/releases/tag/v2.0.0 I've also maintained a fork of friendly-errors-webpack-plugin that has supported webpack 5 https://github.com/sodatea/friendly-errors-webpack-plugin/releases/tag/v1.8.0 (@soda/friendly-errors-webpack-plugin on npm)

IlCallo commented 3 years ago

Thanks! One or two out of the list then :D

Blfrg commented 3 years ago

Regarding:

pug-plain-loader (used in docs) not updated since years, webpack 5 status support unknown. Consider using this updated fork instead

I was just reviewing my dependencies and noticed that back in December @sodatea merged the needed PR for the orginal pug-plain-loader to work with pug v3.

So the original dependency can be considered reliable again, instead of the fork.

IlCallo commented 3 years ago

Thanks, updated in the initial list

panhezeng commented 3 years ago

html-webpack-plugin v5 has been upgraded to the latest stable version long ago .

mariusa commented 3 years ago

Just as a note, as vite support is also on roadmap: vite brings significant performance compared to webpack. After trying it, you might consider making vite a higher priority than webpack for 2.0 (speaking only from my personal experience; there could be roadblocks to using vite for other projects). Thanks for considering.

rstoenescu commented 3 years ago

We need to first concern about our current user base and not leave them hanging with their current apps. Due to Webpack team not upgrading chokidar dependency for Webpack 4 we can't have apps correctly running on Node 14+ (which is LTS!).

We are aware of how good Vite is, which is why we've planned a Vite plugin and even a Quasar CLI based on Vite instead of Webpack. It will come, guaranteed. I'm about to finalize the Webpack 5 upgrade (a few more days and there's going to be a q/app release with it) and then it's Vite time!

mariusa commented 3 years ago

Mulțumesc, Razvan :)

rstoenescu commented 3 years ago

"@quasar/app" v3.0.0-beta.16 will feature Webpack 5. Was hell upgrading everything (including our many of custom webpack plugins). But while I was at it, took time to also greatly improve and revamp the inner workings of q/app (and there are so many to list them here!). Get ready to rock'n'roll your apps with it!

rstoenescu commented 3 years ago

Available through "@quasar/app" v3.0.0-beta.16 + Quasar v2.0.0-beta.13. Enjoy and please read the release notes! https://github.com/quasarframework/quasar/releases/tag/%40quasar%2Fapp-v3.0.0-beta.16