I learned something new about TypeScript today from @dariacaraway at @jsconfbp:
type Thing = {
[key: string]-?: string
}
-? in TypeScript mapped types removed optionality.
My goodness, this is the best TypeScript talk I’ve seen yet. I am learning a ton. 🤯
Tip: The @ChromeDevTools now shows you chains of error causes in the stack trace.
To make debugging easier, in the latest DevTools you can specify error causes when catching and rethrowing errors.
The "cause" data property of an Error instance indicates the specific original cause of the error. It is used when catching and re-throwing an error with a more-specific or useful error message.
As the Console walks up the cause chain, it prints each error stack with a "Caused by": prefix, so you can still see the original error.
Learn more about error causes on MDN: https://t.co/FrjdXHgXNf
Check out more in our "Whats new in DevTools" series: https://t.co/wgxwBW87sI
This layoff trend is so savage. My heart hurts especially this week, as 3 people dear to me and my family were completely blindsided by being laid off and now have to reshuffle their entire lives.
This is evil and inexcusable, first *how* people are laid off, and second, that people even are.
About the modality of it: why blindside folks? In all the layoffs I've seen this week, it's been "thanks for your work, bye" by surprise. There was no transparent conversation leading up to it. There was no forewarning. There was no compassion and guidance. It was cutthroat. Did it have to be this way? Could it have been more human?
I publicly condemn this style of operating and hope and pray we get better.
I'm a senior frontend developer.
I want to give you an idea of the kind of work I do.
A React component I had to create for one of the tasks last week:
(Would you be able to implement it?)
Create a "days slider" with the following requirements:
1. Must have 5 different marks, with an option to easily add more.
2. The marks are for 30 days, 60 days, 120 days, 1 year, and 3 years.
3. Each mark must be equally spaced on the slider, regardless of the difference in actual days between them.
4. The slider should allow the user to select any number of days within the specified range (30 days - 3 years)
5. The steps between each mark on the slider should be consistent (25 steps).
6. The component should be reusable and easily extensible to accommodate more marks.
👇Code in the comments below👇
Tip: Want to load your (LCP) hero image sooner? Try <img fetchpriority=high> to boost its priority ⚡️
@ChromeDevTools now also shows the initial and final priority of requests in the Performance & Network panels 🙌
🔥 JavaScript Sets are about to become a lot more useful with these 7 new methods:
.difference()
.intersection()
.symmetricDifference()
.union()
.isSubsetOf()
.isSupersetOf()
.isDisjointFrom()