tezvyn:

Vue, Angular & Svelte

Vue 3, Nuxt, Angular, Svelte, SvelteKit

126 bites

Vue, Angular & Svelte30 sec read

Cypress Component Testing: Test in a Real Browser

Cypress component testing mounts your UI components in a real browser, not a simulated DOM, so you test them exactly as users see them. Use it for faster feedback on individual React, Vue, or Angular components.

Vue, Angular & Svelte30 sec read

Svelte's Legacy immutable={true} Optimization

The `immutable={true}` option was a contract with the Svelte 3/4 compiler: you promise to never mutate data, and it uses fast referential checks for updates. It was a performance boost for immutable patterns.

Vue, Angular & Svelte30 sec read

List Virtualization: Rendering the Viewport, Not the Dataset

List virtualization renders only the visible slice of a huge dataset, keeping your app fast by maintaining a tiny DOM. Use it for long lists or infinite scroll feeds.

Vue, Angular & Svelte30 sec read

Headless Components: Separate Logic from UI

A Headless Component separates a component's logic from its UI, providing the 'brain' without the 'looks'. Use it for complex elements like dropdowns that need consistent behavior but different visual styles. The footgun is assuming it's a drop-in UI.

Vue, Angular & Svelte30 sec read

Angular HttpInterceptor: A Pipeline for API Requests

Think of an HttpInterceptor as a pipeline for every API call, letting you inspect or modify requests and responses globally. Use it to automatically add auth headers or show a loading spinner.

Vue, Angular & Svelte30 sec read

Svelte Actions: Reusable DOM Logic

Svelte Actions let you run code when an element is mounted for direct DOM access. Use them to integrate third-party libraries or add custom events like swipe gestures.

Vue, Angular & Svelte30 sec read

Angular Services: Your App's Shared Toolbox

An Angular service is a shared toolbox for your app. Instead of components building their own tools (like an HTTP client), they request a single instance from the dependency injector.

Vue, Angular & Svelte30 sec read

Angular: Reading URL Query Parameters

Angular gives you two ways to read URL query params: a static `snapshot` for the initial value, or a `queryParams` Observable for live updates. Use it for values like `?search=term`.

Vue, Angular & Svelte30 sec read

File-Based Routing: Your Filesystem is Your API

File-based routing makes your directory structure the single source of truth for your app's URLs. Creating a file at `routes/about/+page.svelte` automatically creates the `/about` page, no central config needed.

Vue, Angular & Svelte30 sec read

RouterLink: Client-Side Navigation in Angular

RouterLink is Angular's replacement for `<a>` tags, preventing full page reloads in a Single-Page App. Use it on any element to navigate between views. The common footgun is using a standard `<a href="...">`, which reloads the page and loses application state.

Vue, Angular & Svelte30 sec read

SSR Hydration: Don't Re-render, Reuse

Hydration tells your client-side app to reuse the HTML sent by the server instead of wastefully re-rendering it. This prevents UI flicker in Server-Side Rendered apps and improves load performance.

Vue, Angular & Svelte30 sec read

XState: Predictable UI State with State Machines

XState treats UI logic as a formal state machine, making impossible states impossible. It's ideal for complex components like multi-step forms or data fetching UIs. The footgun is overusing it for simple boolean toggles, which adds needless boilerplate.

Vue, Angular & Svelte30 sec read

Optimistic UI: Assume Success for a Faster Feel

An optimistic UI assumes an action will succeed, updating the interface instantly instead of waiting for the server. This makes actions like liking a post or adding to a cart feel instant. The footgun is failing to revert the UI when the server reports an.

Vue, Angular & Svelte30 sec read

SvelteKit's `load` Function: Pre-fetch Data for Pages

Think of SvelteKit's `load` function as a gatekeeper for your page, fetching data *before* it renders. It's used to grab data from an API or route params, like fetching a blog post. The footgun: `load` in `+page.js` runs on both server and client.

Vue, Angular & Svelte30 sec read

Angular HttpClient: Your App's API Connector

Angular's HttpClient turns network requests into RxJS Observables. Use it to fetch data or submit forms. The footgun: a request is never sent until you subscribe to the Observable it returns, a common mistake for beginners.

Vue, Angular & Svelte30 sec read

Vuex: A Central Store for Your App's State

Vuex acts as a global warehouse for your app's shared data, letting any component access state without complex prop-drilling. It's for large apps where components need to sync up. The footgun: For new projects, use Pinia, Vue's new official state library.

Vue, Angular & Svelte30 sec read

Zod: TypeScript-First Schema Validation

Zod creates a single source of truth for your data's shape, providing both runtime validation and static TypeScript type inference from one definition. Use it to parse API inputs or form data, ensuring data is correct and typed.

Vue, Angular & Svelte30 sec read

VeeValidate: Vue Forms Without the Boilerplate

VeeValidate manages the entire lifecycle of a Vue form—tracking values, validation, and submissions—so you don't write the state boilerplate. Use it for simple contact forms or complex wizards, especially with async validation. The footgun is mixing its APIs.

Vue, Angular & Svelte30 sec read

SvelteKit Form Actions: Server-Side Logic for Forms

SvelteKit Form Actions link HTML forms directly to server-side code, handling submissions without client-side boilerplate. They're perfect for logins or registrations and work without JavaScript.

Vue, Angular & Svelte30 sec read

Angular's Built-in Form Validators

Angular's built-in validators are pre-made rules for your forms. Use them to easily check for required fields, min/max length, and valid email formats. The footgun is confusing `required` for text inputs with `requiredTrue`, which is only for checkboxes.