-
Notifications
You must be signed in to change notification settings - Fork 65
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
[VO-1282] chore: Migrate to Rsbuild #3296
base: master
Are you sure you want to change the base?
Conversation
BundleMonFiles added (19)
Files removed (16)
Files updated (1)
Unchanged files (1)
Total files change -263.42KB -4.46% Groups added (3)
Groups removed (7)
Final result: ✅ View report in BundleMon website ➡️ |
98c82cd
to
7201534
Compare
This commit title seems incomplete |
import { getRsbuildConfig } from 'rsbuild-config-cozy-app' | ||
|
||
const config = getRsbuildConfig({ | ||
title: 'Cozy Photos', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cozy Drive
@@ -84,7 +84,6 @@ | |||
"classnames": "2.3.1", | |||
"cozy-bar": "^16.0.1", | |||
"cozy-client": "^52.1.0", | |||
"cozy-client-js": "0.20.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not enough for the cozy-client-js
removal. They are cozy.client
global variable uses in the repo.
Great job! 🎉 Can't wait to build faster than light ✨ |
7201534
to
cb626f2
Compare
In #3182 we reworked Breadcrumbs to display the root folder and Shared drives' root as an icon instead of text Unit tests did not reflect this changes but did continue to pass due to a bug in cozy-client-js exports making the ROOT_DIR_ID undefined Since we removed cozy-client-js and used a defined constant instead then unit tests would fail This commit fixes all the tests to reflect the new "icon" behavior
With the Rsbuild migration, the transpiled code now use `let` and `const` features contrary to the previous Webpack configuration that converted them to `var` This highlight some bug that we previously missed where some variables were used before being declared. This did not produce any throw when using `var` due to hoisting, but this may produce bug as the accessed variable may be undefined
With the Rsbuild migration, the transpiled code now use `let` and `const` features contrary to the previous Webpack configuration that converted them to `var` This highlight some bug that we previously missed where some variables were used before being declared. This did not produce any throw when using `var` due to hoisting, but this may produce bug as the accessed variable may be undefined
In cozy-script we used to enforce the development mode when doing a `yarn watch` The development mode changes the build behavior by removing some steps like minification which results to a faster build A side effect is that the code generated from the `watch` command is a bit different than the one generated from `build` command. This may produce some differences on the app's behavior, but this is rare enough (happened 1 or 2 times in the past years) so we consider the speed gain to still be valuable. Also we know that we should run a `build` locally as ultimate check before pushing new code to the git repo So we want to enable this mode in the new Rsbuild configuration Here are the timings for initial build and then 4 differents edits in the code that trigger a re-build yarn watch ``` 11,70s (initial build) 9,87s 9,89s 10,10s 10,80s ``` yarn watch --mode development ``` 6,64s (initial build) 1,42s 0,73s 0,72s 0,77s ``` Related code: https://github.com/cozy/create-cozy-app/blob/master/packages/cozy-scripts/scripts/watch.js#L13
`rsbuild-config-cozy-app` has been upgraded to `0.2.0` in order to retrieve the configuration needed to run `rsbuild dev` with our cozy-stack based architecture and then benefits from HMR feature Related PR: cozy/cozy-libs#2700
Since previous commit we can run `rsbuild dev` to enable HMR feature We now have 3 different scripts: - `yarn build`: build the app for production - `yarn watch`: like for the `build` script but with some optimizations in order to build faster and to trigger rebuild automatically when the code changes - `yarn dev`: build the app with HMR enabled. This should be the fastest way to debug the app, but the HMR feature may prevent the app to work in some environments (i.e. flagship app)
`cozy-dataproxy-lib` has been upgraded to `2.3.1` in order to retrieve a fix on package.json configuration that did not export the dataproxy's `stylesheet.css` Related PR: cozy/cozy-libs#2699
By migrating from webpack to rsbuild we lost this resolution override that is needed by react-pdf for generating PDFs previews using WebWorkers More details: https://github.com/cozy/cozy-libs/blob/a00baa1723bd7d37591fe95dcc1921d4e2c24f87/packages/cozy-viewer/src/Readme.md?plain=1#L299-L335
cb626f2
to
2f7e44e
Compare
Performances comparison on my computer:
yarn build
yarn watch
Related PRs: