payload-plugin-newsletter 0.20.1 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ ## [0.20.2] - 2025-07-31
2
+
3
+ ### Fixed
4
+ - **CRITICAL: Next.js App Router createContext Error** - Complete architectural fix for Next.js App Router compatibility
5
+ - Separated server and client entry points to prevent React context issues during server-side initialization
6
+ - Created dedicated `server.ts`, `client.ts`, and `admin.ts` entry points
7
+ - Fixed server-side React context imports that caused `createContext is not a function` errors
8
+ - Updated package.json exports to properly route to server-safe and client-safe bundles
9
+ - Implemented server-safe plugin configuration storage using simple object store
10
+ - Updated build system to generate separate bundles with proper "use client" directives
11
+
12
+ ### Breaking Changes (Minor)
13
+ - **Import Path Changes**:
14
+ - Admin components: `import { BroadcastInlinePreview } from 'payload-plugin-newsletter/admin'` (was `/components`)
15
+ - Client components: `import { NewsletterForm } from 'payload-plugin-newsletter/client'`
16
+ - Server exports: `import { newsletterPlugin } from 'payload-plugin-newsletter'` (unchanged)
17
+ - **Context API Changes**:
18
+ - Server-side config access through `getPluginConfig()` instead of React context
19
+ - Client-side React context requires explicit `PluginConfigProvider` setup
20
+
21
+ ### Technical Changes
22
+ - Added separate entry points: `src/server.ts`, `src/client.ts`, `src/admin.ts`
23
+ - Created `ServerContext.ts` for server-safe configuration storage
24
+ - Created `ClientContext.tsx` for client-side React context
25
+ - Updated tsup config to build multiple entry points with proper directives
26
+ - Fixed plugin initialization to use server-safe config storage
27
+ - Updated package.json exports to route to appropriate bundles
28
+
1
29
  ## [0.20.1] - 2025-07-31
2
30
 
3
31
  ### Fixed