finds.dev

kevinohara80/sfdc-trigger-framework

A minimal trigger framework for your Salesforce Apex Triggers

View on GitHub

★ 1,043ApexMITupdated Mar 2024

// the take

A single-class base framework for Salesforce Apex triggers that moves logic out of trigger files into handler classes. You extend TriggerHandler, override the context methods you care about, and call run() from the trigger. For any Salesforce dev tired of trigger spaghetti, this is the standard pattern in a box.

The bypass API is genuinely useful — lets you suppress cascading triggers during bulk operations without hacky static flags scattered everywhere. Max loop count guard catches recursion at runtime instead of silently eating CPU. The single-class design means there's nothing to misconfigure; the whole framework fits in one file you can read in five minutes. Test coverage in TriggerHandler_Test.cls is solid for framework-level behavior.

No built-in support for unit-of-work or bulk operation patterns — you still have to manage SOQL/DML limits yourself in each handler, which is where most trigger bugs live. The bypass state is static (transaction-scoped), so in complex flows you have to remember to clear it or you'll get mysterious skipped handlers. Last meaningful update was 2024 but the repo has been effectively in maintenance mode for years — the Salesforce ecosystem has moved toward SFDX/metadata API v2 and this still ships in the old mdapi format. No async/platform event handler pattern, so if you're doing event-driven architecture you're on your own.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,043
Forks
552
Language
Apex
License
MIT
Last commit
27 Mar 2024

// nearby

If sfdc-trigger-framework isn't quite it.

All repos →