Skip to content

feat(P074): consolidate React embed on the @simplepdf/embed core#38

Merged
bendersej merged 4 commits into
mainfrom
react-embed-consolidation
Jun 29, 2026
Merged

feat(P074): consolidate React embed on the @simplepdf/embed core#38
bendersej merged 4 commits into
mainfrom
react-embed-consolidation

Conversation

@bendersej

Copy link
Copy Markdown
Member

Background

Phase 7 of P074 (plans/P074-embed-bridge-refactor.md): consolidate @simplepdf/react-embed-pdf onto the framework-free @simplepdf/embed core so both packages share one generated, camelCase, agentic surface — shipped as a non-breaking minor (@simplepdf/embed@0.5.0, @simplepdf/react-embed-pdf@1.11.0).

Changes

  • embed — grouped handle: createEmbed returns { actions, events, lifecycle }embed.actions.* (operations), embed.events.on(type, handler) (granular subscriptions), embed.lifecycle.dispose().
  • embed — camelCase SDK: methods, args, results, and agentic tool names are camelCase, generated from embed-api.json; the snake_case wire is transformed at the postMessage boundary. Outbound events stay verbatim snake_case (the stable 1.x contract).
  • embed — misc: companyIdentifier replaces tenant; SimplePDF documents URLs load directly; routeToolCall takes the actions group; zod is an opt-in peer (/tools, /ai-sdk, /schemas); the main entry is zero-dependency.
  • react — non-breaking rebuild (1.11.0): built on the core; the flat 1.x EmbedActions ref is preserved (embedRef.current.selectTool(...)), onEmbedEvent stays verbatim, modal is still the default, documentURL is a deprecated alias for document. useEmbed().actions is now the full editor surface; selectTool/submit keep their 1.x argument overloads.
  • react — agentic opt-in: the tools moved to a new @simplepdf/react-embed-pdf/ai-sdk subpath (useEmbedTools(embedRef)), so the package root stays zod-free — mirroring the core's main vs /ai-sdk split.
  • copilot: dog-foods the new API (useEmbedTools, camelCase tools/actions, DOCUMENT_LOADED readiness).
  • docs: the embed + react READMEs and documentation/IFRAME.md are rewritten for the grouped handle + agentic ("fill and read this for me") examples.

Notes

  • Versions bump via the Changeset Release flow: merge this PR → a "Version Packages" PR (embed@0.5.0, react@1.11.0) → merge that → auto-publish to npm (latest). Both changesets are minor (no major).
  • copilot/package-lock.json is regenerated after the packages publish (it cannot reference versions that are not yet on npm): publish → npm install in copilot/ → deploy copilot (manual; deploy_on_push: false).

Rebuild @simplepdf/react-embed-pdf on the framework-free @simplepdf/embed core: grouped handle (actions / events / lifecycle), camelCase + agentic surface generated from embed-api.json, opt-in /ai-sdk. Non-breaking minor (react@1.11.0, embed@0.5.0).
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
simplepdf-webhooks 5a28116 Commit Preview URL

Branch Preview URL
Jun 26 2026, 04:15 PM

@bendersej bendersej merged commit 980906d into main Jun 29, 2026
4 checks passed
@bendersej bendersej deleted the react-embed-consolidation branch June 29, 2026 08:36
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