Rome: An experimental JavaScript toolchain
romejs.dev
romejs.dev
And there were already some (very small) breaking changes between Prettier v1 and v2.
Changing from Prettier to something else doesn't sound like that big of a change, as long as Rome's formatter is not too ugly or changes are too drastic.
You're right though if Rome has a formatter that looks nice I suppose I wouldn't care, but at that point it's sort of like why not just use prettier?
Well, then I guess it wouldn't be an "uphill battle" :)
But everything else is on track to be reimplemented within Rome.
> No external dependencies. This allows us to develop faster and provide a more cohesive experience by integrating internal libraries more tightly and sharing concepts and abstractions. There always exist opportunities to have a better experience by having something purpose-built.
See more of the technical reasons behind Rome here: https://github.com/facebookexperimental/rome#technical
Plus there's the cost of having plugin-infrastructure and/or maintaining a public API inside the six tools themselves. Plus all of them have dependency on a parser.
Having it all in one single tool will tremendously reduce the amount of code necessary.
Real problems this causes:
1. security surface area. Running npm audit in many large projects is going to give you scary results. And that's just the known advisories.
2. 3rd-party support. How many of the 1000+ packages you've ended up pulling into your node_modules will continue to be actively maintained throughout the life of your project, what stability pains will dead subdependencies cause, and what will the long-term maintenance cost of rooting them out (and finding equivalent replacements) be? Will it cause forced deprecation of features in your app?
So with all the above, low-dependency/no-dependency projects are attractive. Many go to extreme and repeat the old mistakes of NiH. Rome seems to me to be this extreme kneejerk (and liable to some serious lock-in).
The sensible thing here is moderation: just choose dependencies carefully.
Like, if it "replaces webpack", am I locked into Rome's idea of what an "optimal bundler config" looks like? If I need more from a bundler, do I have to completely replace Rome with the "old" toolchain? How extendible is Rome on its own?
I'm wondering if it will have something like CRA's "eject" that allows you to override the defaults, without having to replace entire portions of it.
Dependencies are great for solving problems you are not willing or capable of solving. They are great when you need them, but most software includes dependencies that aren't needed or even directly requested. That is bloat. For example the Angular JS framework requests nearly 1100 NPM dependencies. That is a tremendous amount of code for an insignificant value add.
If this replaces Webpack, can someone please list a combination of popular plugins that this compares to. (Or even a few lists - would it replace Grunt + something?)
If not, can you tell me what other software this compares to, so that I can better understand it?
I am sure that I am not the only one who has some familiarity, but doesn't live in the system. Having a point of comparison would be extremely helpful.
So, this is a bundler with built in plugins?
Is there is a way to add Babel etc, that I would have used with Webpack? Does it handle CSS?
And why would I prefer this over that chain (simpler to set up? Trust in Facebook over the people at js.foundation?)
The question is - will Rome perform as well as all the tools it intends to replace. Can it be a better Babel than Babel is? (There's a good chance it could since the creator of Rome is the creator of Babel)
With a unified tool you can use a single AST. Or even better: an intermediate representation. You only need to parse and pretty-print once.
Re-implementing the entire JS toolchain for a modern SPA is a HUGE task, just checkout CRA dependencies : https://github.com/facebook/create-react-app/blob/master/pac...
(This is not a statement either pro or against FB, just a neutral one :)
Then again, even React itself only has a small core team, same with lots of Facebook projects. I think they should hire more aggressively and become more of a tech-driven company (they should be fighting for the web platform too a lot stronger).
The commit log shows that everything is committed by one person: https://github.com/facebookexperimental/rome/commits/master
[1] https://www.folklore.org/StoryView.py?story=Negative_2000_Li...
It is the same parser used in Babel, but modified to be faster and more user-friendly [1]. This is probably how the author got so much done in just a few years.
I believe in Sebastian. He can do it.
- 17 of them are just to connect the core dependencies with each other. Having one single tool means you can drop those.
- 12 are "plugins" for different parsers/linters. I believe third-party parsers/linters is something that will keep existing in Rome.
- 11 are plugins, loaders and other tools that provide additional functionality to the core tools, such as loading raw files, loading raw HTML, handling case sensitive paths, inject hot-loading code. They range from trivial to complex (webpack-dev-server). We don't know how much of that functionality Rome will have built-in, so those might not be going away.
- 1 is a wrapper around the core tools, 1 contains polyfill and 7 are "util" packages that do just one thing each (taking a cursory look, most of those are already implemented in Rome).
- 5 are the core tools are Rome intend to replace: Webpack, Babel, ESlint, Terser and Jest. The most complex of the four was built by the Rome author himself.
- There's also Typescript and PostCSS but those are third-party dependencies, and AFAIK Rome doesn't intend to replace those).
When you take into account that the first four are tools built around parsers it makes A LOT of sense to put them all into a single tool, and there's a lot of overlapping functionality.
The hardest part is not really replacing the core four tools, but rather replacing the whole ecosystem that exists around ESLint, Webpack and Babel. But if the AST format is the same, there's a chance that a compatibility layer would be enough to even use ESLint/Babel plugins in Rome!
Sure you might lose a bit of edge cases and features (Webpack has a lot of things), but it will be entirely reasonable to start a new project with Rome when it's ready without losing much.
Replacing those tools in an existing project is probably very hard, though: there's a bunch of Webpack non-standard features that cause vendor lock-in, but as someone who migrated large Webpack projects to use Rollup or Parcel, it's not as hard as it seems IME.
But yeah it's hard.
It's OK. JavaScript has very little to do with Java, so it fits.
Personally, considering how ambitious the project is, I was hoping they would go just a bit more ambitious and cover type checking as well (rather than just transpile out the syntax), otherwise we still need to install Typescript/flow and run their parsers independently from rome.
Would not be a problem if it didn't sell itself as "zero third party dependencies" while being built on top of one that is not even JavaScript... Might as well built the tool in any other language that would have been better for the task.
A similar comparison would be shipping a program to end users, saying that 'no dependencies required', but instead of giving them a binary to run, you hand them a c++ file. I think everyone would agree that a C++ compiler is clearly a required dependency in that case.
Yes, that tool is Rome. They are re-implementing the TypeScript compiler, just like everything else
However, you can compile C code as a bin file (just instructions). More common in the embedded world or you need to bootstrap an OS ect...
But my point above was to counter the "C compiler is a dependency" claim. Nobody counts that way when discussing running programs, and that was my point.
Both types of dependencies do come up. However, most people don't consider language dependencies. However, if you for instances need to port your code to a lot systems such dependencies can suddenly be very important. Especially if you have to do the porting. So to say: "Nobody says a C file has a "dependency" because you have to compile it." is a bit disingenuous. There is a lot of C code that require features only available in certain compilers. At which point that code now depends on that compiler.
However, JS seems to have problem with too many dependencies, at times these dependencies can be trivial that is makes someone ask why...
"No dependencies" seems accurate to me, since it refers to use of the built product, which is what will presumably be used in the future when you can `npm install rome`.
What this project means by no dependencies is that there is nothing external pulled into the compiled JavaScript.
> Then, navigate into it and build rome:
> cd rome; ./scripts/build-release dist
Be aware that this command might take a long time to complete. After all, Rome wasn't built in a day.
It actually only takes a couple of minutes, with ANSI fancy progress bars and everything
I mean, there's precedent... remember Nero Burning ROM?
After all, Rome wasn't built in a day.
And when you do something with your project they didn't anticipate their response would be: 'When in Rome...'.
> Rome gets its name from proverbs such as "All Roads Lead to Rome", "Rome wasn't built in a day" and "When in Rome, do as the Romans do". This refers to the expansive scope and the desire for conformity across the project. It started as a joke at the office.