core icon indicating copy to clipboard operation
core copied to clipboard

[Feature request] add a bundler of `rspack/rsbuild`

Open yzqdev opened this issue 1 year ago • 9 comments

Clear and concise description of the problem

Rspack is a high performance Rust-based JavaScript bundler that offers strong interoperability with the webpack ecosystem, enabling faster development cycles and efficient collaboration between the two tools.

https://www.rspack.dev/

It's compatible with the webpack loader and plugin system. Loaders and plugins, such as mini-css-extract-plugin,css-loader,html-webpack-plugin, That means maybe we just need to replace webpack word with @rspack/core ,then we could get better performance .

Suggested solution

Add a bundler of rspack or just replace webpack with rspack

Alternative

No response

Additional context

Rspack is webpack-like,and it has a higher level tool, rsbuild,providing a out-of-the-box environment like vue-cli,but built on rspack. (we dont need to config some loaders and plugins)

It alse has a bundler chain feature,which may replace webpack-chain

yzqdev avatar May 07 '24 04:05 yzqdev

pr welcome

Mister-Hope avatar May 07 '24 07:05 Mister-Hope

some updates to make things clear, we are looking forward for this if it supports most of the webpack loaders, but we are focusing on stable version and ecosystem now, and vite is fast enough to use. We would be happy to see anyone working on this, and I would like to help with any difficulty while developing.

Mister-Hope avatar May 07 '24 11:05 Mister-Hope

i'm trying to make a bundler-rspack. once vuepress and @vuepress/theme-default is compatible, i'll make a small repo to show the results. Now rspack lacks persistent cache, and it'll be implementated in the future.

yzqdev avatar May 07 '24 12:05 yzqdev

I just find it works well with vuepress and default theme,in development and production. here is my repo.

https://github.com/yzqdev/vuepress-rspack

i only replace webpack keyword with @rspack/core, so the code is not perfect,and i will consider whether use rsbuild or rspack later.

yzqdev avatar May 07 '24 15:05 yzqdev

Sorry for delay. Was busy last few days.

I also did some experiments on integrating rsbuild/rspack (in fact there is still a wip branch in my local repo lol), but no progress for a long time due to limited bandwidth.

I'm really looking forward to new bundlers integration. That could be the biggest advantage of the vuepress v2 implementation.

Currently a new @vuepress/bundler-rsbuild/rspack is preferred, cuz webpack is still an active & famous bundler.

@yzqdev PR welcome! Let me know if you have any questions.

meteorlxy avatar May 13 '24 05:05 meteorlxy

Any update with this one ? @yzqdev

Mister-Hope avatar May 17 '24 06:05 Mister-Hope

Sorry for the delay, a little buzy these days.

I tried to intergrate rspack/rsbuild with vuepress ecosystem and found it's not quite compatible and stable . when our project are getting bigger and bigger, rspack/rsbuild may be stuck when compiling. some of the loaders or plugins didn't act as what we expect them to be. some of the plugins or themes use webpack-only features, rspack cannot compile.

The rspack's api is changing fast, and its stable version 1.0 of rspack will launch at July,apis will become stable, then we could re-evaluate rspack's advance.

yzqdev avatar May 17 '24 07:05 yzqdev

got it, the we will leave it here now

Mister-Hope avatar May 17 '24 07:05 Mister-Hope

@yzqdev Thanks for the efforts! Agree that we can wait for their stable release.

BTW, the first version could be an experimental package, which can at least work with the e2e project of core. Ecosystem compatibility could be considered later.

meteorlxy avatar May 17 '24 09:05 meteorlxy

rsbuild & rspack 1.0+ have been released

hustcer avatar Dec 07 '24 03:12 hustcer

Sorry for the long time no response,I have tested rspack 1.0, find it's not so fast as vite, even with it's own compile solution(e.g using swc instead of babel,using it's own css parser install css-loader/style-loader),with webpack plugins and loaders, it's much slower.

Also other limitations, less plugins and users,different api from webpack , it means if we run into issues it's harder to find a solution. A new bundler may be a burden to developer and users.

Webpack team will attempt to integrate Rspack into webpack with experiments flag when rspack reaches a certain level of maturity.Maybe we don't need rspack bundler.

yzqdev avatar Dec 07 '24 07:12 yzqdev