Will Rome Replace Webpack?
Taking a look at how Rome aims to unify the frontend dev toolchain
The History of Rome
After working on the project for many years, in February 2020, the project became open-source, and in August, they introduced the first beta release.
How Rome Works?
While not every feature is ready, you can still use Rome today as a linter. They plan to roll out other features such as bundling and compiling once their usage as a linter has matured. To get started, run
npx rome init inside your project. If you don’t have
npx, you can run
npm i -g npx to install it globally. You can also do this for
rome to access
rome commands everywhere on your machine. Once installed, it will add itself as a dependency to your project and also create a
rome.rjson config file for you.
Note that Rome uses its own superset of JSON called Rome JSON, or RSJON for short. It only makes syntax like quoted keys or commas optional, it doesn’t add new data types. They wanted to make JSON files more concise this way. However, you can still use regular JSON in your project. (Rome also provides a VSCode extension if you want things to be reported right in your IDE.)
Now you can run
npx rome check (or simply
rome check if available globally) to lint files. You can also apply fixes right away with
npx rome check --apply, or review the proposed changes with
npx rome check --review. It will show you all issues encountered in your code through your terminal.
Will Rome Replace Webpack and Other Tools?
Just like for other tools, you can configure your project in your
rome.rjson config file — or in a
package.json file —, however, the amount of options is limit. And since Rome doesn’t require any configuration upfront, you can use it without prior setup. All config options are optional. This is a great benefit for developers who just want things to work out of the box.
When it comes to linting rules, however, — they have over 100, all enabled by default — you cannot disable them. Instead, what you can do, is use suppressions with comments. The developers opted for a zero-configuration setup, and this can be a pain point to many.
While the initiative is great, at this stage it is not quite ready to replace every other tool out there. Will they ever? Only time can tell. I love their project philosophy, however, zero-configuration can be a double-edged sword. I’m looking forward to what the dev team will bring out of Rome down the road, and how things will evolve, when linting has matured and bundling/compiling is also provided.
Have you used Rome before? Whether yes or no, still let us know your thoughts in the comments down below. Thank you for reading through, happy coding!
Tired of looking for tutorials?
You are not alone. Webtips has more than 400 tutorials which would take roughly 75 hours to read.