Skip to content

feat!: trim the v1 event and log API - #139

Merged
lcottercertinia merged 7 commits into
mainfrom
refactor/trim-event-api
Oct 15, 2026
Merged

lcottercertinia merged 7 commits into
mainfrom
refactor/trim-event-api

Conversation

@lukecotter

@lukecotter lukecotter commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

📝 Overview

Trims the v1 event and log API before the v1 release. Each cut removes a value that adds nothing for a parser, or moves a UI choice out of it. .changeset/v1.md states each change for a v0.x migration.

🛠️ Changes

  • Remove ApexLog.executionEndTime. endTimestamp is where the log ends.
  • Remove event suffix. It was display text.
  • Remove event and type category, and the CATEGORY const. Use kind or debugCategory.
  • Replace cpuType with eventType(type).consumesCpuTime. It is false for the database frames and CALLOUT_REQUEST, whose own time the platform does not count toward the Apex CPU limit.
  • Rename hasValidSymbols to isApexCall. The rule is unchanged.
  • Rename timestamp to startTimestamp and exitStamp to endTimestamp, on events, ApexLog and columns. A leaf ends where it starts, so endTimestamp is a number on every event and in columns. Before, a leaf had null and columns held NaN.

One concern per commit: 6 code commits, then 1 that shortens .changeset/v1.md to the headline and the main differences.

🧩 Type of change

  • 🐛 Bug fix — fixes an issue
  • ✨ Feature — adds new functionality
  • ♻️ Refactor — no behaviour change
  • ⚡ Performance
  • 📝 Docs
  • 🔧 Chore — tooling, CI, deps
  • 💥 Breaking change

🔗 Related issues

None.

✅ Checklist

  • Tests added/updated
  • pnpm run ci passes locally
  • Changeset added (pnpm changeset) if this affects the published package
  • Docs updated if behaviour or the public API changed

exitStamp already states where the log ends. The value differed only
when the log ends in a leaf after the last frame, and nothing reads it.

BREAKING CHANGE: ApexLog.executionEndTime is removed. Read the exitStamp
of the last frame in children for the end of the last frame at the top.
suffix was display text, such as " (code unit)", chosen by event type. A
caller that wants a label builds it from type and text.

BREAKING CHANGE: ApexEvent.suffix is removed. For what started a flow,
read details.codeUnitType of the code unit above it.
category was a timeline group (Apex, System, SOQL and so on): a display
choice, not a fact of the log. A caller that wants a group can use kind
or debugCategory, or group by type.

BREAKING CHANGE: ApexEvent.category, EventTypeInfo.category, the CATEGORY
const and the Category type are removed.
cpuType grouped an event's CPU time into six values, and one of them,
"free", was the only Salesforce fact. It was set per event, but it holds
for every event of a type. State it on the type, from the docs: the
database time of DML, SOQL and SOSL, and the wait for a callout, use no
application server CPU, so the platform does not count them toward the
Apex CPU limit.

BREAKING CHANGE: ApexEvent.cpuType, the CPU_TYPE const and the CpuType
type are removed. EventTypeInfo.consumesCpuTime is false for the database
frames and CALLOUT_REQUEST; use it in place of cpuType === 'free'.
The flag is true for a call into Apex code: a method entry, a constructor
entry, and a Visualforce call that opens a frame. "Valid symbols" described
a symbol lookup, which is a display concern.

BREAKING CHANGE: ApexEvent.hasValidSymbols is now isApexCall. The rule is
unchanged.
A leaf ends where it starts, so endTimestamp is a number on every event
and in columns. Before, a leaf had exitStamp null and columns held NaN.

BREAKING CHANGE: timestamp is now startTimestamp and exitStamp is now
endTimestamp, on events, ApexLog and columns. A leaf's endTimestamp is
its startTimestamp.
@codspeed

codspeed Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing refactor/trim-event-api (52d3707) with main (f769b6a)

Open in CodSpeed

The v1 changeset listed every changed property. A migrator needs the
design differences, so it states those, and the speed and memory figures.
@lcottercertinia
lcottercertinia merged commit 3560a68 into main Oct 15, 2026
10 checks passed
@lcottercertinia
lcottercertinia deleted the refactor/trim-event-api branch October 15, 2026 20:35
lcottercertinia pushed a commit that referenced this pull request Oct 16, 2026
)

## 📝 Overview

`suffix` was removed from v1. It told Flow and Process Builder apart for
`FLOW_START_INTERVIEWS_BEGIN`, and a caller now has to climb to the code
unit to get that. This adds the answer back, on the event.

## 🛠️ Changes

- Add `details.flowType` to `FLOW_START_INTERVIEWS_BEGIN`: `'flow' |
'processBuilder' | null`.
- The log line states none of it, so it is read from the code unit above
the interviews:
  - `Flow` unit, or interviews inside other interviews: `'flow'`.
  - `Workflow` unit: `'processBuilder'`.
- Any other unit, or none: `null`. The old `suffix` said Process Builder
for any unit that was not `Flow`.
- Add tests for each case.

## 🧩 Type of change

- [ ] 🐛 Bug fix — fixes an issue
- [x] ✨ Feature — adds new functionality
- [ ] ♻️ Refactor — no behaviour change
- [ ] ⚡ Performance
- [ ] 📝 Docs
- [ ] 🔧 Chore — tooling, CI, deps
- [ ] 💥 Breaking change

## 🔗 Related issues

Follows #139, which removed `suffix`.

## ✅ Checklist

- [x] Tests added/updated
- [x] `pnpm run ci` passes locally
- [ ] Changeset added (`pnpm changeset`) if this affects the published
package: not needed, `.changeset/v1.md` already lists `suffix` as
removed, and `flowType` is new
- [x] Docs updated if behaviour or the public API changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants