Skip to content

v0.12.0 — @formepdf/preact adapter

Choose a tag to compare

@danmolitor danmolitor released this 26 Aug 01:50
· 120 commits to main since this release

Third-party framework support gets its second entry. Preact 10 now has a native authoring adapter, alongside the existing React and Svelte adapters.

New

@formepdf/preact — Preact 10 adapter. Same component set as @formepdf/react (30+ components: Document, Page, View, Text, H1H6, lists, inline formatting, tables, media, charts, form fields, layout primitives) with identical props and byte-identical serialized JSON. Requested via GitHub issue; parity is enforced by a fixture suite.

npm install @formepdf/preact @formepdf/core   
  /** @jsxImportSource preact */                                                                                                                                                                                   
  import { Document, Page, View, Text, renderDocument } from '@formepdf/preact';                                                                                                                                   
                                                                                                                                                                                                                   
  const pdf = await renderDocument(                                                                                                                                                                                
    <Document>                                                                                                                                                                                                     
      <Page size="Letter" margin={36}>                                                                                                                                                                             
        <Text style={{ fontSize: 24, fontWeight: 'bold' }}>Invoice</Text>                                                                                                                                          
      </Page>                                                                                                                                                                                                      
    </Document>                                                                                                                                                                                                    
  );      

Why this exists (vs preact/compat aliasing with @formepdf/react): no compat shim in your bundle (~7-8KB gzipped saved), no unmet-peer warning from npm about React not being installed, Preact-native JSX runtime. See the Preact guide.

Other packages

All other @formepdf/* npm packages (shared, react, svelte, core, renderer, cli, hono, next, resend, mcp, sdk, tailwind, templates) got version-alignment bumps to 0.12.0. No functional changes.

Full changelogs

  • @formepdf/preact