Looking for the dystopic Science Fiction short of the same name? 1
I wrote my first React library the other day.
So I decide on Rollup. Rollup uses a plugin system. Even though my setup feels very standard, it's unclear what precise combination of plugins I'll need to get this to work. A brute-force Google-Copy-Paste-Rebundle-Refresh-Delete-Repeat loop ensues.
Eventually, I discover it's not just about the combination of plugins - plugin order matters. That's because, taking a peek under the hood, it would appear that Unspeakable Things are happening. I regret peeking. Close the hood.
Here's the thing: No one is at fault here.
Maybe we should have paddled harder.
In my new role as React Library Author, I have become quite familiar with Issue One-Three-Nine-Nine-One. I return to this thread so frequently, I'm afraid GitHub is going to throttle me for abuse.
The issue contains
242 287 comments (and counting). Many comments are littered desperately with emojis, like ancient cairns marking solutions as either roads to prosperity or roads to doom.
Issue One-Three-Nine-Nine-One isn't working towards a solution. It's providing a marketplace, an open Bazaar where Finders from afar can peddle their solutions - and Seekers can desperately Copy-Paste-Rebundle-Refresh - no, that wasn't it either.
Solutions for webpack! Get ye solutions for webpack!
Here lies the command ye seek! It uses an obscure tandem of
prestarthooks. Don't ask questions, yer fine!
This 30-minute blog post will ward off Double-React Syndrome for good!
I feel like I've tried every solution, every salve. I feel hopeless, despondent.
@apieceofbart goes so far as to (very kindly) suggest:
"It was obviously my mistake of using two copies of React but I agree that it would be great if the error message was better."
No, @apieceofbart, this is not your fault. It's not React's fault. It's not ECMA's fault or Eich's fault.
I get it working. How? I'm not totally sure. While my initial steps were measured, I quickly deteriorated into a debug frenzy. Copying and pasting lines from blog posts found on page 5 of a Google Search. Swapping out bundlers - just to swap them back in.
node_modules so many times, I was certain that those blocks of my SSD were going to go permanently dark.
My solution is far from optimal. I have a separate repo for testing my library, but I can't get
npm link to work. But if, with each change to my library, I (1) bump the version, (2) bundle it, (3) push it to npm, (4) bump the version in my test repo, (5)
yarn install -- my app compiles and I can test my library.
I feel dejected. I have a solution, but it's unfulfilling. I feel like a cheat, a fraud, a copypasta programmer who doesn't understand the duplo blocks he's piecing together. What craftsman remains so perplexed by his tools after over a decade of experience?
December 2020: I broke free this year, at least partially. After years of Node back-ends, I switched to Elixir/Phoenix.
I've been on Elixir/Phoenix for 6+ months now, and yet the stack still makes me smile at least once per day. It is such a pleasure to have a thoughtful, well-designed, integrated developer experience from end-to-end.
Remember, dear reader, that you do have a choice.
Maybe one day we'll shoot the Krazam sketch: Bundler Wars is set in dystopic 2035. Our hero Ben has fallen way behind the times (like might-use-CoffeeScript behind the times (though he won't admit it)). He's broke and desperate for work.
After finally securing a contract, he needs to gain access to a coveted Transpiler so he can produce the final bundle. But Transpilers are expensive (after all, they do have hundreds of cores) and are tightly regulated by the Eichman (the authoritarian coalition (futilely) trying to minimize the collateral damage of the Bundler Wars on the civilian population).
Ben's only hope is to turn to the underground - to The Unlintables.↩