João Morais retweeted
If JavaScript libraries are proving costly, replace them with smaller alternatives. Lots of great options in https://teapawt.net/t.co/dtMSv5DLfp & https://teapawt.net/t.co/hU1xwmn9N7
João Morais retweeted
I regret having written integration tests and not written unit tests every time I come back and try to understand that code later.
Every Single time.
Unit tests are tedious and annoying to write, but they are the only thing that truly explains what the code was supposed to do.
João Morais retweeted
Here's some of the best advice I got when I became a manager last year! It's simple, but considering most people receive no management training whatsoever these days, it's better than nothing. Thread!
João Morais retweeted
Tips for useful, respectful code reviews:
- Assume competence (author may have a different context)
- Provide specific, actionable feedback
- Focus on the code (avoid personal criticism)
- Clearly mark nitpicks & optional comments
- Provide rationale (e.g refs to a style guide)
João Morais retweeted
Tip: @ChromeDevTools can pin Live Expressions to the top of Console to monitor values in real-time! ✨
João Morais retweeted
Optional Chaining & Nullish Coalescing are coming to JavaScript! They're short, readable and are both available to try in Chrome Canary 🎉
v8.dev/features/optional-cha…
v8.dev/features/nullish-coal…

ALT const book = { 'title': 'Harry Potter', 'price': { 'retail': 15, 'sale': 10 } }; // optional chaining (?) // concise property accesses with built-in nullish checking salePrice = book?.price?.sale; // nullish coalescing (??) // replaces logical OR || when setting default values genre = book?.genre ?? 'Unknown'
João Morais retweeted
TypeScript 3.7 is finally here!
✔ Optional Chaining & Coalescing
✔ Assertion Functions
✔ .d.ts Emit From .js Files
✔ Smarter Control Flow Analysis
✔ Flatter Error Messages
and more! Check out the blog post today! devblogs.microsoft.com/types…
João Morais retweeted
#TypeScript tip for today:
When you return an array, TypeScript infers the type as an Array of included types (see attached code)
If you want this value to be inferred as a Tuple instead, add `as const` to the return statement.
João Morais retweeted
Hierarchy of any implementation:
1. Correct
2. Simple
3. Fast
------
Be wary of the temptation to flip 2 and 3. Fast is great but if you can never touch the code again what is the point?
João Morais retweeted
New Web Performance API + Metric:
⚡ Largest Contentful Paint (LCP) ⚡
LCP helps you measure when the main content of a web page has loaded.
FCP + LCP now gives you a much more holistic view into how fast your sites actually load for real users! web.dev/largest-contentful-p…
João Morais retweeted
GitHub Actions now includes our most-requested feature: built-in CI/CD.
Oh, and it’s free for open source. ❤️
github.co/2MQcIkX
João Morais retweeted
Learn how to make network connections early to improve perceived page speed: https://teapawt.net/t.co/6lDZydP8Vl ~ a new guide on <link rel=preconnect> & <link rel=dns-prefetch> by @bibydigital
João Morais retweeted
🎉🎉🎉🎉BREAKING: #TC39: Optional Chaining has now moved to Stage 3!!!
#JavaScript
João Morais retweeted
"Do you know JavaScript?"
"Yes."
"Ah—but do you know what happens when you try to multiply a number by a *date*?"
"Yes. I am immediately fired."
João Morais retweeted
Have unlimited PTO? A coworker came up with a cool trick.
Take PTO and then go to work. Do whatever work you want quietly, and reject all other work, interruptions, and meetings with "sorry, I'm on PTO".
João Morais retweeted
🌒 Dark Mode—Overhyped or Necessity?
Learn all(!) about dark mode and how to support it in @tomayac’s article “Hello Darkness, My Old Friend!”
👉 web.dev/prefers-color-scheme…
With `<dark-mode-toggle>`, let your users toggle dark mode 🔅↔️🔆 on your site.
👉 webcomponents.org/element/da…





















