Every time I have a programming question and I rly need help, I post it on Reddit and then log into another account and reply to it with an obscenely incorrect answer. Ppl don’t care about helping others but they LOVE correcting others. Works 100% of the time
I didn't know that dynamic scripts (created with JS) behave as "async" by default. To change that, we need to do: script.async = false. Then, the scripts will be executed in their order.
javascript.info/script-async…
I had a terrible race condition: multiple widget instances, initialized in embedded <script>, never arrived in the same order. Huge thanks to the author, this article saved me!
With the builder abstraction, Storybook now supports Webpack 5. Next-gen bundlers like Snowpack, Vite and Esbuild are also considered. Their support may be added soon 🔥
storybook.js.org/blog/storyb…
⚛️ Preact Server Components
Here is a quick prototype that fetches components that were rendered on the server. Need to sort out some implementation details, but so far I like where this is going 🙌
cc @preactjs
Yesterday I learned about re-reselect which makes memorized selectors even better. If the arguments change, reselect invalidates the cache but re-reselect doesn't
github.com/toomuchdesign/re-…
Wow, there is a `flatMap` function available on JS arrays!
A utility library like lodash is needed less and less 😁
Also, the optional chaining removes the need for `get` function. I like the future!
developer.mozilla.org/en-US/…
Developer roadmaps got updated for 2021. Can't say anything about backend/devops, but I confirm: it's pretty precise for the frontend.
github.com/kamranahmedse/dev…
Found a very interesting static-site generator.
Powered by Snowpack,it works with Preact components and allows automatic partial hydration 🔥
npmjs.com/package/microsite
A great combo I keep using in my NextJS projects:
next/dynamic react-intersection-observer 🪄
This allows me to only import a component once it's "in view". I use this pattern on my blog for my webmentions since they are at the bottom of the page