Skip to content

feat: support async declarative template strings#7558

Draft
janechu wants to merge 1 commit into
releases/fast-element-v3from
users/janechu/allow-declarative-template-function-to-accept-a-string
Draft

feat: support async declarative template strings#7558
janechu wants to merge 1 commit into
releases/fast-element-v3from
users/janechu/allow-declarative-template-function-to-accept-a-string

Conversation

@janechu
Copy link
Copy Markdown
Collaborator

@janechu janechu commented Jun 3, 2026

Pull Request

📖 Description

Adds support for async declarative template strings in declarativeTemplate({ callback }). The callback now receives a templateStringResolver that accepts a string | Promise<string> containing an <f-template> element and resolves it through the existing declarative template path.

This also adds source-level coverage, an ecosystem async-template-string fixture, updated API/docs/website generated content, size docs, and a change file.

👩‍💻 Reviewer Notes

Please focus review on the callback resolver semantics and diagnostic behavior: callbacks must return or await the resolver, and callbacks that complete without resolving now reject with a clear diagnostic instead of hanging.

Root npm run test was run. It fails only with unrelated Firefox caveats after exact reruns: the unmodified hydration Firefox failure (hydration.pw.spec.ts:179:5, element.$fastController is undefined) plus Firefox fixture flakes that pass on exact rerun/full fast-test-harness rerun.

📑 Test Plan

  • npm ci
  • npx playwright install --with-deps
  • npm run build
  • npm run biome:check
  • npm run checkchange
  • Focused fast-element TypeScript/lint/docs/API/fixture tests passed
  • Root npm run test was run with the unrelated Firefox caveats noted above

✅ Checklist

General

  • I have included a change request file using $ npm run change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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