Profile picture
Gary Bernhardt @garybernhardt
, 12 tweets, 3 min read Read on Twitter
I'm four hours into trying to switch to a popular javascript asset bundler with its attendant "transpiler" etc., and I have *never* seen this many things failing in this many ways. It's absolute pandemonium. A whole new type of failure every minute.
At this particular moment: The asset bundler is injecting some kind of code that blows stack with infinite recursion. It also opens a websocket to itself to throw errors up in the browser... but that socket fails to connect sometimes and I can't see the pattern. (...)
(...) React is yelling at me to install "React DevTools". The bundle is 7 times its original size (when it was just preact.min.js, plus app source files, all `cat`ed together). The source maps are no longer being used but they were working just fine for hours 1-3.5. (...)
(...) React is telling me to "Consider adding an error boundary to your tree to customize error handling behavior" but I have no idea what that means. There are probably many more errors if I somehow fixed these. I think I'm going to give up and write this half day off as wasted.
None of the stuff that I just listed was happening 30 minutes ago. Back then it was failing just as hard, with an equally large set of errors, but they were totally different. It's utterly demoralizing.
On the bright side, I'm really enjoying React (in the form of Preact). I can wholeheartedly recommend <script src="preact.min.js"/> (about 3.5 KB gzipped). It's a really nice, easily understood UI model. And you can get much of the benefit without the mountain of tooling.
I don't learn my lesson. I thought, "Maybe I can use TypeScript by itself." An hour later, I've failed to get it to work at all. Please show me a self-contained repository that depends only on TypeScript and Preact, building two source files into a single resulting .js file.
No long-running build processes; no other tools; just TypeScript and Preact and a single tsc invocation (regardless of how complex it is) that builds a single resulting js file.
All of this is happening because I just want to know if my Preact props have the right keys. I would also happily accept an example of running whatever subset of {preact,preact-compat,prop-types} will actually work, with no bundling at all. I've failed to get that to work.
I guess that in the most general case: I would happily accept any evidence that I am not living in a simulation designed to torture my desire for computing systems that work reliably.
Solution for now: instead of trying to figure out how to get PropTypes working with Preact, I gave up and wrote my own little 32-line type checking function, called explicitly from components' render(). Is it vulgar to get a tattoo of your own tweet?
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Gary Bernhardt
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member and get exclusive features!

Premium member ($3.00/month or $30.00/year)

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!