salesforce-lwc
/salesforce-lwc
Pisze i debuguje Lightning Web Components: wire adaptery, zdarzenia, cykl życia, stan, wydajność i testy.
- Autor
- ialameh ↗
- Repozytorium
- sift-coder ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 03.06.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 03.06.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Pisze i debuguje Lightning Web Components: wire adaptery, zdarzenia, cykl życia, stan, wydajność i testy.
Oryginalny opis (EN)
Use when working on Lightning Web Components — wire adapters, events, lifecycle, state, performance, testing.
Jak działa
- Wire adapters
- Events
- Lifecycle order
- State
- Performance
- Testing
- Common bugs
Podgląd SKILL.md
---
name: salesforce-lwc
description: Use when working on Lightning Web Components — wire adapters, events, lifecycle, state, performance, testing.
paths: '**/*.cls,**/*.trigger,**/*.apex,**/lwc/**,**/aura/**,**/objects/**,**/*.object-meta.xml,sfdx-project.json,**/flows/**,**/flexipages/**,**/permissionsets/**,**/profiles/**'
---
# Salesforce LWC skill
## Wire adapters
- Reactive params: `@wire(getX, { id: '$recordId' })` — the `$` is a contract with the framework
- Imperative for mutations or one-shot fetches: import directly, call as function
- Always handle `error` and `data` branches in wire handlers
- Use `refreshApex(this.wiredX)` after DML to refresh cached results
## Events
- `dispatchEvent(new CustomEvent('change', { detail, bubbles: true, composed: true }))`
- `composed: true` only when crossing shadow DOM boundaries — usually at a top-level component
- Don't use DOM events for parent→child; use `@api` props
- Don't use `@api` methods for parent←child; use events
## Lifecycle order
1. `constructor`
2. `connectedCallback` (in DOM)
3. wires fire
4. `renderedCallback` (after each render)
5. `disconnectedCallback` (out of DOM)
6. `errorBoundaryCallback` (parent only)
Avoid: heavy work in `renderedCallback` — fires on every re-render. Guard with a `_initialized` flag.
## State
- Mutable arrays/objects need re-assignment to trigger reactivity: `this.list = [...this.list, item]`
- Track is implicit on `@api` and `@track` is no longer required for primitives
- Use `lwc/wire` for store-shaped state; otherwise local class fields
## Performance
- `lwc-recipes` is the canonical reference for patterns
- Lazy-load heavy children with `if:true`
- Avoid full re-renders — use keyed `for:each` with stable `key`
- Profile with the LWC Performance Inspector in Chrome devtools
## Testing
- `@salesforce/sfdx-lwc-jest` for unit tests
- `createElement('c-foo', { is: Foo })` then `document.body.appendChild(el)`
- `await Promise.resolve()` between actions to flush microtasks
- Mock wire adapters with `registerLdsTestWireAdapter` (for LDS) or `createApexTestWireAdapter` (for Apex)
## Common bugs
- "Cannot assign to read-only property" — assigning to `@api` from within the component
- Wire not firing — param starts undefined, fix with `?? null` or wait for value
- Style not applying — selector specificity issue across shadow DOM
- `connectedCallback` runs but child template `querySelector` returns null — DOM not yet rendered, use `renderedCallback`
Wersje
W bazie nie ma innych skilli o nazwie salesforce-lwc.
Migawka bazy z 28.10.2026 · wersja paczki eca8809e2447 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100sf-b2b-lwc
Buduje komponenty LWC dla B2B Commerce z dekoratorami @api, @track i @wire, adapterami danych commerce, zdarzeniami, Lightning Web Security i testami Jest. - 100lwc
Podaje wytyczne i dobre praktyki tworzenia Lightning Web Components na platformie Salesforce, stosowane do plików w force-app/main/default/lwc. - 85salesforce-development
Podaje wzorce rozwoju na platformie Salesforce: Lightning Web Components, triggery i klasy Apex, API REST i Bulk, Connected Apps oraz Salesforce DX ze scratch orgami i pakietami 2GP. - 100experience-lwc-generate
Tworzy i edytuje Lightning Web Components metodą PICKLES z oceną 165 punktów, w tym wzorce wire service, SLDS i testy Jest dla LWC. - 100experience-lwc-base-components-integrate
Dobiera właściwy komponent Lightning Base Component (lightning-*) do zadania UI, pobiera jego pełne API z wbudowanej referencji i podpina go w LWC bez psucia SLDS. - 100salesforce-developer
Pisze i debuguje Apex, buduje Lightning Web Components, optymalizuje SOQL, implementuje triggery, batch joby, platform events i integracje na platformie Salesforce.