one problem people face when using nginx as load balancer is how to pass real client IP address to the backend servers
nginx supports ip transparency but network setup is complex
simpler way: use proxy_protocol between load balancer nginx and backend nginx!
Posts by andrei
Dan is out here making the arguments for RSC I never knew I needed to hear.
A nice write up on the race conditions attacks. While with a single data store, you can tackle those with transactions, but multiple data stores are much harder to secure. portswigger.net/research/sma...
Turns out you can do grps mirroring with #nginx: inge.4pr.es/grpc-traffic...
I wonder if same trick can be used for websocket mirroring.
#javascript strings are faster than c++ strings! (sometimes): iliazeus.lol/articles/js-...
This is very 5head but super interesting! 🤩 It’s crazy how people learned to exploit things you would never think are exploitable in the first place... #javascript pure.tugraz.at/ws/portalfil...
it returns undefined, because return statement doesn’t allow line break right after return. thankfully, modern IDEs will most likely give you a squiggly warning or even error, depending on your settings.
the modern web yep 🤦♂️
A very nice writeup on the OpenAI’s incident with #kubernetes control plane going down: render.com/blog/a-hidde...
Just faced this: Nginx ingress controller consumes a lot of memory during configuration changes (e.g. when creating ingresses). Which can lead to pods getting killed with out of memory error 😱
It is quite insane considering that NGINX is a very memory efficient server
github.com/kubernetes/i...
Some very interesting details there!
- to avoid a need for source maps, type annotations are replaced with spaces
- swc is used to do the actual stripping. one can say that swc is now shipped as part of Node.js 😄
- enums behaviour
- why tsx files are not supported
…and so on
I disable js in Chrome Dev Tools or use text browser e.g. lynx
Today's daily challenge on leetcode is really hard! If you like to do some morning brain racking, this challenge is for you! 😅
I am actually quite proud I was able to solve it. Saw a guy on Twitch who streams leetcode challenges for 24 days in a row and he couldn't solve it 🤯
I used #typescript.
This is so cool… Minecraft that fits in a single QR code (2953 bytes): blog.allpurposem.at/minecraft-qr
I was fascinated by the 1-billion row challenge, but didn't think JavaScript would be the right tool for the job. It was great to see @jackyef.com's dive into it and achieve a 30x speedup from the baseline: jackyef.com/posts/1brc-n...
I also released ts2c 2.2.10 to npm - that's gonna be the last version based on TypeScript most likely.
The online demo at andrei-markeev.github.io/ts2c/ is using 2.2.10 for now.
Just merged a massive change in ts2c, migration from TypeScript Compiler API to kataw - faster and more lightweight JS parser 🚀
Two weeks of hard work finally materialised. If I knew it would be that hard, I would probably never start 😅 But I did it 💪
github.com/andrei-marke...
Even though I despise dynamic forms, but I built a dynamic forms engine myself about 3 years ago, to replace manually built forms 🤷♂️
The use case literally demanded it.
It was a long onboarding wizard with huge amount of customization per location, and we had hundreds of locations.
Ah so it was form generation from a schema?
Yeah I wholeheartedly agree that in 95% cases it's better to make forms manually. Like write them in JSX. If non-devs want to do it, there's e.g. Figma and then devs can brush up the result.
However, there are different use cases too.
sounds actually like a cool project to me :)
I did "intelligent" forms several times, for React and Vue, but never had to work with AST transforms for this, typings were enough.
it might be challenging, but why horrible?
used it in ts2c: github.com/andrei-marke...
#typescript has a very handy feature: it can merge interfaces, even with external libs.
I regularly forget how to make it work with modules, so here's the reminder 😉
Btw: `declare global` is also super useful 😎
I am actually quite proud of myself:
1. Investing a lot of hard work and still being able to withdraw is not easy.
2. Learned quite a bit about #javascript performance from this exercise :)
Spent 2 days (ok, nights 🤪) rewriting type inference system in ts2c to a new "super efficient and more debugabble" implementation.
Measured performance. Unchanged 😅
Tried debugging it. Still very hard.
Rolled back the changes 🤷♂️
Person is not a class, you can't use `instanceof` on interfaces 😉
Type guards can be used instead: www.typescriptlang.org/docs/handboo...
Also don't forget to make sure that `NaN !== NaN` ! 😂
Combine this with a clone of C preprocessor in JS (and maybe GNU make as well) github.com/ParksProjets...
Currently we don't have any preprocessors in JS and we cannot easily eliminate e.g. debug logging from production bundle.
Yesterday stumbled upon this funny idea of using `#include` in JS to bundle files with C preprocessor, thought "haha, nice", and closed the tab.
I guess my brain kept thinking about it 😅 I woke up and now I think it is a really interesting idea actually 🤪
rreverser.com/es6-modules-...
screenshot of `git log` commands, the most recent commit named "migrate to kataw WIP" showing that there were 54 files changed, with 1927 insertions and 1457 deletions
Current status: fixed 700+ typescript errors, phew 😅
Doing a big ass migration from using #Typescript Compiler API to a faster and more compact js parser (kataw) in TS2C.