Skip to content

Export createRef and refresh the browser protocol contract - #2533

Merged
leaf-agent merged 2 commits into
mainfrom
fix/ci-38214399140
Oct 12, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/ci-38214399140

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Export Lit's createRef through widget-api.js so lf-trace can be bundled for the website. The failed publish run stops because lf-trace.js imports createRef from that API, while the API exports only ref. The browser runtime already exports both names.

The existing widget API test now checks that every name imported by a behavior module is exported. It failed with ['createRef'] before the fix and passes after it. The site build produced all 105 pages locally, and pnpm run test:runtime passed.

This PR also refreshes the generated protocol contract. PR CI could not reach the site gate because the earlier contract from #2505 no longer matched #2506's event names; node build/browser/build.mjs --check failed on main and pnpm run check:browser passes with the regenerated contract. #2536 carries the same contract refresh alongside its workflow cleanup, but its own site gate failed on the missing createRef. Including both repairs here lets the required test check verify and land them together.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI currently blocks this head: test stops at check:browser with “Stale protocol contract,” and the dependent lint check fails. The base tree declares event protocol 2 in registry.json, while build/browser/protocol-contract.d.ts still names protocol 1; this PR changes neither file. The createRef export and its focused API test pass review.

@leaf-agent leaf-agent changed the title Export createRef from the widget API for lf-trace Export createRef and refresh the browser protocol contract Oct 12, 2026
max-sixty added a commit that referenced this pull request Oct 12, 2026
Branch protection now requires `test`, the combined CI gate. Remove the
temporary `lint` dependency check used to land the rename while the old
requirement was still active.

Also regenerate the protocol baseline introduced by [PR
#2505](#2505). That change landed
a protocol-1 baseline after the registry had already moved to protocol
2, causing the cleanup PR's browser build to fail with `Stale protocol
contract`. The canonical build refreshes the baseline for protocol 2; no
other generated output changes.

Reuse the reviewed correction from [PR
#2533](#2533): export `createRef`
from the widget API so the website can bundle `lf-trace`, and check that
widget imports resolve through the API. That PR was blocked by the same
stale protocol baseline; combining the corrections lets the cleanup
clear both CI prerequisites.

Validation: `pnpm run build:browser`, all 361 runtime tests, the focused
widget API test, pinned actionlint, YAML validation and `git diff
--check` passed.

> _This was written by Codex on behalf of max-sixty_

---------

Co-authored-by: leaf-agent <[email protected]>
@leaf-agent
leaf-agent merged commit fe1051a into main Oct 12, 2026
3 checks passed
@leaf-agent
leaf-agent deleted the fix/ci-38214399140 branch October 12, 2026 07:37
max-sixty added a commit that referenced this pull request Oct 12, 2026
… test

#2533 added to the deleted Python test a check that every name a behavior module
imports from widget-api.js is exported; tests/runtime/widget-api.test.mjs now holds
it, reading package, kernel-widget, example and fixture modules (HTML module scripts
included) with acorn. createRef joins the documented Lit exports, and main's
first-paint section now names keepView and tabStore.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 12, 2026
…he two agree (#2538)

widget-api.js is the helper surface package behavior modules import, and
module-authoring.md documents it for package authors; 83 of its exports
were named nowhere in that reference. Each export is now one of two
kinds, read from the module's source: exports above its `// Internal:`
comment are the authoring API and are documented in module-authoring.md,
and exports below it serve Leaf's bundled packages and kernel widgets
alone. Of the 83, 71 are now documented in the section that owns their
topic, 11 moved below the marker (mountSample, dressSamples, wear,
landInThread, threadInput, setRuntimeRootStyle, removeRuntimeRootStyle,
shownParts, renderRetired, textNodesUnder, isPagePaint), and
offerElement left the surface because nothing imported it from there.
The new tests/runtime/widget-api.test.mjs parses widget-api.js and the
importing modules with acorn and fails when an authoring export is
undocumented, an internal export is documented or has no bundled
importer, a behavior module imports a name the module does not export,
or the reference calls a helper it does not export. It replaces
test_every_widget_api_export_has_a_behavior_module_reader, including the
import check #2533 added to it.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.

1 participant