This week, weâve got an Air Bud crossover for the ages, a new team-building drinking game, and a master plan for infiltrating the Vue Mafia.
Welcome to #103.
Was this a real movie, or did we all just share the same fever dream?
Air Bud + Angular â the crossover we didnât know we needed
What do Air Bud and Angular have in common? The real question is, what donât they have in common?
With 14 films in the franchise, Air Bud has quietly made over $200 million. Angular just released its 14th version last week, and just like Air Bud, itâs also been quietly racking up the Wâs (even if it isnât a once-in-a-generation basketball talent).
While the rest of the JavaScript world has been busy arguing on Twitter, the Angular team just keeps pushing out consistent, incremental improvements. Theyâve clearly spent a lot of time revamping their documentation, adding helpful examples, and improving the developer experience overall.
Honestly, the only thing we donât love about nG
these days is them going all in on decorators đ¤Ž. But weâll let that slide for now, because they really brought the heat with Angular 14. Letâs get into the highlights.
-
Standalone Components: these help to address the thing every developer loves to complain about most â boilerplate (you get a lot less of it now).
-
Faster builds + smaller bundles: In v14, builds take 90% less resources and bundles are 30% smaller out the box.
-
FORMS BABY: We all love forms (said no developer ever), but with this release Angularâs Typed Forms help you reduce errors and build safer forms.
-
Automated Version Migrations: Angular learned the hard way that backwards compat is hard, but now they give you a playbook and automation scripts to help you migrate versions (enterprise managers stop drooling pls).
Bottom Line Sometimes we forget that a team is only as good as the people (or dogs) on it, and Google has obviously put together an S-tier squad. The results speak for themselves. #AngBudForever.
That's a powerful back (end as a service) [sponsored].
Appwrite wants to write your backend for you
Congrats! Your teamâs app made it to the top of Hacker News, and now youâve got traffic coming out your eyeballs đ. Thereâs only one problemâŚ
You went with a âusage-basedâ pricing plan for your hosting â and all that traffic just ate up the rest of the cash in your company bank account (RIP in peace).
Shouldâve used Appwrite.
Appwrite is a self-hosted BAAS (backend as a service) platform that gives you a collection of easy-to-use REST APIs that abstract away all the complex and repetitive parts of building a secure backend.
And since itâs packaged as a set of (open-source) Docker microservices, you can host it however you want and not have to worry about getting burned by usage-based pricing.
It handles all of hairy stuff for you, so you can easily integrate your app with multiple user auth methods, set up a DB for storing and querying user data, and a lot more.
I guess thatâs why they called it Appwrite. Finally makes sense now.
Check it out.
I have some state... I have pineapple.
If you like Pinia Coladas
And getting caught in the⌠weird corners of the internet where strangers passionately debate niche state management solutions. Then today is your lucky day, my friend.
Because weâre talking about Pinia â the Vue Store that was recently blessed by the Vue Core Team as the Officially Recommendedâ˘ď¸ state management library for Vue apps.
Besides the fact that Pinia has the cutest OSS logo in the game, there are a few practical reasons why the Vue Team decided to go all in on Pinia and shank demote Vuex to maintenance mode.
-
More Modular â Pinia is built to have multiple stores, instead of just one global store with sub-modules (like Vuex). Each Pinia module can be its own store and can be directly imported into specific components. This makes for a better dev experience and also allows for better Type inferences and automatic code splitting.
-
More intuitive â Pinia is based on Vue 3âs Composition API, which is a lot simpler and requires a lot less boilerplate. This, combined with the modularity mentioned above, makes it a lot more intuitive to write well-organized stores that arenât janky af.
-
More features â Pinia comes with built-in support for SSR and Hot Module Replacement, and it hooks into all the Vue devtools. And itâs extensible, so it comes with a bunch of helpful plugins too.
Bottom Line: Similar to the Vue 2 â Vue 3 upgrade, this transition from Vuex to Pinia seems to be focused on making Vue a more attractive choice for large-scale applications and teams.
Thatâs why Pinia also comes with an Officially Recommended⢠drinking game team-building exercise: every time you get a state error on a Friday, you add one more shot of rum to your blender and mix it up while singing the officially recommended Vue theme song.
Jobs
Close.com is looking for 3 experienced individuals that have a solid understanding of React and want to help design, implement and launch major user-facing features. Close is a 100% globally distributed team of ~55 high-performing, happy people that are dedicated to building a product our customers love.
Courier just launched a brand new Automations API that makes it super easy to configure notification logic for just about any use case. See how it works.
Reactâs useRef
hook allows you to persist values between renders, without triggering a re-render of the component. The kata is to see if you can, using only React.useState
, re-create the functionality of React.useRef
.
Cool Bits
-
UnoCSS is an instant, on-demand atomic CSS engine that just released some cool, interactive docs. It was created by Anthony Fu, whoâs a member of the Vue, Nuxt, and Vite Core Teams (aka Vue Mafia). The projectâs name is obviously based on his intense Uno games with Evan You and the rest of the V.M. â better be careful who you use that Draw-4 wild card on.
-
Want to get a high-level summary of whatâs going on in Java-land? New Relicâs got you covered with their 2022 State of the Java Ecosystem Report. [sponsored]
-
Cosima Mielke wrote a great article about Magical SVG Techniques. Now we just need her to write an article about how we can magically catch and imprison all the people who create non-transparent PNGâs.
-
Matti Bar-Zeev wrote about Converting a React Component to SolidJS. He starts out the article by saying, âNot to diss anyoneâŚâ which means you know heâs about to diss someone đż.
-
Nate Moore (the co-creator of Astro and Bytes reader (đ Nate)) spoke about WebAssembly in the JavaScript Ecosystem. His talk is a lot like most Christopher Nolan films: you might not understand most of whatâs going on, but itâs still worth your time.
-
Robin Wieruch wrote an in-depth article on Monorepos in JavaScript thatâs so long it might technically qualify as its own monorepo.
-
Svelvet is a new Svelte component library for building interactive node-based flow diagrams. Now I can finally map out what the series of events that needs to take place in order for me to finally infiltrate the Vue Mafia and finally beat Evan and Anthony in Uno.
-
Blueprint is a React-based UI toolkit for building complex, data-dense web interfaces. And it was created by Palantir â so you can rest easy knowing that the US Government is watching over all of your appâs data at all times to protect your freedom đĽ´.
The marketing pitch for React.useState
is that it allows you to add state to function components. This is true, but we can break it down even further. Fundamentally, the useState
Hook gives you two things - a value that will persist across renders and an API to update that value and trigger a re-render.
const [value, setValueAndReRender] = React.useState(
'initial value'
)
When building UI, both are necessary. Without the ability to persist the value across renders, youâd lose the ability to have dynamic data in your app. Without the ability to update the value and trigger a re-render, the UI would never update.
Now, what if you had a use case where you werenât dealing with any UI, so you didnât care about re-rendering, but you did need to persist a value across renders? In this scenario, itâs like you need the half of useState
that lets you persist a value across renders but not the other half that triggers a re-render â Something like this.
function usePersistentValue (initialValue) {
return React.useState({
current: initialValue
})[0]
}
Spoiler alert, the functionality of our custom usePersistentValue
Hook is very similar to the built-in React.useRef
Hook.
If you want to add state to your component that persists across renders and can trigger a re-render when itâs updated, go with useState
(or useReducer
). If you want to add state to your component that persists across renders but doesnât trigger a re-render when itâs updated, go with useRef
.
For more info on useRef
(and a deeper explanation of how useState
is similar to useRef
), visit Understanding Reactâs useRef Hook
Share Bytes
We work hard to make Bytes something you'd want to share with your
developer friends. And to make it a little easier, we'll give you free
stuff when you do.
Have a product you think our developers will love?
Advertise in Bytes
50 W Broadway Ste 333 PMB 51647 Salt Lake City, Utah 84101
Unsubscribe from Bytes