Rules Hub
Coding Rules Library
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Audit downstream consumers when changing a shared component
When altering a shared/library component's behavior or defaults, check and fix consumers that override or rely on the old behavior.
Bad example
| 1 | // Change a shared Dropdown's default portal target |
| 2 | // Ship it without checking the apps that consume it. |
| 3 | // A consumer that previously added `container={appRoot}` to |
| 4 | // compensate now double-applies or conflicts with the new default. |
Explanation (EN)
Changing a shared component in isolation ignores consumers that were written against the old behavior. Their overrides may now be redundant, conflicting, or wrong, causing breakage you never see in the library repo.
Objašnjenje (HR)
Mijenjanje dijeljene komponente izolirano zanemaruje potrošače napisane za staro ponašanje. Njihova nadjačavanja sada mogu biti suvišna, u sukobu ili pogrešna, uzrokujući kvarove koje nikad ne vidiš u repozitoriju biblioteke.
Good example
| 1 | // 1. Change the shared component's default. |
| 2 | // 2. Search consuming apps for `container=` overrides on that component. |
| 3 | // 3. Remove now-redundant overrides / adjust ones that conflict. |
| 4 | // 4. Land library + consumer fixes together (or coordinate the rollout). |
Explanation (EN)
Treating a shared-component change as a cross-repo task means consumers that compensated for the old behavior get cleaned up in the same effort, so the new default actually takes effect without surprises.
Objašnjenje (HR)
Tretiranje promjene dijeljene komponente kao zadatka kroz više repozitorija znači da se potrošači koji su kompenzirali staro ponašanje očiste u istom naporu, pa nova zadana vrijednost stvarno stupi na snagu bez iznenađenja.
Notes (EN)
Applies whenever a change in one package alters a contract that other packages depend on, not only React components.
Bilješke (HR)
Vrijedi kad god promjena u jednom paketu mijenja ugovor o koji se oslanjaju drugi paketi, ne samo za React komponente.