Пост-знакомство — https://t.me/frontenddevelopernews/3
По всем вопросам — @mobiledeveloper_bot
Post #106
395

🤣🤣🤣
- 😁 15
- ❤ 1
- 👍 1
FR @frontenddevelopernews

Forwarded from Веб-стандарты (Vadim Makeev)

aria-label, aria-labelledby, aria-live — и для чего они нужны?<header> и заголовками <h1>…<h6>?array.flat()?
Forwarded from 🦜 on the web
Forwarded from Катерина | Про Frontend
<script> могут блокировать дальнейшее построение DOM, что влияет на производительность страницы. И вот как это работает:<script>, без async или defer) — блокируют построение DOM до своей загрузки и выполнения. Это замедляет рендеринг страницы.defer, но имеют строгий режим и поддерживают import/export. Они выполняются после загрузки HTML и поддерживают top-level await.defer для большинства скриптов, чтобы они не блокировали рендеринг;async;<head> — это замедляет загрузку страницы.
200 считается успешным результатом. Есть ещё 201, 204 и другие кейсы ✅200, 400, 404 и 500, существует множество других статус-кодов, которые могут значительно упростить логику на фронте и сделать API более понятным.
I have a [language] function in a [framework] project that needs refactoring.
Current code:
[paste code]
Issues I'd like to address:
[specific issue, e.g., low readability]
[specific issue, e.g., non-optimal O(n^2) time complexity]
What I've considered:
[ideas you've already tried]
Constraints:
[must remain backward compatible, no new dependencies]
Please suggest refactored code with explanations,
including trade-offs and potential edge cases.
Please review this code from three different perspectives:
1. Security specialist:
- Identify vulnerabilities / injection risks
- Mention any OWASP Top 10 concerns
2. Performance engineer:
- Highlight inefficiencies or bottlenecks
- Suggest better data structures or algorithms
3. Maintainability expert:
- Point out unclear naming / complex logic
- Suggest improvements for testability and structure
CONTEXT:
- Tech stack: [React/Node/TS]
- Constraints: [e.g., no new dependencies]
CODE:
[YOUR CODE]
I'm designing a RESTful API for a [SPECIFIC DOMAIN] system.
Let's develop this progressively:
STAGE 1: Core resources
- Define resources + relationships
- Primary attributes
- Basic CRUD
STAGE 2: Interaction patterns
- Non-CRUD endpoints
- Filtering, sorting, pagination
STAGE 3: Advanced
- Auth & permissions
- Rate limiting
- Versioning
- Caching (ETag, directives)
- Error format standardization
STAGE 4: Documentation
- Generate OpenAPI spec
- Provide request/response examples
Generate comprehensive developer documentation for this [FUNCTION/COMPONENT/MODULE]:
[YOUR CODE]
Structure the documentation as follows:
1. OVERVIEW
- Purpose, functionality, when to use
2. TECH SPECS
- API, params, return values, types
- State management (if applicable)
- Events
3. EXAMPLES
- Basic example
- Advanced usage
- Customization cases
4. TROUBLESHOOTING
- Common errors
- Debugging tips
- Performance considerations
5. RELATED COMPONENTS
- Dependencies
- Components frequently used together


.cjs, .mjs и .js файлы в одном проекте? - https://t.me/frontenddevelopernews/5

MyPick<T, K> самостоятельно.type Foo = {
a: string
b: number
c: boolean
}
type A = MyPick<Foo, 'a' | 'b'> // { a: string, b: number }
type B = MyPick<Foo, 'c'> // { c: boolean }
type C = MyPick<Foo, 'd'> // ОшибкаPick<T, K> — нельзя 🚫keyof - https://www.typescriptlang.org/docs/handbook/2/keyof-types.htmlextendsMyPick принимает:TK, который может быть только ключом из Ttype MyPick<T, K extends keyof T> = {
[P in K]: T[P]
}
?theme=dark&page=2)pushState для навигации, replaceState — для мелких обновлений