I’ve been fighting with this upgrade for the last week, and think I’ve come out the other end mostly now, but still have some lingering issues.
Once the project builds, it is great, amazingly fast, really a game-changer for productivity as advertised! However, the “just upgrade with a few commands” advertisement has certainly not been true for us thus far, albeit we do have a complicated project and could have worked more on testing the RC builds along the way.
Here are the struggles we’ve had:
Dev package breaking CI
In CI, we’ve been using this script to start our server
PORT="3400" \
NODE_ENV="testing" \
MONGO_URL="mongodb://mongo:27017/meteor?directConnection=true" \
METEOR_SETTINGS="$(cat ./settings/settings-ci-app.json)" \
node "$CI_PROJECT_DIR/bundle/main.js" &
That no longer works, due to this issue. After trying various hacks, which broke in other ways, we ended up changing NODE_ENV to “production”, but that required us to change a whole bunch of checks for isTest/isDevelopment all over the place. It works now, but it could be an idea to have test suites for built applications with different flags.
Node packages not being compiled correctly
We’ve had a hell of a time configuring rspack.config to ignore stuff and wrestle our existing packages into compiling outside rspack. The Stylus atmosphere package we used broke in many different ways, and we needed to replace it with stylus-loader, which now compiles our stylus in a different order than before, breaking a bunch of layouts. Tedious but managable. At least it is much faster.
There are a bunch of nested node packages in our node dependencies that refuse to compile, like mongoose, svg-captcha, jsdom and a few others, that needed excluding. Not sure how much of a difference this makes for tree-shaking and compile time, and not sure why they don’t compile like other packages.
Multiple meteor apps in same folder
Perhaps the most breaking change for us, running multiple apps from the same folder with different ports broke completely. We run the same app with different ENV options, in app mode and worker mode for example on different ports but connecting to the same database. This needed a bunch of configurations to have each app ignore the others’ build directories, and build to separate folders so they didn’t override each other’s bulds, or got triggered to rebuild as the other apps built.
It would have been nice if this worked without any hassle like before, but I understand it is hard when there is this dynamic build folder. Maybe have a separate one per port or something by default?
PANIC
We do have very frequent panics still, where the rspack cache gets corrupted and we have to manually clear it if something goes wrong. This is quite annoying. We have a script to delete the rspack-cache on every restart, but even that doesn’t fully fix the issue during rebuilds. Stuff like this:
[app] [Rspack Client Error] Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues: panicked at crates/rspack_core/src/module_graph/mod.rs:722:26:
[app] ModuleGraphModule with identifier Identifier(u!("builtin:react-refresh-loader!builtin:swc-loader??ruleSet[1].rules[1].use[0]!/home/user/src/ourapp/app/imports/modules/instructor/ui/tutorials/TutorialUI.jsx")) not found
That’s what I could tink of right now, maybe it is helpful in some way. I am still glad for the performance upgrades we are getting, and that meteor is moving forward on this critical issue, thank you for your hard work y’all 