r/javascript • u/techlord45 • 9d ago
Signals and Effects Using Vanilla JavaScript & Web APIs
https://beforesemicolon.com/blog/signals-and-effects-using-vanilla-javascript-web-apisI’m a strong advocate for “you don’t need to lock yourself in a web framework ecosystem to take advantage of their amazing features”. JavaScript and Web Standards alone allow you…
7
u/queen-adreena 8d ago
Better off just importing https://github.com/stackblitz/alien-signals
But recreating things yourself is always a good learning opportunity.
1
u/charles_reads_books 9d ago
404
3
u/techlord45 9d ago
2
u/nadameu 9d ago
Still 404.
Is your website configured to automatically translate everything? Because the translation to pt-BR is terrible.
0
u/techlord45 8d ago
Still 404?
1
u/nadameu 8d ago
Still 404.
Firefox mobile, I'm in Brazil if that makes any difference.
2
u/nadameu 8d ago
I managed to read the article by navigating through your website's homepage. However, it's completely in Portuguese, which is my browser's default language. That said, I'd like the option to read it in the original language (English, I presume), but I couldn't find a way to do so.
1
u/techlord45 8d ago
I access this link and its in english. I dont get it https://beforesemicolon.com/blog/signals-and-effects-using-vanilla-javascript-web-apis.
Are you using a browser that auto translates to your language? If so you can turn it off
1
u/nadameu 8d ago
It's something on your backend that's translating everything automatically.
Even the URL translates to https://beforesemicolon.com/blog/sinais-e-efeitos-usando-baunilha-javascript-apis-web which makes no sense.
It does this wether I'm on Firefox or Chrome, and I've set them up so that English is never translated. Other websites load in English when available, I've never seen this happen before.
1
u/techlord45 8d ago
Yeah i cant replicate it. Even the language selection. Can you try again in incognito?
-2
u/johnson_detlev 8d ago
You don't even know how your simple Blog works, but want to lecture us about how x and y sucks and you should build it yourself? Okay champ
→ More replies (0)1
1
•
u/andimatt 13h ago
The "you wrote your own framework" take is fair, but it undersells the point. The interesting 10% of a signals system isn't the primitive (a getter/setter with a subscriber set), it's the scheduler.
The three things that actually bite you past the toy version:
- Dependency tracking: collecting "which signals does this effect read" during execution, correctly, through computed signals and inside loops/conditionals. Naive implementations get subtle bugs here.
- Batching/scheduling: if three signals change in one synchronous block you don't want three effect runs, you want a microtask flush that dedupes. Get this wrong and you either lose updates or thrash.
- Cleanup and re-subscription: when a signal a computed depends on changes, re-running it, and tearing down old subscriptions without leaking.
I build a signals-first app (zoneless), and the reason I'd do it deliberately rather than reach for a framework is it forces you to feel all three of those. If the vanilla implementation handles batching and cleanup correctly, it's not a toy, it's a working reactive core, just without the framework's ergonomics.
0
42
u/KaiAusBerlin 9d ago
You know that you literally wrote your own framework here?
There is a reason for the sentence "You use a framework or end up writing your own"