payload-plugin-newsletter 0.20.0 → 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,46 @@
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
+
29
+ ## [0.20.1] - 2025-07-31
30
+
31
+ ### Fixed
32
+ - **Next.js App Router Compatibility** - Fixed React `createContext` error in Next.js App Router
33
+ - Added missing `"use client"` directive to `PluginConfigContext`
34
+ - Added `"use client"` directive to component barrel exports
35
+ - Fixed server-side rendering issues with client components
36
+ - Improved compatibility with Next.js 15+ App Router
37
+
38
+ ### Technical Changes
39
+ - Added `"use client"` directive to `PluginConfigContext.tsx`
40
+ - Added `"use client"` directive to `EmptyField.tsx`
41
+ - Added `"use client"` directive to component index files
42
+ - Ensured proper server/client component separation
43
+
1
44
  ## [0.20.0] - 2025-07-31
2
45
 
3
46
  ### Added