dev-

Tierra del Fuego Antarctic and
Joined September 2012
Problem: When you deploy a new version of your SPA, users with a tab open will keep using the old SPA code. Yesterday, I shared one solution. People suggested dozens of useful variations and alternatives. 🙏 So, here are the best options in the massive thread. 6 ways to tell the SPA a new release is available, simplest options first: 1. Write the version from package.json into index.html as part of the build process. Poll index.html every x minutes and compare the server's index.html to the client's index.html. 2. Create an endpoint on the UI web server that reads the package.json version, and returns it. Poll this every x minutes. This is more efficient than option 1, because the payload is smaller. 3. Use web sockets or server sent events to push a notification to the UI after a deploy instead. This is especially attractive if you’re already using these technologies. 4. Use a service worker to notify the user when the UI is stale. For example, Vite's PWA plugin supports this. 5. Use an API proxy like Cloudfront to fetch the version without involving the backend. More here: rehanvdm.com/blog/using-a-cl… 6. Specify the app version in each HTTP call from the UI via a x-app-version header (or whatever name you like). Validate the x-app-version header on the API server. If x-app-version doesn't match the server's version, notify the UI in the response, either via an HTTP 205, 400, or 422 (the HTTP response you return depends on whether you want calls from a “stale” UI to succeed).
14
74
6
529
97,290
A really cool idea for REPL: The 'explain' command that takes a piece of code and describes its every part in a beginner-friendly way. I don't recall any programming language doing this. Here's my prototype for OCaml 👇 What do you think?
74
223
27
1,612
131,903
Explicaciones animadas sobre desarrollo web 🚀 🤘 Descarga la animación en formato webm 🤘 Copia el código para incluirlo en tu proyecto webdevvisuals.com/
13
218
1
880
105,808
Future CSS Tip! 🔮 Use scroll-driven animation to animate non-ancestor elements w/ timeline-scope 👀 main{ timeline-scope: --a; }👈 hoist! .a{ view-timeline: --a; } .i{ animation: indicate; animation-timeline: --a; } Peep the contact list indicators ✨ @CodePen link below! 👇
5
75
3
430
56,823
✨ Accidentally built a pretty cool web3 app starter kit when working on web3host. It uses @nextjs's new app router and server actions, Sign in with Ethereum, includes team scaffolding (w/ user roles & invites), and much more! Check it out on GitHub 👉 github.com/m1guelpf/armchair
31
50
5
628
114,796
Remote work was a mistake. After two years of being fully remote, we're now going back to in-office. This is a hard task because we need to relocate every team member. Check out our new headquarter and why we are getting back in person. A thread 🧵
213
483
227
3,886
2,359,456
@DavidKPiano "The two ways to manage state"
2
3
16
4,193
Holy shit. How is this the first time I am reading apenwarr.ca/log/20201227 by @apenwarr? It is the best thing I have ever read on systems architecture, design thinking, and maybe engineering levels too. 🤯🔥 On engineers whose systems thinking skills surpass their coding skills:
This Post is from an account that no longer exists. Learn more
8
62
5
476
107,759
Basic JWT Auth Flow:
12
419
15
1,908
System Design Interview Cheat Sheet
10
379
6
1,906
Design pattern to write better code
116
1,575
42
7,991
Two pet peeves: 1. Developers who don't participate in code reviews 2. Developers who merely approve all pull requests Ignoring or "rubber stamping" pull requests is malpractice. Carefully reviewing PRs and providing thoughtful feedback/questions is part of each dev's job.
13
24
4
169
Feature Flags are not an excuse for not writing your tests.
1
1
From an Amazon tech lead: soft skills I’d tell my younger, jr software engineer self. 🧵 👇
47
739
150
2,802
1. Start to parse the HTML 2. Fetch external resources 3. Parse the CSS and build the CSSOM 4. Execute the JavaScript 5. Merge DOM and CSSOM to construct the render tree 6. Calculate layout and paint { author: @jstarmx } #DEVCommunity dev.to/jstarmx/how-the-brows…
3
79
4
356
🎉 We're excited to announce "GraphQL at Enterprise Scale", a completely free ebook written by Apollo Engineers. Learn how to scale GraphQL in the Enterprise with Federation and Apollo Studio. apollographql.com/blog/annou…
35
1
110
High Scalability and "Stuff the internet says on scalability" articles are distinct, fun, informative and marathon reads: highscalability.com/ And High Growth Engineering has distinct drawings in each issue, related to engineering practices: highgrowthengineering.substa…
2
3
1
33
Let’s talk about High Agency: an attitude I’ve seen in every successful product manager & leader I’ve known. Some ppl are born/raised with High Agency. It can also be developed later in life. High agency is a prerequisite for making a profound impact in one's life & work 1/20
245
1,756
455
8,343