JSForPHP's profile picture.

JavaScript for PHP Developers

@JSForPHP

JavaScript for PHP Developers 님이 재게시함

Hey everyone! React v19 has been released! The future is now. react.dev/blog/2024/12/0…


JavaScript for PHP Developers 님이 재게시함

📒 JavaScript Trick - Use the URL constructor When you want to add some query parameters to your URL, use the built-in URL constructor in JavaScript instead of template literals. This results in more readable and less error-prone code as you don't need to manually write ? and &

MaxProgramming1's tweet image. 📒 JavaScript Trick - Use the URL constructor

When you want to add some query parameters to your URL, use the built-in URL constructor in JavaScript instead of template literals.

This results in more readable and less error-prone code as you don't need to manually write ? and &

JavaScript for PHP Developers 님이 재게시함

Just found out that Fetch API has built-in timeout support! 🤯

goenning's tweet image. Just found out that Fetch API has built-in timeout support! 🤯

JavaScript for PHP Developers 님이 재게시함

Incredible post on optimizing JavaScript for performance — so many neat little surprises in here: romgrk.com/posts/optimizi…


JavaScript for PHP Developers 님이 재게시함

My answer: TypeScript's goal is not to be type-safe. It's to provide a type system to describe enough of JavaScript to be useful.

Is TypeScript type-safe?



JavaScript for PHP Developers 님이 재게시함

That's an hour of my day I'm never getting back

nandafyi's tweet image. That's an hour of my day I'm never getting back

JavaScript for PHP Developers 님이 재게시함

Async await is super awesome... until it's not and it's not obvious to newer developers. Lint your code, folks.

BenLesh's tweet image. Async await is super awesome... until it's not and it's not obvious to newer developers.

Lint your code, folks.

JavaScript for PHP Developers 님이 재게시함

express is great. It may not be the most modern solution and I'm definitely eyeing alternatives, but it's amazing how useful it's been for the last decade. It's been my companion for as long as I've used node.


JavaScript for PHP Developers 님이 재게시함

❌ Using Boolean to filter `undefined` from a list? Prefer using a type guard which returns a type predicate ✅ instead. #typescript

avindrafernando's tweet image. ❌ Using Boolean to filter `undefined` from a list? 

Prefer using a type guard which returns a type predicate ✅ instead.

#typescript

JavaScript for PHP Developers 님이 재게시함

A common TypeScript mistake I see in React code reviews: Needless useState type arguments. If there's a default, the type can typically be inferred.

housecor's tweet image. A common TypeScript mistake I see in React code reviews: Needless useState type arguments.

If there's a default, the type can typically be inferred.

JavaScript for PHP Developers 님이 재게시함

Problem: You want to support internationalization. You want autocomplete support for translated strings. You want type safety to ensure translations are available for all languages. Solution: Use TypeScript. Use functions for strings that need placeholders for dynamic content.

housecor's tweet image. Problem: 
You want to support internationalization.
You want autocomplete support for translated strings.
You want type safety to ensure translations are available for all languages.

Solution:
Use TypeScript. Use functions for strings that need placeholders for dynamic content.

JavaScript for PHP Developers 님이 재게시함

I use fetch btw


JavaScript for PHP Developers 님이 재게시함

Mitosis is really neat - write your components in mitosis JSX and it will generate the equivalent React/Svelte/Vue/+more component code. Extremely helpful for large organizations that need to share components / design systems across frameworks mitosis.builder.io/?outputTab=E4U…


JavaScript for PHP Developers 님이 재게시함

#js tip of the day 🤓

awilum_'s tweet image. #js tip of the day 🤓

JavaScript for PHP Developers 님이 재게시함

🔥 take big, but nicely formatted, dumps in your console with console.table()


JavaScript for PHP Developers 님이 재게시함

🔥 TypeScript Tip 🔥 Creating a Context in React can be pretty annoying in TypeScript. Here's my method for keeping things typesafe, minimizing use of 'as', and also ensuring folks use your custom hooks, instead of useContext.


JavaScript for PHP Developers 님이 재게시함

Why render React Server Components? Performance. 1. Faster fetches. The server typically has a faster internet connection than your users.💨 2. Fetches start sooner (no waiting for JS to parse and render). ⏰ 3. Less JS. React server components add no JS to the bundle. 🔥


JavaScript for PHP Developers 님이 재게시함

🔥 Format large numbers in your JavaScript with numeric separators. const milly = 1_000_000; This doesn't affect how the number works or is displayed - just helpful for reading large values quickly.


JavaScript for PHP Developers 님이 재게시함

JavaScript: The optional chaining operator (?.) accesses an object's property or calls a function. If the object is undefined or null, it returns undefined instead of throwing an error. developer.mozilla.org/en-US/docs/Web…

mankms's tweet image. JavaScript: The optional chaining operator (?.) accesses an object's property or calls a function. If the object is undefined or null, it returns undefined instead of throwing an error.

developer.mozilla.org/en-US/docs/Web…

United States 트렌드

Loading...

Something went wrong.


Something went wrong.