Roast: salesforce/lwc
The Framework You Didn't Choose, But Are Contractually Obligated to Use
Welcome to Lightning Web Components (LWC), the repository that proves you can take the "open" out of "open web standards" if you just add enough enterprise XML.
This repo is Salesforce’s attempt to sit at the cool kids' table with React and Vue, while still wearing a three-piece suit and carrying a briefcase full of legacy CRM debt. It is "blazing fast"—which, in Salesforce terms, means it renders slightly faster than a Visualforce page loading over a 3G connection in 2011.
Here is why salesforce/lwc deserves a roasting:
"Web Standards" (Terms and Conditions Apply)
They love to brag that LWC is built on "Web Standards." And sure, it uses standard JavaScript... right up until you try to touch the DOM. Then you meet Lightning Locker (or its cooler younger brother, Lightning Web Security), which treats every developer like a convicted felon trying to accesswindow.location.- Real Web Components: "I use the Shadow DOM for encapsulation!"
- LWC: "I use a Synthetic Shadow DOM, which is like the Shadow DOM but polyfilled with sadness and restrictions."
The
@wireService: Magic or Malpractice?
Ah, the@wireadapter. The only dependency injection system that requires you to guess if your data will arrive today, tomorrow, or never.
You want to pass a dynamic variable? Better remember to prefix it with a$, or the framework will just stare at you blankly. It’s the only time in programming where adding a dollar sign actually saves you money on debugging time.File Structure Bloat
In other frameworks, a component is a file. In LWC, a component is a lifestyle choice. You can’t just make a button; you need:- A folder (named in
camelCase, but referenced inkebab-case, because consistency is for the weak). - An
.htmltemplate. - A
.jscontroller. - A
.js-meta.xmlfile—because God forbid you write a single line of JavaScript without an XML configuration file holding its hand to explain to the App Builder what a "label" is.
- A folder (named in
LWC OSS (The "Open Source" Version)
Salesforce released LWC as open source so you could use it outside of Salesforce. This is like a prison warden telling you that you are free to build your own cell in your backyard.- Number of people using React for non-Facebook projects: Millions.
- Number of people using LWC for non-Salesforce projects: Three. And they all work at Salesforce.
The "Legacy" Defense
The biggest selling point of LWC is simply: "At least it’s not Aura."
And that’s true. Aura was a slow, proprietary nightmare that threwSystem.LimitExceptionif you looked at it wrong. LWC is the sleek, modern upgrade that simply throwsProxy(Object)errors that you can't debug because the security model has redacted the stack trace.
Verdict:
salesforce/lwc is an engineering marvel in the same way a Rube Goldberg machine is a marvel. It technically accomplishes the task, but with maximum steps and enough proprietary glue to ensure you never, ever leave the ecosystem.
⭐️ 1/5 Stars - Would sfdx force:source:push again, but only because my mortgage depends on it.