> One question you are probably wondering is why would the Prettier team fund another project!? In practice, Prettier has been the dominant code formatter for JavaScript and as a result of a lack of competition, there has been little incentive to push on performance and fix various edge cases.<p>I was indeed wondering that but the answer doesn't really answer the question for me. Why not set a bounty to improve Prettier instead of building a competing project just to increase the motivation to improve Prettier? Or is the end goal to shut down the Prettier project and encourage people to switch to the Rust based one? Seems like an unnecessary fragmentation of an already confusing landscape.<p>Maybe I'm misunderstanding something though.
Many people comment the reasons without acknowledging that part as well:<p>> By matching all the tests, the Biome project also found a lot of bugs and questionable decisions in Prettier that we will be able to improve upon.<p>For me, this means that they have another implementation for sanity checking their own.
I'm incredibly excited for this.
The Biome team has been remarkably fast on achieving 95% compatibility with Prettier [1].<p>This will help to bring maximum speed to formatting Javascript thanks to Rust, following the ruff (Python formatter) trend.<p>Just as a note, as it was not mentioned in the article, Wasmer [2] also participated with a $2,500 bounty to compile Biome to WASIX [3], and it has been awesome to see how their team has been working to achieve this as well... hopefully we'll get Biome running in Wasmer soon!<p>Also congrats to the Algora team, as they have been doing very good work with their landing and trying to help on the challenge moving forward [4].<p>Keep up the great work!!<p>[1] <a href="https://github.com/biomejs/biome/issues/720">https://github.com/biomejs/biome/issues/720</a><p>[2] <a href="https://wasmer.io/">https://wasmer.io/</a><p>[3] <a href="https://wasix.org/" rel="nofollow noreferrer">https://wasix.org/</a><p>[4] <a href="https://console.algora.io/challenges/prettier" rel="nofollow noreferrer">https://console.algora.io/challenges/prettier</a>
Speed is always welcome, but I just wish prettier was a little less opinionated. Specifically around line length, it will just not leave my formatting alone. I find prettier formatted code <i>much</i> less readable than unformatted code, and this isn't a problem I have with other code formatters like rustfmt.
I'm still salty that all my eslint plugins decided to remove perfectly fine linters in lieu of Prettier. I find Prettier to be way too heavy handed and hard to reason about, and yet another tool that I never asked for...
While porting to Rust has been a trend, as Prettier runs on every save, the speed boosts will be significant. I'll be trying out Biome soon. Congrats to the Biome project!
"This means that we can now focus on the next important aspect: Performance. Prettier has never been fast per se, but fast enough for most use cases. This has always felt unsatisfying so we wanted to do something about it. What better way than a friendly competition.<p>On November 9th, we put up a $10k bounty for any project written in Rust that would pass 95% of Prettier test suite."<p>I don't see how better performance follows from the fact that something is written in Rust. One could have simply transpiled the existing codebase into Rust, and collect the reward.
As an aside, the winning project (Biome) is a fork (renaming?) of the Rome project, which was started by Sebastian McKenzie (creator of Babel) a few years ago.<p>Forked because sebmck seems to have gone AWOL over the last year or so and contributors were unable to update many of the project's resources as only he had access. Hope he is doing ok though and glad the Biome project seems to be going strong regardless.
Why did it have to be Rust? Couldn't have just been "faster"? Is the Rust one actually fast? Does memory safety and leaks etc even matter for a program like Prettier?
I want to use Biome, but until it either has plugins or implements the tailwindcss class sorting itself, I will not be able to adopt it.<p>This is a common sentiment in the fullstack community right now.
This is something that really got me thinking about how to make my own prettier from scratch because I thought it was interesting. Needless to say, having looked at the “tests” for prettier I was kind of lost because I was trying to reverse engineer from the tests. What I saw was the format tests are auto generated and have if statements in them. If you’re a unit test stickler then seeing an if statement in a test should be a smell. The hardest part was trying to get the why behind each test. No explanation is in the test but I’ll bet it’s in the docs, source code or whatever cloud chat community.<p>Also, I had to check the winning implementation just for sanity’s sake. It is older than a week or two. Still, my hats off to them for being able to meet the compatibility mark and get the cash.
That's interesting. I've been using "deno fmt" as of late and it's been fine for me.<p><a href="https://docs.deno.com/runtime/manual/tools/formatter" rel="nofollow noreferrer">https://docs.deno.com/runtime/manual/tools/formatter</a>
I dislike prettier and wonder why it's so popular because<p>- I sometimes prefer lines to exceed maxLength (ex: template string, which prettier would horribly break on vars)<p>- allow `1 + 2 * 3` or `a || b && c` to be parenthesis-less because everyone know the precendence here
I couldn't find the answer - does Biome work with a prettierrc.json file so that it can be implemented in an organisation that uses Prettier? In this case it would only be for speed reasons, not the formatting.
Awesome! Lets gooo!<p>Can't say prettier performance ever bothered me, but if it can run faster and leaner I'm all for it! Increase my battery life :D<p>In general it's really exciting to see the advancements in JS tooling, the quick successions of tooling in JS might be controversial, but I love it. Each step was a significant improvement over what was there before, and the current Rust rewrite wave has already given us great tools that I use daily.<p>I also like that there is some money being thrown at the problems!
I feel like people complaining about Prettier being "heavily opinionated" are missing the point. Perhaps I'm biased by my decade of using Go, but not having to worry about superfluous stylistic choices is a welcome reduction in cognitive load. (Up to a point I guess, e.g. I'd never put up with K&R-style newline opening brackets).
> Consider donating if you or your company are using Prettier and it has been helpful to you.<p>Wondering what company would NOT be using prettier. Not many.<p>Some arguing that Prettier isn't foundational piece of software, I'd consider automated consistent readability enhancements as foundational though.
I'm looking through the docs, specifically the formatter stuff ( <a href="https://biomejs.dev/formatter" rel="nofollow noreferrer">https://biomejs.dev/formatter</a> ), and it feels like all the examples are backwards?<p>Am I missing stuff?
Maybe I missed it but I don't get how this improves the JS implementation<p>Are they planning to run Rust in the browser? Or make some sort of node module that calls down into rust?
Their next bounty should be for fixing their insistence on putting a closing slash on HTML tags that have never, ever required them in any HTML specification.
noob question but how does one actually use prettier? i find that the formatting just make the code less readable. is the goal to train yourself to be able to read prettier-formatted code as well as you could read your own hand-formatted code?<p>when i'm in the thick of it working on a piece of code, writing some logic and have everything laid out the way that makes sense to me and then i hit cmd + s and BOOM all the lines get shifted and wrapped and i'm ripped out of my flow i wondering what the heck it is i'm now staring at. sometimes i disable prettier on save and just run it on a pre-commit hook because at that point who cares that the code is unreadable to me.
While it's always great to see performance gains, my largest pain point with prettier was never performance. Instead my only gripe with prettier is the "line wrapping noise" it creates, illustrated here by Anthony Fu: <a href="https://antfu.me/posts/why-not-prettier#the-line-wrapping-noise" rel="nofollow noreferrer">https://antfu.me/posts/why-not-prettier#the-line-wrapping-no...</a><p>Would it be realistic to expect a solution for this issue now that "prettier needs to step up it's game"?
> You may not be aware but thanks to all those donations, we've been able to pay two people $1.5k/month for the past two years to keep shipping. Fisker Cheung and Sosuke Suzuki have done an incredible job!<p>It's incredible how little money some people get paid to build foundational pieces in a multi-trillion dollar industry.