Our great sponsors
- Appwrite - The open-source backend cloud platform
- Amplication - open-source Node.js backend code generator
- SurveyJS - A Non-Cloud Alternative to Google Forms that has it all.
- Sonar - Write Clean JavaScript Code. Always.
- InfluxDB - Collect and Analyze Billions of Data Points in Real Time
- Mergify - Tired of breaking your main and manually rebasing outdated pull requests?
-
storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation.
I'm sure many have heard of Storybook [0]. I've used it pretty much since the start from ~2016 (back when Angular was cargo-culting it like mad). I've always had generally negative experiences with it:
1) Messy Javascript API resulting in inexpressive storybook files, particularly for big frameworks like Angular and big components.
2) Slow AF with webpack/terser/etc. And that's ebfore you start bolting on crazy addons like compodoc.
3) Tries to solve so many different problems (just a subjective opinion of mine).
4) Insane levels of "framework magic", particularly when I've used it with Angular, but also in other scenarios too.
---
So, I wanted to ask HN to gauge the appetite for a similar but not same kind of Storybook:
1) Extremely expressive Javascript API. Think Jest.
2) Go CLI (allowing direct interface with ESBuild, etc.).
3) ESBuild-centric (rather than webpack, or worse, addons [1]).
4) Typescript-centric (rather than seeming like an after-thought).
5) Much less framework magic (think React, Redux, etc. Stick mostly to simple explicit JS behaviors).
6) Probably a lot more that haven't come to mind yet.
Before I go any further with it, it would be amazing to hear what you guys think about all of this. What are your thoughts about Storybook? Too much tech debt for them to modernize? Am I just being silly and picky about Storybook? Am I the crazy one?
Thanks HN!
[0] https://storybook.js.org/
[1] https://storybook.js.org/addons/storybook-addon-turbo-build
-
lmiller1990, have you experimented much with @storybook/test-runner?
I've found it pretty capable for doubling my stories as Jest tests. For those using testing-library for component testing, it even acts like a GUI for those tests.
If you're interested, I threw together a little walkthru that show some of the ways I'm using it with Jest: https://github.com/chantastic/vite-react-jest-testing-librar...
-
Appwrite
Appwrite - The open-source backend cloud platform. The open-source backend cloud platform for developing Web, Mobile, and Flutter applications. You can set up your backend faster with real-time APIs for authentication, databases, file storage, cloud functions, and much more!
-
lmiller1990, have you experimented much with @storybook/test-runner?
I've found it pretty capable for doubling my stories as Jest tests. For those using testing-library for component testing, it even acts like a GUI for those tests.
If you're interested, I threw together a little walkthru that show some of the ways I'm using it with Jest: https://github.com/chantastic/vite-react-jest-testing-librar...
-
DOMPurify
DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:
Coupled with DOMPurify [0], it helps much to simplify the messy JavaScript, HTML. Yin [1] has book on that.
Related posts
- Mitigating DOM clobbering attacks in JavaScript
- How to upskill my skills?
- 5 injection vulnerabilities hackers don't want developers to know about (and how to prevent them)
- Design System to CSS Code
- "It may take a few minutes to process your new cookie preferences" -- Is this real!? What is actually going on here?